MCPcopy Create free account
hub / github.com/github/gh-aw / TestCacheMemoryScopeDefault

Function TestCacheMemoryScopeDefault

pkg/workflow/cache_scope_validation_test.go:128–146  ·  view source on GitHub ↗

TestCacheMemoryScopeDefault tests that omitting scope defaults to "workflow"

(t *testing.T)

Source from the content-addressed store, hash-verified

126
127// TestCacheMemoryScopeDefault tests that omitting scope defaults to "workflow"
128func TestCacheMemoryScopeDefault(t *testing.T) {
129 toolsMap := map[string]any{
130 "cache-memory": map[string]any{
131 "key": "my-cache-key",
132 },
133 }
134
135 toolsConfig, err := ParseToolsConfig(toolsMap)
136 require.NoError(t, err, "Should parse tools config")
137
138 compiler := NewCompiler()
139 config, err := compiler.extractCacheMemoryConfig(toolsConfig)
140
141 require.NoError(t, err, "Should not error when scope is omitted")
142 require.NotNil(t, config, "Config should not be nil")
143 require.Len(t, config.Caches, 1, "Should have exactly one cache entry")
144
145 assert.Equal(t, "workflow", config.Caches[0].Scope, "Default scope should be 'workflow'")
146}

Callers

nothing calls this directly

Calls 3

ParseToolsConfigFunction · 0.85
NewCompilerFunction · 0.85

Tested by

no test coverage detected