Skip to content

[test-parallel] Add t.Parallel() to safe cross-run audit and agent example tests - #52860

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
go-test-parallelizer-batch-20260815-8a7fc2ff3bf85964
Draft

[test-parallel] Add t.Parallel() to safe cross-run audit and agent example tests#52860
github-actions[bot] wants to merge 1 commit into
mainfrom
go-test-parallelizer-batch-20260815-8a7fc2ff3bf85964

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Daily Go test parallelizer run analyzing a batch of 25 pkg/cli test files (round-robin, starting after pkg/cli/add_description_test.go).

Files analyzed (batch)

add_gitattributes_test.go, add_integration_test.go, add_interactive_engine_test.go, add_interactive_git_test.go, add_interactive_orchestrator_test.go, add_interactive_schedule_test.go, add_interactive_secrets_test.go, add_interactive_workflow_test.go, add_no_args_test.go, add_package_manifest_test.go, add_skill_rewrite_test.go, add_source_test.go, add_wildcard_test.go, add_wizard_command_test.go, add_wizard_tuistory_integration_test.go, add_workflow_pr_test.go, add_workflow_resolution_manifest_ref_test.go, add_workflow_resolution_redirect_test.go, audit_agent_example_test.go, audit_agent_output_test.go, audit_agentic_analysis_test.go, audit_ambient_context_test.go, audit_comparison_test.go, audit_concurrency_test.go, audit_cross_run_test.go.

Changes made

  • pkg/cli/audit_agent_example_test.go: added t.Parallel() to TestAgentFriendlyOutputFailureScenario — it only constructs local WorkflowRun/audit data values and has no shared state (the sibling test in the same file, TestAgentFriendlyOutputExample, was left untouched because a subtest reassigns the global os.Stderr).
  • pkg/cli/audit_cross_run_test.go: added t.Parallel() to 18 top-level tests (TestBuildCrossRunAuditReport_*, TestRenderCrossRunReport*, TestNewLogsCommand_HasFormatFlag, TestLogsCommand_FormatPrecedence, TestLogsCommand_RepoParsingWithHost, TestBuildMetricsTrend_*, TestBuildDrain3InsightsFromCrossRunInputs_*) — all operate purely on locally-constructed values/report structs with no environment, filesystem, or shared-global mutation. TestRenderPrettyMetricsTrend_IncludesDurationWithoutTokens was left alone because it reassigns global os.Stderr.

Left unchanged (unsafe)

Files/tests using os.Chdir, os.Setenv/t.Setenv, package-level mock function globals, os.Stderr/os.Stdout reassignment, external CLI/network dependencies (git, gh, npx/tuistory, PTY sessions), or fixed shared binaries were intentionally left without t.Parallel() per the safety rules.

Validation

  • go build ./... — passes.
  • go test -race ./pkg/cli/... -run '<all newly-parallel tests>' — all pass.
  • go test ./pkg/cli/... — only two pre-existing, unrelated failures remain (TestRenderScheduleCalendarCell_UsesANSIInColorTerminal, TestConfirmRunAddedWorkflow_ContextCancelled), both environment-dependent (terminal color / gh auth) and untouched by this change.
  • Diff reviewed: contains only t.Parallel() additions in the two files above, no other changes.

State persisted to cache for next round-robin run: last_file = pkg/cli/audit_cross_run_test.go.

Generated by Daily Go Test Parallelizer · auto · 94.2 AIC · ⌖ 8.24 AIC · ⊞ 9.5K ·

  • expires on Aug 17, 2026, 10:08 PM UTC-08:00

Analyzed 25 test files in pkg/cli (batch after add_description_test.go).
Added t.Parallel() to:
- TestAgentFriendlyOutputFailureScenario (audit_agent_example_test.go): pure struct construction, no shared state
- 18 tests in audit_cross_run_test.go: buildCrossRunAuditReport/render/logs-command tests operating on local values with no env, filesystem, or shared-global mutation

Left unparallelized: tests using os.Chdir, os.Setenv/t.Setenv, package-level mock globals, os.Stderr/os.Stdout reassignment, or external CLI/network dependencies (see sub-agent analysis).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants