Skip to content

[test-parallel] test: add t.Parallel() to safe test cases in pkg/cli - #54184

Merged
pelikhan merged 3 commits into
mainfrom
gh-aw/pre-created/32340523988-1
Aug 20, 2026
Merged

[test-parallel] test: add t.Parallel() to safe test cases in pkg/cli#54184
pelikhan merged 3 commits into
mainfrom
gh-aw/pre-created/32340523988-1

Conversation

@github-actions

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

Copy link
Copy Markdown
Contributor

Summary

This PR adds t.Parallel() calls to safe test cases across four test files in pkg/cli to enable Go's parallel test execution. The changes are limited to inserting the directive into existing test functions and subtests; no test logic or assertions were modified.

Change Classification

  • Type: test
  • Scope: pkg/cli
  • Breaking: No

Key Changes

File Change Impact
pkg/cli/logs_overview_test.go Added t.Parallel() to 5 test functions Low
pkg/cli/logs_parsing_fallback_test.go Added t.Parallel() to 4 test functions and 1 subtest Low
pkg/cli/logs_patch_test.go Added t.Parallel() to 2 test functions Low
pkg/cli/logs_summary_file_test.go Added t.Parallel() to 3 test functions Low

Impact Assessment

No downstream impact identified. This change only affects test execution concurrency in pkg/cli; production code behavior is unchanged. Test suite runtime may decrease as these tests now execute in parallel.

Commits

09ea3f176 test: add t.Parallel() to safe test cases in pkg/cli
78e9c44aa Initialize pull request for Daily Go Test Parallelizer
730ef3620 Initialize pull request for Daily Go Test Parallelizer
```> Generated by [PR Description Updater](https://github.com/github/gh-aw/actions/runs/32387071411) for #54184 · auto · 27.7 AIC · ⌖ 6.87 AIC · ⊞ 7.6K · [◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw+%22gh-aw-workflow-call-id%3A+github%2Fgh-aw%2Fpr-description-caveman%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: PR Description Updater, engine: copilot, model: auto, id: 32387071411, workflow_id: pr-description-caveman, run: https://github.com/github/gh-aw/actions/runs/32387071411 -->

github-actions Bot and others added 3 commits August 20, 2026 06:40
Analyzed 25 files (pkg/cli/logs_orchestrator_unit_test.go through
pkg/cli/mcp_argument_validation_test.go) with per-file
parallel-safety-checker sub-agents. Added t.Parallel() only to
top-level tests and subtests confirmed safe:

- logs_overview_test.go: 5 top-level tests, no shared state
- logs_parsing_fallback_test.go: 3 top-level tests + 1 table-driven
  subtest set, uses t.TempDir() per test, no globals
- logs_patch_test.go: 2 top-level tests, isolated temp dirs
- logs_summary_file_test.go: 3 top-level tests, isolated temp dirs

Files judged unsafe (env mutation, shared globals, os.Chdir, or
unrebound loop-variable closures without go1.22 safety guarantees)
were left unchanged: logs_orchestrator_unit_test.go,
logs_output_hint_test.go, logs_parallel_test.go, logs_parse_test.go,
logs_parsing_test.go, logs_rate_limit_test.go, logs_report_file_test.go,
logs_report_test.go, logs_report_tools_isvalidtoolname_test.go,
logs_run_processor_test.go, logs_safe_output_chains_test.go,
logs_skill_activations_test.go, logs_summary_integration_test.go,
logs_summary_test.go, logs_timeout_detection_test.go,
logs_timeout_integration_test.go, logs_timeout_test.go,
mcp_add_integration_test.go, mcp_add_test.go,
mcp_argument_validation_test.go.

logs_usage_activity_test.go already had t.Parallel() throughout.

Validated with `go test -race ./pkg/cli/...` on the changed tests
(all pass) and confirmed unrelated failures elsewhere in the suite
(httptest port binding, TTY ANSI detection) are pre-existing sandbox
limitations unrelated to this change.

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: add t.Parallel() to safe test cases in pkg/cli Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Compliant core-team agentic development PR: conservative scope, explicit per-file safety analysis before adding t.Parallel(), validated with go test -race. Looks good — thanks for the systematic approach!

Generated by ✅ Contribution Check · auto · 56.6 AIC · ⌖ 5.06 AIC · ⊞ 9.2K ·

@pelikhan
pelikhan marked this pull request as ready for review August 20, 2026 15:35
Copilot AI balanced review requested due to automatic review settings August 20, 2026 15:35
@pelikhan
pelikhan merged commit 52048f3 into main Aug 20, 2026
@pelikhan
pelikhan deleted the gh-aw/pre-created/32340523988-1 branch August 20, 2026 15:35
@github-actions

github-actions Bot commented Aug 20, 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 commented Aug 20, 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 20, 2026

Copy link
Copy Markdown
Contributor Author

Ponytail Reviewer failed. Please review the logs for details.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Generated by Ponytail Reviewer for #54184

@github-actions

github-actions Bot commented Aug 20, 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 20, 2026

Copy link
Copy Markdown
Contributor Author

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

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

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@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 — approving. All t.Parallel() additions follow correct Go parallelism conventions.

📋 Key Themes & Highlights

Positive Highlights

  • ✅ Table-driven subtest in logs_parsing_fallback_test.go correctly adds both outer and inner t.Parallel() calls — the idiomatic Go pattern
  • ✅ All modified tests use per-test isolation (t.TempDir(), testutil.TempDir) rather than shared state — parallel execution is safe
  • ✅ PR description documents the safety analysis and pre-validates with -race, which is the right bar for parallelism changes
  • ✅ Unchanged files (env mutation, global state) are correctly excluded from this PR

No actionable issues found.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 14.5 AIC · ⌖ 9.8 AIC · ⊞ 7.8K
Comment /matt 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.

The changes look correct. All parallelized tests use t.TempDir() (parallel-safe), operate on isolated temporary directories or pure in-memory data, and share no mutable global state. The table-driven test in logs_parsing_fallback_test.go correctly adds t.Parallel() to both the parent and each subtest, following Go best practices. No issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 16.9 AIC · ⌖ 8.78 AIC · ⊞ 5.7K

@github-actions

Copy link
Copy Markdown
Contributor Author

Comment Memory

reviewed_at: 2026-08-20T00:00:00Z
review_event: COMMENT
top_themes:
  - safe parallelization only; no shared-state regressions found
  - sub-agent unavailable in sandbox, independent review only
files_reviewed:
  - pkg/cli/logs_overview_test.go
  - pkg/cli/logs_parsing_fallback_test.go
  - pkg/cli/logs_patch_test.go
  - pkg/cli/logs_summary_file_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 · 8.82 AIC · ⌖ 8.73 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.

Verdict

Non-blocking. I don't see a correctness or concurrency regression in the added t.Parallel() calls.

Highlights
  • The changed tests are isolated to per-test temp dirs or pure in-memory struct checks.
  • pkg/cli/logs_patch_test.go uses testutil.TempDir, which allocates a unique directory per test and guards shared setup with sync.Once.
  • I did not find any new shared global mutation, env mutation, or fixed-path reuse introduced by this diff.
  • The requested grumpy-coder sub-agent could not be launched because the binary is unavailable in this environment, so this review is based on an independent pass only.

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

@github-actions

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel 🧪 — Infrastructure-Only Report

Summary

Score: N/A — Infrastructure Only
Status: ✅ APPROVED

This PR adds t.Parallel() to 14 existing test functions across 4 test files in pkg/cli/. No new behavioral tests were added or modified — only parallelization infrastructure.


Details

Changed Test Files

File Changes Tests Modified
pkg/cli/logs_overview_test.go +5 lines 5 tests
pkg/cli/logs_parsing_fallback_test.go +4 lines 3 tests (+ 1 subtest)
pkg/cli/logs_patch_test.go +2 lines 2 tests
pkg/cli/logs_summary_file_test.go +3 lines 3 tests
Total +14 lines 13 tests

Infrastructure Quality ✅

  • Build Tags: All modified test files have proper (go/redacted):build !integration tags (line 1) — no violations.
  • Parallelization Safety: All tests were verified for parallel-safety by the PR author before changes — using isolated t.TempDir() or testutil.TempDir(), no shared globals or state mutations.
  • GoLeak Setup: The package includes goleak.VerifyTestMain() in pkg/cli/test_main_test.go, enforcing goroutine-leak detection after each test run — a strong design invariant.
  • Test Isolation: Each test uses independent temp directories; no env mutations or os.Chdir calls detected in the changed tests.

Classification

Infrastructure-Only PR — This PR improves test parallelization without adding or modifying test assertions. Behavioral test coverage remains unchanged.


Recommendation

APPROVED — No violations detected. GoLeak infrastructure is in place. All build tags are correct. This is a pure infrastructure enhancement that improves test suite speed without compromising safety.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 15 AIC · ⌖ 10.8 AIC · ⊞ 8.1K ·
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.

✅ Test Quality Sentinel: Infrastructure only. GoLeak design invariant enforced. No violations.

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

Adds safe parallel execution to isolated pkg/cli tests, reducing test-suite runtime.

Changes:

  • Parallelizes 13 top-level tests.
  • Parallelizes fallback-parser table subtests.
  • Preserves filesystem isolation through per-test temporary directories.
Show a summary per file
File Description
pkg/cli/logs_overview_test.go Parallelizes pure data-structure tests.
pkg/cli/logs_parsing_fallback_test.go Parallelizes isolated parser tests and subtests.
pkg/cli/logs_patch_test.go Parallelizes isolated artifact and command-help tests.
pkg/cli/logs_summary_file_test.go Parallelizes summary-file tests using unique temporary directories.

Review details

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

  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions github-actions Bot mentioned this pull request Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.87.2

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