(t *testing.T)
| 406 | } |
| 407 | |
| 408 | func TestInitRepositoryWithNoAgent(t *testing.T) { |
| 409 | tmpDir := testutil.TempDir(t, "test-*") |
| 410 | |
| 411 | originalDir, err := os.Getwd() |
| 412 | if err != nil { |
| 413 | t.Fatalf("Failed to get current directory: %v", err) |
| 414 | } |
| 415 | defer func() { |
| 416 | _ = os.Chdir(originalDir) |
| 417 | }() |
| 418 | |
| 419 | if err := os.Chdir(tmpDir); err != nil { |
| 420 | t.Fatalf("Failed to change to temp directory: %v", err) |
| 421 | } |
| 422 | |
| 423 | if err := exec.Command("git", "init").Run(); err != nil { |
| 424 | t.Skip("Git not available") |
| 425 | } |
| 426 | |
| 427 | _ = exec.Command("git", "config", "user.name", "Test User").Run() |
| 428 | _ = exec.Command("git", "config", "user.email", "test@example.com").Run() |
| 429 | |
| 430 | err = InitRepository(InitOptions{Verbose: false, Skill: true, Agent: false, MCP: true, CodespaceRepos: []string{}, CodespaceEnabled: false, Completions: false, CreatePR: false, RootCmd: nil}) |
| 431 | if err != nil { |
| 432 | t.Fatalf("InitRepository() with no agent failed: %v", err) |
| 433 | } |
| 434 | |
| 435 | if _, err := os.Stat(filepath.Join(".github", "skills", "agentic-workflows", "SKILL.md")); os.IsNotExist(err) { |
| 436 | t.Error("Expected dispatcher skill file to still be created with agent disabled") |
| 437 | } |
| 438 | if _, err := os.Stat(filepath.Join(".github", "skills", "agentic-workflow-designer", "SKILL.md")); os.IsNotExist(err) { |
| 439 | t.Error("Expected workflow designer skill file to still be created with agent disabled") |
| 440 | } |
| 441 | if _, err := os.Stat(filepath.Join(".github", "agents", "agentic-workflows.md")); err == nil { |
| 442 | t.Error("Expected Agentic Workflows custom agent file to NOT be created with agent disabled") |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | func TestInitRepositoryWithNonCopilotEngineSkipsCopilotArtifacts(t *testing.T) { |
| 447 | tmpDir := testutil.TempDir(t, "test-*") |
nothing calls this directly
no test coverage detected