(t *testing.T)
| 294 | } |
| 295 | |
| 296 | func TestEnsureCopilotSetupStepsFilePermissions(t *testing.T) { |
| 297 | tmpDir := testutil.TempDir(t, "test-*") |
| 298 | |
| 299 | originalDir, err := os.Getwd() |
| 300 | if err != nil { |
| 301 | t.Fatalf("Failed to get current directory: %v", err) |
| 302 | } |
| 303 | defer func() { |
| 304 | _ = os.Chdir(originalDir) |
| 305 | }() |
| 306 | |
| 307 | if err := os.Chdir(tmpDir); err != nil { |
| 308 | t.Fatalf("Failed to change to temp directory: %v", err) |
| 309 | } |
| 310 | |
| 311 | err = ensureCopilotSetupSteps(context.Background(), false, workflow.ActionModeDev, "dev") |
| 312 | if err != nil { |
| 313 | t.Fatalf("ensureCopilotSetupSteps(context.Background()) failed: %v", err) |
| 314 | } |
| 315 | |
| 316 | // Check file permissions |
| 317 | setupStepsPath := filepath.Join(".github", "workflows", "copilot-setup-steps.yml") |
| 318 | info, err := os.Stat(setupStepsPath) |
| 319 | if err != nil { |
| 320 | t.Fatalf("Failed to stat copilot-setup-steps.yml: %v", err) |
| 321 | } |
| 322 | |
| 323 | // Verify file is readable and writable |
| 324 | mode := info.Mode() |
| 325 | if mode.Perm()&0600 != 0600 { |
| 326 | t.Errorf("Expected file to have at least 0600 permissions, got %o", mode.Perm()) |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | func TestCopilotWorkflowStepStructure(t *testing.T) { |
| 331 | t.Parallel() |
nothing calls this directly
no test coverage detected