Skip to content

[test-parallel] test: parallelize safe Go test (daily batch) - #55047

Merged
pelikhan merged 4 commits into
mainfrom
gh-aw/pre-created/32628769903-1
Aug 23, 2026
Merged

[test-parallel] test: parallelize safe Go test (daily batch)#55047
pelikhan merged 4 commits into
mainfrom
gh-aw/pre-created/32628769903-1

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Daily Go Test Parallelizer

Analyzed a batch of 25 pkg/cli/*_test.go files (round-robin resuming after compile_guard_policy_policy_report_test.go, ending at compile_watch_environment_test.go).

Result: 1 safe change

  • TestCompileUpdateDiscussionFieldEnforcement (pkg/cli/compile_update_discussion_test.go): added t.Parallel(). This test only uses t.TempDir() and local variables — no shared/global state, no os.Chdir, no os.Setenv, no shared mutable globals.

Why the other 24 files were left unchanged

  • Files whose tests call setupIntegrationTest (e.g. compile_permissions_integration_test.go, compile_pull_request_target_integration_test.go, compile_safe_update_integration_test.go, compile_service_ports_integration_test.go, compile_safe_outputs_needs_imports_integration_test.go, compile_max_turns_import_integration_test.go, compile_model_fallback_integration_test.go) rely on os.Chdir to a process-wide working directory — unsafe to parallelize.
  • Files that redirect global os.Stdout/os.Stderr for output capture (e.g. compile_json_output_test.go, compile_stats_test.go, compile_schedule_calendar_test.go, compile_update_check_test.go subset) — unsafe, since concurrent redirection races.
  • compile_orchestrator_container_pins_test.go mutates a shared package-level function variable (compileUpdateContainerPins); confirmed via go test -race that adding t.Parallel() there introduces a real data race, so it was reverted.
  • compile_orchestrator_host_test.go, compile_orchestrator_stability_test.go, compile_pipeline_yamllint_test.go, compile_repository_manifest_test.go, compile_update_check_test.go, compile_watch_environment_test.go use t.Setenv/os.Setenv/os.Chdir.
  • compile_pipeline_purge_test.go and most of compile_schedule_calendar_test.go/compile_stats_test.go already have t.Parallel() on all safe candidates.
  • compile_maintenance_test.go, compile_instructions_test.go, compile_integration_test.go use os.Chdir and/or shared filesystem state — unsafe.

Validation

  • go test -race -run TestCompileUpdateDiscussionFieldEnforcement ./pkg/cli/... — pass
  • go test -run TestCompileUpdateDiscussionFieldEnforcement -v ./pkg/cli/... — pass
  • Diff limited to the single t.Parallel() addition; no other file changes.

State cache updated to advance the round-robin cursor to pkg/cli/compile_watch_environment_test.go for the next daily run.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

Generated by Daily Go Test Parallelizer · auto · 221.9 AIC · ⌖ 8.46 AIC · ⊞ 8.4K ·

  • expires on Aug 26, 2026, 1:05 AM UTC-08:00

@github-actions

Copy link
Copy Markdown
Contributor Author

👋 Thanks for opening this PR! However, this appears to be a work-in-progress pre-created by an automated GitHub Actions workflow for the Daily Go Test Parallelizer rather than a traditional external contribution.

Since this is an internal agentic workflow PR created by the core team automation, it falls outside the scope of the contributing guidelines for external contributors. The guidelines explicitly state:

🚫 Traditional Pull Requests Are Not Enabled for non-Core team members

If you are a core team member working on this internal workflow, please disregard this evaluation - the PR will be assessed once the agent completes its work and actual changes are present. If you are an external contributor, please create a detailed agentic plan in an issue instead of a direct PR.

Generated by ✅ Contribution Check · auto · 52.3 AIC · ⌖ 7.63 AIC · ⊞ 9.3K ·

github-actions Bot and others added 3 commits August 23, 2026 09:05
Analyzed 25 test files in pkg/cli/ (compile_guard_policy_test.go through
compile_watch_environment_test.go) for safe t.Parallel() additions. Only
one test was demonstrably safe to parallelize; the rest use process-global
state (os.Chdir via setupIntegrationTest, os.Stdout/os.Stderr redirection,
shared package-level vars) that would race under -race if parallelized.

TestCompileUpdateDiscussionFieldEnforcement uses only t.TempDir() and
local variables, with no shared/global state, making it safe.

Verified with 'go test -race' targeting the modified test.
…atch)

Analyzed 25 test files (compile_wif_anthropic_integration_test.go through
docker_build_integration_test.go) for safe t.Parallel() additions.

Safe additions made to:
- copilot_setup_runs_on_test.go: TestValidateCopilotSetupStepsRunsOn (pure function, no shared state)
- daily_regression_audit_workflow_contract_test.go: TestDailyRegressionAuditAllowsPythonJSONParsing (read-only file checks)
- deps_test.go: 8 top-level tests + table-driven subtests (pure helpers, isolated temp files)
- docker_args_validation_test.go: 6 top-level tests + table-driven subtests (pure validation functions, isolated temp dirs)
- docker_build_integration_test.go: TestIsTransientDockerBuildFailure, TestDockerfile_Exists, TestMakefile_DockerTargets (read-only file/pure checks; Docker build/run tests left unparallelized due to shared image tag and external Docker daemon dependency)

Skipped as unsafe: files using os.Chdir, t.Setenv, package-level global
reassignment, or unverified shared setup helpers (compile_wif_*_integration_test.go,
completions_integration_test.go, completions_test.go, context_cancellation_test.go,
copilot_agents_test.go, copilot_billing_check_test.go, copilot_setup_test.go,
dependency_graph_test.go, deploy_command_test.go, deploy_org_test.go,
devcontainer_test.go).

Verified with 'go test -race' targeting all modified tests plus a full
'go test ./pkg/cli/...' run (one pre-existing unrelated network-dependent
test failure confirmed present on the pre-change baseline too).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot changed the title [WIP] [test-parallel] Daily Go Test Parallelizer: work in progress [test-parallel] test: parallelize safe Go test (daily batch) Aug 23, 2026
@pelikhan
pelikhan marked this pull request as ready for review August 23, 2026 13:48
Copilot AI balanced review requested due to automatic review settings August 23, 2026 13:48
@pelikhan
pelikhan merged commit 85c3c3f into main Aug 23, 2026
9 checks passed
@pelikhan
pelikhan deleted the gh-aw/pre-created/32628769903-1 branch August 23, 2026 13:48
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has 30 new lines of code in business logic directories (threshold is 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #55047

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed as tests_onlyaudit mode. All changes are t.Parallel() additions to top-level tests and their subtests. No shared mutable state, no ordering dependencies, and t.TempDir() is correctly used where temp directories are needed. LGTM.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 13.9 AIC · ⌖ 8.95 AIC · ⊞ 6.2K

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /tdd — changes look safe and well-reasoned; one documentation inconsistency noted.

📋 Key Themes & Highlights

Positive Highlights

  • ✅ All added t.Parallel() calls are on stateless tests using only t.TempDir() or local variables
  • ✅ Subtests consistently get t.Parallel() alongside their parent, following the correct Go pattern
  • ✅ The PR body clearly documents the reasoning for files intentionally left unchanged

One Concern

The PR body says "Result: 1 safe change" and only describes compile_update_discussion_test.go, but the diff modifies 6 files. Future readers of the PR history will have an inaccurate summary of what changed.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 16.6 AIC · ⌖ 9.64 AIC · ⊞ 7.6K
Comment /matt to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Comment Memory

reviewed_at: 2026-08-23T00:00:00Z
review_event: COMMENT
top_themes:
  - no actionable issues in added t.Parallel() calls
  - changed tests appear isolated from shared global state
files_reviewed:
  - pkg/cli/compile_update_discussion_test.go
  - pkg/cli/copilot_setup_runs_on_test.go
  - pkg/cli/daily_regression_audit_workflow_contract_test.go
  - pkg/cli/deps_test.go
  - pkg/cli/docker_args_validation_test.go
  - pkg/cli/docker_build_integration_test.go
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 5.24 AIC · ⌖ 6.84 AIC · ⊞ 7K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues in the changed lines.

### Review notes

I checked the newly added t.Parallel() calls against the surrounding test code and the changed files list. The affected tests only read repository files, use per-test temp dirs, or operate on local data, and I did not find newly introduced shared-global mutations, stdout/stderr redirection, cwd changes, or environment writes in the changed sections that would make these specific parallelizations unsafe.

I also checked for duplicate prior review comments and found none to carry forward.

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 5.24 AIC · ⌖ 6.84 AIC · ⊞ 7K
Comment /review to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Parallelizes selected Go tests, though the implementation is substantially broader than the single-test scope described.

Changes:

  • Enables parallel execution for unit and integration tests.
  • Parallelizes table-driven subtests.
Show a summary per file
File Description
pkg/cli/docker_build_integration_test.go Parallelizes Docker-related integration tests.
pkg/cli/docker_args_validation_test.go Parallelizes Docker validation tests.
pkg/cli/deps_test.go Parallelizes dependency utility tests.
pkg/cli/daily_regression_audit_workflow_contract_test.go Parallelizes the workflow contract test.
pkg/cli/copilot_setup_runs_on_test.go Parallelizes runner validation cases.
pkg/cli/compile_update_discussion_test.go Parallelizes discussion-field compilation testing.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

}

func TestIsTransientDockerBuildFailure(t *testing.T) {
t.Parallel()
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.

2 participants