diff --git a/pkg/cli/portfolio_analyst_workflow_contract_test.go b/pkg/cli/portfolio_analyst_workflow_contract_test.go index dd4b73db75a..3acaf499a42 100644 --- a/pkg/cli/portfolio_analyst_workflow_contract_test.go +++ b/pkg/cli/portfolio_analyst_workflow_contract_test.go @@ -12,6 +12,7 @@ import ( // unconfirmed-numeric Sentry fields. The tokens below are the stable contract // surface; changing them requires updating both the workflow source and this test. func TestPortfolioAnalystAvoidsInvalidSentryAggregations(t *testing.T) { + t.Parallel() content, err := os.ReadFile(filepath.Join("..", "..", ".github", "workflows", "portfolio-analyst.md")) if err != nil { t.Fatalf("failed to read portfolio analyst workflow source: %v", err) @@ -47,6 +48,7 @@ func TestPortfolioAnalystAvoidsInvalidSentryAggregations(t *testing.T) { // The tokens below are the stable contract surface; changing them requires // updating both the shared import and this test. func TestSharedSentryImportFailsFastOnRepeatedQuery400s(t *testing.T) { + t.Parallel() content, err := os.ReadFile(filepath.Join("..", "..", ".github", "workflows", "shared", "mcp", "sentry.md")) if err != nil { t.Fatalf("failed to read shared Sentry MCP import: %v", err) diff --git a/pkg/cli/pr_automerge_test.go b/pkg/cli/pr_automerge_test.go index b5651c596e6..95796e2fd74 100644 --- a/pkg/cli/pr_automerge_test.go +++ b/pkg/cli/pr_automerge_test.go @@ -11,6 +11,7 @@ import ( // TestWaitForWorkflowCompletionUsesSignalHandling verifies that WaitForWorkflowCompletion // uses the signal-aware polling helper, which provides Ctrl-C support func TestWaitForWorkflowCompletionUsesSignalHandling(t *testing.T) { + t.Parallel() // This test verifies that the function uses PollWithSignalHandling // by checking that it times out correctly (a key feature of the helper) @@ -30,6 +31,7 @@ func TestWaitForWorkflowCompletionUsesSignalHandling(t *testing.T) { // propagates cancellation when the context is cancelled, so callers (e.g. the repeat loop) // can detect an intentional interruption and stop immediately. func TestWaitForWorkflowCompletion_ContextCancellation(t *testing.T) { + t.Parallel() ctx, cancel := context.WithCancel(context.Background()) // Cancel immediately so the poll loop exits on the first ctx.Done() check. cancel() diff --git a/pkg/cli/pr_code_quality_reviewer_workflow_contract_test.go b/pkg/cli/pr_code_quality_reviewer_workflow_contract_test.go index fab39809424..0eb2445304e 100644 --- a/pkg/cli/pr_code_quality_reviewer_workflow_contract_test.go +++ b/pkg/cli/pr_code_quality_reviewer_workflow_contract_test.go @@ -13,6 +13,7 @@ import ( ) func TestPRCodeQualityReviewerWorkflowSubAgentModelContract(t *testing.T) { + t.Parallel() repoRoot, err := gitutil.FindGitRoot() if err != nil { t.Skipf("Skipping test: not in a git repository: %v", err) diff --git a/pkg/cli/pr_command_test.go b/pkg/cli/pr_command_test.go index b1a48a10598..222efaff69d 100644 --- a/pkg/cli/pr_command_test.go +++ b/pkg/cli/pr_command_test.go @@ -12,6 +12,7 @@ import ( ) func TestParsePRURL(t *testing.T) { + t.Parallel() tests := []struct { name string url string @@ -86,6 +87,7 @@ func TestParsePRURL(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() owner, repo, prNumber, err := parser.ParsePRURL(tt.url) if tt.wantErr { @@ -140,6 +142,7 @@ func TestPullRequestSupportsTransferAndAutomergeJSON(t *testing.T) { // TestNewPRCommand tests that the PR command is created properly func TestNewPRCommand(t *testing.T) { + t.Parallel() cmd := NewPRCommand() if cmd.Use != "pr" { @@ -170,6 +173,7 @@ func TestNewPRCommand(t *testing.T) { // TestNewPRTransferSubcommand tests that the transfer subcommand is created properly func TestNewPRTransferSubcommand(t *testing.T) { + t.Parallel() cmd := NewPRTransferSubcommand() if cmd.Use != "transfer " { diff --git a/pkg/cli/pr_description_caveman_workflow_contract_test.go b/pkg/cli/pr_description_caveman_workflow_contract_test.go index 62a8740cedd..8cea47065f3 100644 --- a/pkg/cli/pr_description_caveman_workflow_contract_test.go +++ b/pkg/cli/pr_description_caveman_workflow_contract_test.go @@ -13,6 +13,7 @@ import ( ) func TestPRDescriptionCavemanWorkflowSubAgentModelContract(t *testing.T) { + t.Parallel() repoRoot, err := gitutil.FindGitRoot() if err != nil { t.Skipf("Skipping test: not in a git repository: %v", err) diff --git a/pkg/cli/pr_prefetch_cache_contract_test.go b/pkg/cli/pr_prefetch_cache_contract_test.go index 4144822ba91..ca1bf6f991a 100644 --- a/pkg/cli/pr_prefetch_cache_contract_test.go +++ b/pkg/cli/pr_prefetch_cache_contract_test.go @@ -13,6 +13,7 @@ import ( ) func TestSharedPRDiffDataFetchValidatesHeadSHAForCacheHit(t *testing.T) { + t.Parallel() repoRoot, err := gitutil.FindGitRoot() if err != nil { t.Skipf("Skipping test: not in a git repository: %v", err) @@ -29,6 +30,7 @@ func TestSharedPRDiffDataFetchValidatesHeadSHAForCacheHit(t *testing.T) { } func TestTopReviewWorkflowsHaveHeadAwarePRDataCacheKeys(t *testing.T) { + t.Parallel() repoRoot, err := gitutil.FindGitRoot() if err != nil { t.Skipf("Skipping test: not in a git repository: %v", err) @@ -51,6 +53,7 @@ func TestTopReviewWorkflowsHaveHeadAwarePRDataCacheKeys(t *testing.T) { } func TestImpeccableSkillsReviewerHasDeterministicSkillSelectionGuidance(t *testing.T) { + t.Parallel() repoRoot, err := gitutil.FindGitRoot() if err != nil { t.Skipf("Skipping test: not in a git repository: %v", err) diff --git a/pkg/cli/project_command_test.go b/pkg/cli/project_command_test.go index 6201b4a388f..95838934020 100644 --- a/pkg/cli/project_command_test.go +++ b/pkg/cli/project_command_test.go @@ -16,6 +16,7 @@ import ( ) func TestNewProjectCommand(t *testing.T) { + t.Parallel() cmd := NewProjectCommand() require.NotNil(t, cmd, "Command should be created") assert.Equal(t, "project", cmd.Use, "Command name should be 'project'") @@ -25,6 +26,7 @@ func TestNewProjectCommand(t *testing.T) { } func TestNewProjectNewCommand(t *testing.T) { + t.Parallel() cmd := NewProjectNewCommand() require.NotNil(t, cmd, "Command should be created") assert.Equal(t, "new ", cmd.Use, "Command usage should be 'new <title>'") @@ -43,6 +45,7 @@ func TestNewProjectNewCommand(t *testing.T) { } func TestProjectConfig(t *testing.T) { + t.Parallel() tests := []struct { name string config ProjectConfig @@ -80,6 +83,7 @@ func TestProjectConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() assert.NotEmpty(t, tt.config.Title, "Project title should not be empty") assert.NotEmpty(t, tt.config.Owner, "Project owner should not be empty") assert.NotEmpty(t, tt.config.OwnerType, "Owner type should not be empty") @@ -89,6 +93,7 @@ func TestProjectConfig(t *testing.T) { } func TestProjectNewCommandArgs(t *testing.T) { + t.Parallel() cmd := NewProjectNewCommand() tests := []struct { @@ -115,6 +120,7 @@ func TestProjectNewCommandArgs(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() err := cmd.Args(cmd, tt.args) if tt.shouldErr { assert.Error(t, err, "Should return error for invalid arguments") @@ -126,6 +132,7 @@ func TestProjectNewCommandArgs(t *testing.T) { } func TestProjectNewCommandFlags(t *testing.T) { + t.Parallel() cmd := NewProjectNewCommand() // Check standard flags @@ -149,6 +156,7 @@ func TestProjectNewCommandFlags(t *testing.T) { } func TestParseProjectURL(t *testing.T) { + t.Parallel() tests := []struct { name string url string @@ -187,6 +195,7 @@ func TestParseProjectURL(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() result, err := parseProjectURL(tt.url) if tt.shouldErr { assert.Error(t, err, "Should return error for invalid URL") @@ -201,6 +210,7 @@ func TestParseProjectURL(t *testing.T) { } func TestEnsureSingleSelectOptionBefore(t *testing.T) { + t.Parallel() tests := []struct { name string options []singleSelectOption @@ -262,6 +272,7 @@ func TestEnsureSingleSelectOptionBefore(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() result, changed := ensureSingleSelectOptionBefore(tt.options, tt.desired, tt.beforeName) assert.Equal(t, tt.expectChanged, changed, "Changed status should match expectation") assert.Len(t, result, tt.expectedLength, "Result length should match") @@ -290,6 +301,7 @@ func TestEnsureSingleSelectOptionBefore(t *testing.T) { } func TestSingleSelectOptionsEqual(t *testing.T) { + t.Parallel() tests := []struct { name string a []singleSelectOption @@ -341,6 +353,7 @@ func TestSingleSelectOptionsEqual(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() result := singleSelectOptionsEqual(tt.a, tt.b) assert.Equal(t, tt.expected, result, "Equality check should match expectation") }) @@ -348,6 +361,7 @@ func TestSingleSelectOptionsEqual(t *testing.T) { } func TestProjectConfigWithProjectSetup(t *testing.T) { + t.Parallel() tests := []struct { name string config ProjectConfig diff --git a/pkg/cli/redacted_domains_test.go b/pkg/cli/redacted_domains_test.go index 115f88e379f..9f0b9401511 100644 --- a/pkg/cli/redacted_domains_test.go +++ b/pkg/cli/redacted_domains_test.go @@ -12,6 +12,7 @@ import ( ) func TestParseRedactedDomainsLog(t *testing.T) { + t.Parallel() tests := []struct { name string logContent string @@ -70,6 +71,7 @@ func TestParseRedactedDomainsLog(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() // Create a temporary file with the test content tmpDir := t.TempDir() logPath := filepath.Join(tmpDir, "redacted-urls.log") @@ -100,6 +102,7 @@ func TestParseRedactedDomainsLog(t *testing.T) { } func TestParseRedactedDomainsLog_FileNotFound(t *testing.T) { + t.Parallel() _, err := parseRedactedDomainsLog("/nonexistent/path/redacted-urls.log", false) if err == nil { t.Error("expected error for non-existent file, got nil") @@ -107,6 +110,7 @@ func TestParseRedactedDomainsLog_FileNotFound(t *testing.T) { } func TestAnalyzeRedactedDomains_DirectPath(t *testing.T) { + t.Parallel() tmpDir := t.TempDir() logContent := "example.com\ntest.org\n" logPath := filepath.Join(tmpDir, "redacted-urls.log") @@ -129,6 +133,7 @@ func TestAnalyzeRedactedDomains_DirectPath(t *testing.T) { } func TestAnalyzeRedactedDomains_AgentOutputsPath(t *testing.T) { + t.Parallel() tmpDir := t.TempDir() agentOutputsDir := filepath.Join(tmpDir, "agent_outputs") if err := os.MkdirAll(agentOutputsDir, 0755); err != nil { @@ -156,6 +161,7 @@ func TestAnalyzeRedactedDomains_AgentOutputsPath(t *testing.T) { } func TestAnalyzeRedactedDomains_FullArtifactPath(t *testing.T) { + t.Parallel() tmpDir := t.TempDir() fullPath := filepath.Join(tmpDir, "agent_outputs", "tmp", "gh-aw") if err := os.MkdirAll(fullPath, 0755); err != nil { @@ -183,6 +189,7 @@ func TestAnalyzeRedactedDomains_FullArtifactPath(t *testing.T) { } func TestAnalyzeRedactedDomains_NoLogFile(t *testing.T) { + t.Parallel() tmpDir := t.TempDir() analysis, err := analyzeRedactedDomains(tmpDir, false) @@ -196,6 +203,7 @@ func TestAnalyzeRedactedDomains_NoLogFile(t *testing.T) { } func TestAnalyzeRedactedDomains_RecursiveSearch(t *testing.T) { + t.Parallel() tmpDir := t.TempDir() // Create a nested directory structure nestedDir := filepath.Join(tmpDir, "some", "nested", "path") @@ -228,6 +236,7 @@ func TestAnalyzeRedactedDomains_RecursiveSearch(t *testing.T) { } func TestRedactedDomainsAnalysis_ConsoleRendering(t *testing.T) { + t.Parallel() // Test that the Domains field is rendered in console output analysis := &RedactedDomainsAnalysis{ TotalDomains: 3, @@ -253,6 +262,7 @@ func TestRedactedDomainsAnalysis_ConsoleRendering(t *testing.T) { } func TestRedactedDomainsLogSummary_ConsoleRendering(t *testing.T) { + t.Parallel() // Test that the Domains field in RedactedDomainsLogSummary is rendered in console output summary := &RedactedDomainsLogSummary{ TotalDomains: 2, @@ -271,6 +281,7 @@ func TestRedactedDomainsLogSummary_ConsoleRendering(t *testing.T) { } func TestRedactedDomainsAnalysis_EmptyDomains(t *testing.T) { + t.Parallel() // Test that empty domains list is handled correctly (omitempty) analysis := &RedactedDomainsAnalysis{ TotalDomains: 0, diff --git a/pkg/cli/repo_error_messages_test.go b/pkg/cli/repo_error_messages_test.go index 8f18905907e..49c43360f2e 100644 --- a/pkg/cli/repo_error_messages_test.go +++ b/pkg/cli/repo_error_messages_test.go @@ -9,6 +9,7 @@ import ( // TestRepoSlugErrorMessages verifies that repository slug format errors include examples func TestRepoSlugErrorMessages(t *testing.T) { + t.Parallel() tests := []struct { name string repoSlug string @@ -54,6 +55,7 @@ func TestRepoSlugErrorMessages(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() // Test ensureTrialRepository function err := ensureTrialRepository(tt.repoSlug, "", false, false, false) @@ -74,6 +76,7 @@ func TestRepoSlugErrorMessages(t *testing.T) { // TestParseRepoSpecErrorMessages verifies that parseRepoSpec errors include examples func TestParseRepoSpecErrorMessages(t *testing.T) { + t.Parallel() tests := []struct { name string repoSpec string @@ -107,6 +110,7 @@ func TestParseRepoSpecErrorMessages(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() _, err := parseRepoSpec(tt.repoSpec) if err == nil { diff --git a/pkg/cli/run_input_validation_test.go b/pkg/cli/run_input_validation_test.go index c07f1b36da2..484b0d13c07 100644 --- a/pkg/cli/run_input_validation_test.go +++ b/pkg/cli/run_input_validation_test.go @@ -10,6 +10,7 @@ import ( ) func TestGetWorkflowInputs(t *testing.T) { + t.Parallel() tests := []struct { name string lockContent string @@ -73,6 +74,7 @@ jobs: for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() // Create a temporary directory tmpDir := t.TempDir() tmpFile := filepath.Join(tmpDir, "test-workflow.md") @@ -115,6 +117,7 @@ jobs: } func TestValidateWorkflowInputs(t *testing.T) { + t.Parallel() tests := []struct { name string lockContent string @@ -309,6 +312,7 @@ jobs: for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() // Create a temporary directory tmpDir := t.TempDir() tmpFile := filepath.Join(tmpDir, "test-workflow.md") diff --git a/pkg/cli/run_workflow_tracking_test.go b/pkg/cli/run_workflow_tracking_test.go index d4656ef013d..6d96d1c230d 100644 --- a/pkg/cli/run_workflow_tracking_test.go +++ b/pkg/cli/run_workflow_tracking_test.go @@ -9,6 +9,7 @@ import ( // TestWorkflowRunInfo tests the WorkflowRunInfo struct func TestWorkflowRunInfo(t *testing.T) { + t.Parallel() // Test struct initialization runInfo := WorkflowRunInfo{ URL: "https://github.com/owner/repo/actions/runs/123456", @@ -37,6 +38,7 @@ func TestWorkflowRunInfo(t *testing.T) { // TestWorkflowRunInfo_EmptyValues tests handling of empty values func TestWorkflowRunInfo_EmptyValues(t *testing.T) { + t.Parallel() // Test with empty values - should be valid runInfo := WorkflowRunInfo{ URL: "", @@ -56,6 +58,7 @@ func TestWorkflowRunInfo_EmptyValues(t *testing.T) { // TestWorkflowRunInfo_StatusValues tests various status values func TestWorkflowRunInfo_StatusValues(t *testing.T) { + t.Parallel() tests := []struct { name string status string @@ -90,6 +93,7 @@ func TestWorkflowRunInfo_StatusValues(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() runInfo := WorkflowRunInfo{ URL: "https://github.com/owner/repo/actions/runs/123456", DatabaseID: 123456, @@ -110,6 +114,7 @@ func TestWorkflowRunInfo_StatusValues(t *testing.T) { // TestWorkflowRunInfo_TimestampHandling tests timestamp handling func TestWorkflowRunInfo_TimestampHandling(t *testing.T) { + t.Parallel() tests := []struct { name string createdAt time.Time @@ -139,6 +144,7 @@ func TestWorkflowRunInfo_TimestampHandling(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() runInfo := WorkflowRunInfo{ URL: "https://github.com/owner/repo/actions/runs/123456", DatabaseID: 123456, @@ -156,6 +162,7 @@ func TestWorkflowRunInfo_TimestampHandling(t *testing.T) { // TestWorkflowRunInfo_URLFormats tests various URL formats func TestWorkflowRunInfo_URLFormats(t *testing.T) { + t.Parallel() tests := []struct { name string url string @@ -180,6 +187,7 @@ func TestWorkflowRunInfo_URLFormats(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() runInfo := WorkflowRunInfo{ URL: tt.url, DatabaseID: 123456, diff --git a/pkg/cli/run_workflow_validation_test.go b/pkg/cli/run_workflow_validation_test.go index c58d7a64668..b618b917dd6 100644 --- a/pkg/cli/run_workflow_validation_test.go +++ b/pkg/cli/run_workflow_validation_test.go @@ -13,6 +13,7 @@ import ( ) func TestGetLockFilePath(t *testing.T) { + t.Parallel() tests := []struct { name string markdownPath string @@ -32,6 +33,7 @@ func TestGetLockFilePath(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() result := getLockFilePath(tt.markdownPath) assert.Equal(t, tt.expected, result) }) @@ -39,6 +41,7 @@ func TestGetLockFilePath(t *testing.T) { } func TestIsRunnable_WithLockFile(t *testing.T) { + t.Parallel() tests := []struct { name string markdownFile string @@ -160,6 +163,7 @@ jobs: } func TestGetWorkflowInputs_WithLockFile(t *testing.T) { + t.Parallel() tests := []struct { name string markdownFile string