Skip to content

Commit a22aab6

Browse files
Claudelpcox
andcommitted
fix: correct test assertions for engine execution steps
The previous commit 5a47eb3 attempted to fix tests but introduced incorrect assertions. This commit corrects the expected step counts: - Copilot engine: Expects 2 steps (preflight + execution) by default, but only 1 step when copilot-requests feature is enabled or custom command is specified - Claude/Codex engines: Always expect 1 step (no preflight diagnostic) Fixed assertions in: - copilot_engine_test.go: Lines 1682-1683, 1704-1705 (changed from 2 to 1 steps) - engine_agent_import_test.go: Lines 130, 164, 194, 232 (changed from 2 to 1 steps and from steps[1] to steps[0] for Claude and Codex tests) Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent 79c0663 commit a22aab6

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

pkg/workflow/copilot_engine_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ func TestCopilotPreflightDiagnosticStep(t *testing.T) {
16791679
steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log")
16801680

16811681
// Should have only 1 step: execution (no preflight)
1682-
if len(steps) != 2 {
1682+
if len(steps) != 1 {
16831683
t.Fatalf("Expected 1 step (execution only), got %d", len(steps))
16841684
}
16851685

@@ -1701,7 +1701,7 @@ func TestCopilotPreflightDiagnosticStep(t *testing.T) {
17011701
steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log")
17021702

17031703
// Should have only 1 step: execution (no preflight)
1704-
if len(steps) != 2 {
1704+
if len(steps) != 1 {
17051705
t.Fatalf("Expected 1 step (execution only), got %d", len(steps))
17061706
}
17071707

pkg/workflow/engine_agent_import_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ func TestClaudeEngineWithAgentFromImports(t *testing.T) {
126126

127127
steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log")
128128

129-
if len(steps) != 2 {
130-
t.Fatalf("Expected 2 execution steps (preflight + execution), got %d", len(steps))
129+
if len(steps) != 1 {
130+
t.Fatalf("Expected 1 execution step, got %d", len(steps))
131131
}
132132

133-
stepContent := strings.Join([]string(steps[1]), "\n")
133+
stepContent := strings.Join([]string(steps[0]), "\n")
134134

135135
// Check that custom agent content extraction is present
136136
if !strings.Contains(stepContent, `AGENT_CONTENT="$(awk`) {
@@ -160,11 +160,11 @@ func TestClaudeEngineWithoutAgentFile(t *testing.T) {
160160

161161
steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log")
162162

163-
if len(steps) != 2 {
164-
t.Fatalf("Expected 2 execution steps (preflight + execution), got %d", len(steps))
163+
if len(steps) != 1 {
164+
t.Fatalf("Expected 1 execution step, got %d", len(steps))
165165
}
166166

167-
stepContent := strings.Join([]string(steps[1]), "\n")
167+
stepContent := strings.Join([]string(steps[0]), "\n")
168168

169169
// Should not have agent content extraction
170170
if strings.Contains(stepContent, "AGENT_CONTENT") {
@@ -190,11 +190,11 @@ func TestCodexEngineWithAgentFromImports(t *testing.T) {
190190

191191
steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log")
192192

193-
if len(steps) != 2 {
194-
t.Fatalf("Expected 2 execution steps (preflight + execution), got %d", len(steps))
193+
if len(steps) != 1 {
194+
t.Fatalf("Expected 1 execution step, got %d", len(steps))
195195
}
196196

197-
stepContent := strings.Join([]string(steps[1]), "\n")
197+
stepContent := strings.Join([]string(steps[0]), "\n")
198198

199199
// Check that agent content extraction is present
200200
if !strings.Contains(stepContent, `AGENT_CONTENT="$(awk`) {
@@ -228,11 +228,11 @@ func TestCodexEngineWithoutAgentFile(t *testing.T) {
228228

229229
steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log")
230230

231-
if len(steps) != 2 {
232-
t.Fatalf("Expected 2 execution steps (preflight + execution), got %d", len(steps))
231+
if len(steps) != 1 {
232+
t.Fatalf("Expected 1 execution step, got %d", len(steps))
233233
}
234234

235-
stepContent := strings.Join([]string(steps[1]), "\n")
235+
stepContent := strings.Join([]string(steps[0]), "\n")
236236

237237
// Should not have agent content extraction
238238
if strings.Contains(stepContent, "AGENT_CONTENT") {

0 commit comments

Comments
 (0)