perf(covgate,covratchet): restore NumCPU default and add progress#32
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ogress Revert PR #28's two changes that combined to overshoot: - Outer default returns to runtime.NumCPU() (was runtime.GOMAXPROCS(0)). - Drop the per-child GOMAXPROCS env injection; child go test runs at Go's natural GOMAXPROCS again. The injection was motivated by NumCPU*NumCPU oversubscription concerns, but the repo has no t.Parallel call sites, so the inner cap only throttled compile/link and slowed CI without any safety benefit. When --parallelism=0 (auto), emit a mutex-guarded "[idx/total] STATUS pkg [elapsed]" line per package as workers finish, preceded by a one-line announcement. Suppressed at explicit --parallelism>0 so existing scripted invocations are unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Plan was moved to completed/ but its milestone checkboxes still read [ ]. Update them to [x] to reflect that the work is done; this is a cosmetic doc-hygiene change with no code impact. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
ben-miru
added a commit
that referenced
this pull request
May 18, 2026
## Summary Follow-up to #32. The live progress block and the alphabetical recap table carried the exact same per-package rows, doubling output without adding information — the user reported "the spacing is off" and then "the first and second table give exact same information, please only show first table". Now, when `--parallelism=0`: - The streamed progress block (with the new leading `COUNT` column under `[N/total]`) is the single canonical table. - Per-package rows print only once, in completion order. - The second `STATUS` header and reprinted rows are removed. - FAIL detail (multi-line raw test output for `testErr` cases) still prints after the stream — that's not duplicated data. - `--exclude` SKIPPED rows still print, indented under the `COUNT` column so they align with the progress table's `STATUS` column. Non-progress mode (`--parallelism>0`) is unchanged: a single alphabetical table, no progress stream. ## Before (current `main`) ``` Running 27 packages with parallelism=22; progress will appear as packages finish: STATUS COVERAGE REQUIRED TIME PACKAGE ------- -------- -------- -------- ------- [8/27] PASS internal/pkg/openapi/server 0.8s <- columns don't align ... PASS 0.0% 0.0% 0.8s internal/pkg/openapi/server <- same data again ... ``` ## After ``` Running 27 packages with parallelism=22; progress: COUNT STATUS COVERAGE REQUIRED TIME PACKAGE ------- ------- -------- -------- -------- ------- [ 8/27] PASS 0.0% 0.0% 0.8s internal/pkg/openapi/server [21/27] PASS 0.0% 0.0% 1.1s internal/pkg/server/response ... [27/27] PASS 0.3s ... Total time: 5.4s All packages meet minimum coverage requirement ``` With `--exclude`, SKIPPED rows appear indented under the COUNT column: ``` [ 1/10] PASS 62.7% 62.3% 0.3s internal/commands [10/10] PASS 0.0% 0.0% 0.3s internal/testutil SKIPPED --- --- --- internal/services/lint SKIPPED --- --- --- internal/services/lint/linter ... Total time: 0.3s All packages meet minimum coverage requirement ``` ## Notes - `progressColWidth(total)` scales the COUNT column with package count: `[ 8/27]` is 7 chars for 27 packages, `[ 88/100]` is 9 for 100. - Extracted `writeRunHeader` in both packages to keep `run()` under the 50-line `funclen` limit after the bracketing/header logic was added. - `restOfOutput` is the dual of `firstLine` — used in progress mode to print only the trailing FAIL detail of `checkResult.output`, not the row that was already streamed. - Test assertions updated: `STATUS` header appears exactly once (progress IS the table); a `COUNT` header is present in progress mode and absent otherwise; progress lines must carry full row data. ## Test plan - [x] `go test ./internal/services/covgate/... ./internal/services/covratchet/...` passes - [x] `./scripts/preflight.sh` ends with `=== All checks passed ===` - [x] Smoke-tested `go run ./cmd/miru covgate --packages="./internal/..." --src-prefix=internal --parallelism=0` — single table, no duplicate - [x] Smoke-tested same with `--exclude=./internal/services/lint/...` — SKIPPED rows render indented under COUNT 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runtime.NumCPU()and drops the per-childGOMAXPROCS=max(1, NumCPU/parallelism)env injection used to start eachgo testinvocation.NumCPU x NumCPUoversubscription, but this repo has zerot.Parallelcallsites — so the inner cap never throttled test execution, it only throttled compile/link, which is exactly the phase that dominates CI wall-clock time.[idx/total] STATUS pkg [elapsed]progress output tocovgateandcovratchetwhen--parallelism=0(auto mode), with a leading announcement line above the per-package table so operators can see liveness on slow runners.plans/completed/20260517-restore-parallelism-and-progress.md.Test plan
./preflight.shpasses locally (includes covgate/covratchet self-lint and unit tests)go test ./internal/services/covgate/... ./internal/services/covratchet/...passescovratchet --parallelism=0against a multi-package target and confirm the announcement line plus interleaved[idx/total] STATUS pkg [elapsed]rows appear without interleaved-character corruptioncovgate --parallelism=0and confirm the same progress output behavior