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

Function TestPiEngine_GetExecutionSteps_WithModel

pkg/workflow/pi_engine_test.go:199–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

197}
198
199func TestPiEngine_GetExecutionSteps_WithModel(t *testing.T) {
200 engine := NewPiEngine()
201 workflowData := &WorkflowData{
202 Name: "test-workflow",
203 EngineConfig: &EngineConfig{ID: "pi", Model: "copilot/claude-sonnet-4"},
204 ParsedTools: NewTools(map[string]any{}),
205 }
206 steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/agent-stdio.log")
207 require.NotEmpty(t, steps, "Steps should not be empty")
208
209 stepText := strings.Join(steps[0], "\n")
210 // When firewall is not enabled, Pi is invoked with the --model flag using the
211 // native github-copilot provider (Pi's built-in provider for GitHub Copilot).
212 assert.Contains(t, stepText, "--model", "Step should pass --model flag to Pi CLI")
213 assert.Contains(t, stepText, "github-copilot", "Non-firewall copilot model should use github-copilot/ provider prefix")
214 assert.Contains(t, stepText, "claude-sonnet-4", "Step should include the model ID portion")
215 assert.Contains(t, stepText, "GH_AW_PI_MODEL", "Step should expose the original workflow model to Pi extensions")
216 assert.NotContains(t, stepText, "\n PI_MODEL:", "Step should not set PI_MODEL in the environment when the CLI model is passed via --model")
217}
218
219func TestPiEngine_GetExecutionSteps_IgnoresRedundantYoloArg(t *testing.T) {
220 engine := NewPiEngine()

Callers

nothing calls this directly

Calls 3

GetExecutionStepsMethod · 0.95
NewPiEngineFunction · 0.85
NewToolsFunction · 0.85

Tested by

no test coverage detected