Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmd/gh-aw/main_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func TestValidateEngine(t *testing.T) {
engine: "copilot",
expectErr: false,
},
{
name: "valid copilot-sdk engine",
engine: "copilot-sdk",
expectErr: false,
},
{
name: "valid custom engine",
engine: "custom",
Expand Down Expand Up @@ -89,7 +94,7 @@ func TestValidateEngine(t *testing.T) {

// Check that error message contains the expected format
// Error may include "Did you mean" suggestions, so we check if it starts with the base message
expectedMsg := fmt.Sprintf("invalid engine value '%s'. Must be 'claude', 'codex', 'copilot', or 'custom'", tt.engine)
expectedMsg := fmt.Sprintf("invalid engine value '%s'. Must be 'claude', 'codex', 'copilot', 'copilot-sdk', or 'custom'", tt.engine)
if tt.errMessage != "" && !strings.HasPrefix(err.Error(), expectedMsg) {
t.Errorf("validateEngine(%q) error message = %v, want to start with %v", tt.engine, err.Error(), expectedMsg)
}
Expand Down
19 changes: 12 additions & 7 deletions pkg/workflow/imported_steps_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ This workflow imports a custom engine with agentic secrets.

require.Error(t, err, "Expected error in strict mode")
if err != nil {
assert.Contains(t, err.Error(), "strict mode", "Error should mention strict mode")
assert.Contains(t, err.Error(), "COPILOT_GITHUB_TOKEN", "Error should mention the secret name")
assert.Contains(t, err.Error(), "GitHub Copilot CLI", "Error should mention the engine")
assert.Contains(t, err.Error(), "custom engine steps", "Error should mention custom engine steps")
errMsg := err.Error()
assert.Contains(t, errMsg, "strict mode", "Error should mention strict mode")
assert.Contains(t, errMsg, "COPILOT_GITHUB_TOKEN", "Error should mention the secret name")
// Check for either Copilot CLI or Copilot SDK (both use COPILOT_GITHUB_TOKEN)
hasCopilotCLI := strings.Contains(errMsg, "GitHub Copilot CLI")
hasCopilotSDK := strings.Contains(errMsg, "GitHub Copilot SDK")
assert.True(t, hasCopilotCLI || hasCopilotSDK, "Error should mention the engine (GitHub Copilot CLI or GitHub Copilot SDK)")
assert.Contains(t, errMsg, "custom engine steps", "Error should mention custom engine steps")
}
})

Expand Down Expand Up @@ -329,10 +333,11 @@ imports:
// Should mention both secrets
assert.Contains(t, errMsg, "COPILOT_GITHUB_TOKEN")
assert.Contains(t, errMsg, "ANTHROPIC_API_KEY")
// Should mention the engines (GitHub Copilot CLI and/or Claude Code)
hasCopilot := strings.Contains(errMsg, "GitHub Copilot CLI")
// Should mention the engines (GitHub Copilot CLI/SDK and/or Claude Code)
hasCopilotCLI := strings.Contains(errMsg, "GitHub Copilot CLI")
hasCopilotSDK := strings.Contains(errMsg, "GitHub Copilot SDK")
hasClaude := strings.Contains(errMsg, "Claude Code")
assert.True(t, hasCopilot || hasClaude, "Should mention the engines")
assert.True(t, hasCopilotCLI || hasCopilotSDK || hasClaude, "Should mention the engines")
}
}

Expand Down