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

Function TestOrchestratorCallsRenderConfig

pkg/workflow/engine_config_render_test.go:132–160  ·  view source on GitHub ↗

TestOrchestratorCallsRenderConfig verifies that setupEngineAndImports invokes RenderConfig and stores the returned steps in engineSetupResult.configSteps.

(t *testing.T)

Source from the content-addressed store, hash-verified

130// TestOrchestratorCallsRenderConfig verifies that setupEngineAndImports invokes
131// RenderConfig and stores the returned steps in engineSetupResult.configSteps.
132func TestOrchestratorCallsRenderConfig(t *testing.T) {
133 const sentinelStepName = "sentinel-config-step"
134
135 configSteps := []map[string]any{
136 {"name": sentinelStepName, "run": "echo sentinel"},
137 }
138 testEngine := newConfigRenderingEngine(configSteps)
139
140 // Build a compiler whose registry contains the test engine.
141 registry := NewEngineRegistry()
142 require.NoError(t, registry.Register(testEngine), "test engine should register without error")
143 catalog := NewEngineCatalog(registry)
144
145 compiler := NewCompiler()
146 compiler.engineRegistry = registry
147 compiler.engineCatalog = catalog
148
149 // Resolve the test engine to simulate what setupEngineAndImports does.
150 engineConfig := &EngineConfig{ID: testEngine.GetID()}
151 resolved, err := catalog.Resolve(testEngine.GetID(), engineConfig)
152 require.NoError(t, err, "test engine should resolve without error")
153
154 // Call RenderConfig directly via the resolved runtime to verify the hook.
155 steps, err := resolved.Runtime.RenderConfig(resolved)
156 require.NoError(t, err, "RenderConfig should not error")
157 require.Len(t, steps, 1, "should return exactly one config step")
158 assert.Equal(t, sentinelStepName, steps[0]["name"],
159 "config step name should match sentinel value")
160}

Callers

nothing calls this directly

Calls 8

RegisterMethod · 0.95
ResolveMethod · 0.95
newConfigRenderingEngineFunction · 0.85
NewEngineRegistryFunction · 0.85
NewEngineCatalogFunction · 0.85
NewCompilerFunction · 0.85
GetIDMethod · 0.65
RenderConfigMethod · 0.65

Tested by

no test coverage detected