TestCopilotEngineDisablesRubberDuck verifies that the Copilot engine execution steps write a settings file that disables the rubber-duck sub-agent, reducing token overhead and latency for Copilot engine runs.
(t *testing.T)
| 231 | // write a settings file that disables the rubber-duck sub-agent, reducing token overhead |
| 232 | // and latency for Copilot engine runs. |
| 233 | func TestCopilotEngineDisablesRubberDuck(t *testing.T) { |
| 234 | engine := NewCopilotEngine() |
| 235 | workflowData := &WorkflowData{ |
| 236 | Name: "test-workflow", |
| 237 | } |
| 238 | steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log") |
| 239 | |
| 240 | if len(steps) != 1 { |
| 241 | t.Fatalf("Expected 1 execution step, got %d", len(steps)) |
| 242 | } |
| 243 | |
| 244 | stepContent := strings.Join([]string(steps[0]), "\n") |
| 245 | |
| 246 | // The step should create the Copilot config directory and write a settings file |
| 247 | // that disables the rubber-duck sub-agent. |
| 248 | if !strings.Contains(stepContent, "mkdir -p \"$HOME/.copilot\"") { |
| 249 | t.Errorf("Expected 'mkdir -p \"$HOME/.copilot\"' in step content:\n%s", stepContent) |
| 250 | } |
| 251 | if !strings.Contains(stepContent, copilotSettingsDefaultContent) { |
| 252 | t.Errorf("Expected copilot settings content %q in step content:\n%s", copilotSettingsDefaultContent, stepContent) |
| 253 | } |
| 254 | if !strings.Contains(stepContent, copilotSettingsPath) { |
| 255 | t.Errorf("Expected copilot settings path %q in step content:\n%s", copilotSettingsPath, stepContent) |
| 256 | } |
| 257 | if !strings.Contains(stepContent, "rm -f \""+copilotSettingsPath+"\"") { |
| 258 | t.Errorf("Expected cleanup command to remove copilot settings path %q in step content:\n%s", copilotSettingsPath, stepContent) |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | func TestCopilotEngineExecutionSteps_WithLSPConfig(t *testing.T) { |
| 263 | engine := NewCopilotEngine() |
nothing calls this directly
no test coverage detected