diff --git a/pkg/cli/audit_expanded_test.go b/pkg/cli/audit_expanded_test.go index eb31c67c20a..5be2f9b54fa 100644 --- a/pkg/cli/audit_expanded_test.go +++ b/pkg/cli/audit_expanded_test.go @@ -15,6 +15,7 @@ import ( ) func TestExtractEngineConfig(t *testing.T) { + t.Parallel() tests := []struct { name string awInfoContent string @@ -54,6 +55,7 @@ func TestExtractEngineConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() if tt.expectNil && tt.awInfoContent == "" { result := extractEngineConfigWithInferredEngine("", "") assert.Nil(t, result, "Should return nil for empty logs path") @@ -86,6 +88,7 @@ func TestExtractEngineConfig(t *testing.T) { } func TestExtractEngineConfigWithDetails(t *testing.T) { + t.Parallel() tmpDir := testutil.TempDir(t, "engine-config-details-*") awInfoContent := `{ "engine_id": "copilot", @@ -113,6 +116,7 @@ func TestExtractEngineConfigWithDetails(t *testing.T) { } func TestExtractEngineConfigInferredWithoutAwInfo(t *testing.T) { + t.Parallel() tmpDir := testutil.TempDir(t, "engine-infer-*") logContent := `{"type":"result","subtype":"success","num_turns":3,"usage":{"input_tokens":100,"output_tokens":200}}` require.NoError(t, os.WriteFile(filepath.Join(tmpDir, "agent-stdio.log"), []byte(logContent), 0o644)) @@ -124,6 +128,7 @@ func TestExtractEngineConfigInferredWithoutAwInfo(t *testing.T) { } func TestInferFallbackLogMetricsFindsNestedAgentStdioLog(t *testing.T) { + t.Parallel() tmpDir := testutil.TempDir(t, "engine-infer-nested-*") nestedDir := filepath.Join(tmpDir, "agent", "logs") require.NoError(t, os.MkdirAll(nestedDir, 0o755)) @@ -136,6 +141,7 @@ func TestInferFallbackLogMetricsFindsNestedAgentStdioLog(t *testing.T) { } func TestExtractPromptAnalysis(t *testing.T) { + t.Parallel() tests := []struct { name string promptContent string @@ -184,6 +190,7 @@ func TestExtractPromptAnalysis(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() if tt.name == "empty logs path" { result := extractPromptAnalysis("") assert.Nil(t, result, "Should return nil for empty logs path") @@ -217,6 +224,7 @@ func TestExtractPromptAnalysis(t *testing.T) { } func TestBuildSessionAnalysis(t *testing.T) { + t.Parallel() tests := []struct { name string run WorkflowRun @@ -287,6 +295,7 @@ func TestBuildSessionAnalysis(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() processedRun := ProcessedRun{ Run: tt.run, JobDetails: tt.jobDetails, @@ -314,6 +323,7 @@ func TestBuildSessionAnalysis(t *testing.T) { } func TestBuildSafeOutputSummary(t *testing.T) { + t.Parallel() tests := []struct { name string items []CreatedItemReport @@ -382,6 +392,7 @@ func TestBuildSafeOutputSummary(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() result := buildSafeOutputSummary(tt.items, tt.chainMetrics) if tt.expectNil { assert.Nil(t, result, "Should return nil for empty items") @@ -405,6 +416,7 @@ func TestBuildSafeOutputSummary(t *testing.T) { } func TestBuildSafeOutputSummaryString(t *testing.T) { + t.Parallel() tests := []struct { name string details []SafeOutputTypeDetail @@ -434,6 +446,7 @@ func TestBuildSafeOutputSummaryString(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() result := buildSafeOutputSummaryString(tt.details) assert.Equal(t, tt.expected, result, "Summary string should match") }) @@ -441,6 +454,7 @@ func TestBuildSafeOutputSummaryString(t *testing.T) { } func TestPrettifySafeOutputType(t *testing.T) { + t.Parallel() assert.Equal(t, "PR(s)", prettifySafeOutputType("create_pull_request"), "Should prettify PR type") assert.Equal(t, "issue(s)", prettifySafeOutputType("create_issue"), "Should prettify issue type") assert.Equal(t, "comment(s)", prettifySafeOutputType("add_comment"), "Should prettify comment type") @@ -448,6 +462,7 @@ func TestPrettifySafeOutputType(t *testing.T) { } func TestBuildMCPServerHealth(t *testing.T) { + t.Parallel() tests := []struct { name string mcpUsage *MCPToolUsageData @@ -488,6 +503,7 @@ func TestBuildMCPServerHealth(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() result := buildMCPServerHealth(tt.mcpUsage, tt.mcpFailures) if tt.expectNil { assert.Nil(t, result, "Should return nil when both inputs are nil/empty") @@ -506,6 +522,7 @@ func TestBuildMCPServerHealth(t *testing.T) { } func TestBuildMCPServerHealthErrorRate(t *testing.T) { + t.Parallel() mcpUsage := &MCPToolUsageData{ Servers: []MCPServerStats{ {ServerName: "github", RequestCount: 100, ToolCallCount: 80, ErrorCount: 15, AvgDuration: "200ms"}, @@ -525,6 +542,7 @@ func TestBuildMCPServerHealthErrorRate(t *testing.T) { } func TestBuildSlowestToolCalls(t *testing.T) { + t.Parallel() calls := []MCPToolCall{ {ServerName: "github", ToolName: "search_code", Duration: "100ms"}, {ServerName: "github", ToolName: "get_file", Duration: "500ms"}, @@ -542,6 +560,7 @@ func TestBuildSlowestToolCalls(t *testing.T) { } func TestBuildSlowestToolCallsEmpty(t *testing.T) { + t.Parallel() result := buildSlowestToolCalls(nil, 5) assert.Nil(t, result, "Should return nil for empty calls") @@ -550,6 +569,7 @@ func TestBuildSlowestToolCallsEmpty(t *testing.T) { } func TestBuildAuditDataWithExpandedSections(t *testing.T) { + t.Parallel() tmpDir := testutil.TempDir(t, "audit-expanded-*") // Create test aw_info.json in activation/ subdir (unflattened artifact structure) @@ -651,6 +671,7 @@ func TestBuildAuditDataWithExpandedSections(t *testing.T) { } func TestBuildAuditDataExpandedWithNoData(t *testing.T) { + t.Parallel() // Test that expanded sections are nil when no data is available processedRun := ProcessedRun{ Run: WorkflowRun{ @@ -672,6 +693,7 @@ func TestBuildAuditDataExpandedWithNoData(t *testing.T) { } func TestAwInfoHasMCPServers(t *testing.T) { + t.Parallel() tests := []struct { name string awInfoContent string @@ -706,6 +728,7 @@ func TestAwInfoHasMCPServers(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() tmpDir := testutil.TempDir(t, "mcp-servers-*") targetDir := tmpDir if tt.awInfoSubdir != "" { diff --git a/pkg/cli/bootstrap_profile_git_test.go b/pkg/cli/bootstrap_profile_git_test.go index 94e5ad86bfc..e5d159722b5 100644 --- a/pkg/cli/bootstrap_profile_git_test.go +++ b/pkg/cli/bootstrap_profile_git_test.go @@ -12,6 +12,7 @@ import ( ) func TestRunBootstrapCommitAndPushAction_CommitsAndPushesChanges(t *testing.T) { + t.Parallel() repoDir := initBootstrapGitRepo(t) remoteDir := t.TempDir() @@ -74,6 +75,7 @@ func TestRunBootstrapCommitAndPushAction_CommitsAndPushesChanges(t *testing.T) { } func TestRunBootstrapCommitAndPushAction_RequiresRepoDir(t *testing.T) { + t.Parallel() if err := runBootstrapCommitAndPushAction(context.Background(), "", repositoryPackageBootstrapAction{ Type: "commit-and-push", Message: "Bootstrap repository changes", @@ -83,6 +85,7 @@ func TestRunBootstrapCommitAndPushAction_RequiresRepoDir(t *testing.T) { } func TestRunBootstrapCommitAndPushAction_SkipsCleanCheckout(t *testing.T) { + t.Parallel() repoDir := initBootstrapGitRepo(t) runRepoGit := func(args ...string) { t.Helper() diff --git a/pkg/cli/cli_consistency_help_test.go b/pkg/cli/cli_consistency_help_test.go index d098b9429f7..e43bbbd19ba 100644 --- a/pkg/cli/cli_consistency_help_test.go +++ b/pkg/cli/cli_consistency_help_test.go @@ -15,6 +15,7 @@ import ( ) func TestAuditCommandDescriptionsAreConsistent(t *testing.T) { + t.Parallel() cmd := NewAuditCommand() assert.Contains(t, cmd.Short, "workflow runs", "audit short description should describe multiple run inputs") @@ -23,6 +24,7 @@ func TestAuditCommandDescriptionsAreConsistent(t *testing.T) { } func TestTrialCommandUsesStandardExamplesHeading(t *testing.T) { + t.Parallel() cmd := NewTrialCommand(func(string) error { return nil }) assert.NotEmpty(t, cmd.Example, "trial command should use cobra's Example field for examples") @@ -36,6 +38,7 @@ func TestTrialCommandUsesStandardExamplesHeading(t *testing.T) { } func TestUpdateDocsIncludeCoolDownOption(t *testing.T) { + t.Parallel() _, currentFile, _, ok := runtime.Caller(0) require.True(t, ok, "should resolve current test file path") @@ -52,6 +55,7 @@ func TestUpdateDocsIncludeCoolDownOption(t *testing.T) { } func TestCompileDocsReflectCurrentOptions(t *testing.T) { + t.Parallel() _, currentFile, _, ok := runtime.Caller(0) require.True(t, ok, "should resolve current test file path") @@ -69,6 +73,7 @@ func TestCompileDocsReflectCurrentOptions(t *testing.T) { } func TestCLIDocsReflectStatusAuditAndExperimentsCommands(t *testing.T) { + t.Parallel() _, currentFile, _, ok := runtime.Caller(0) require.True(t, ok, "should resolve current test file path") @@ -96,6 +101,7 @@ func TestCLIDocsReflectStatusAuditAndExperimentsCommands(t *testing.T) { } func TestSubcommandListingsUseHyphenBullets(t *testing.T) { + t.Parallel() tests := []struct { name string longDoc string @@ -115,6 +121,7 @@ func TestSubcommandListingsUseHyphenBullets(t *testing.T) { } func TestSubcommandListingsMatchCobraShortDescriptions(t *testing.T) { + t.Parallel() t.Run("secrets bootstrap", func(t *testing.T) { cmd := NewSecretsCommand() bootstrapCmd, _, err := cmd.Find([]string{"bootstrap"}) @@ -135,6 +142,7 @@ func TestSubcommandListingsMatchCobraShortDescriptions(t *testing.T) { } func TestHelpTextUsesStandardEgPunctuation(t *testing.T) { + t.Parallel() assert.Contains(t, coolDownFlagUsage, "(e.g., 7d", "--cool-down help should use e.g., punctuation") assert.Contains(t, NewEnvCommand().Long, "(e.g., default_max_turns)", "env help should use e.g., punctuation") assert.Contains(t, NewDomainsCommand().Long, "(e.g., \"node\", \"python\", \"github\")", "domains help should use e.g., punctuation") @@ -144,6 +152,7 @@ func TestHelpTextUsesStandardEgPunctuation(t *testing.T) { } func TestLegacyNestedGHHelpIsRejected(t *testing.T) { + t.Parallel() tests := []struct { name string newCmd func() *cobra.Command @@ -160,6 +169,7 @@ func TestLegacyNestedGHHelpIsRejected(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() cmd := tt.newCmd() cmd.SilenceUsage = true cmd.SilenceErrors = true