TestCacheMemoryScopeDefault tests that omitting scope defaults to "workflow"
(t *testing.T)
| 126 | |
| 127 | // TestCacheMemoryScopeDefault tests that omitting scope defaults to "workflow" |
| 128 | func 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 | } |
nothing calls this directly
no test coverage detected