Repository navigation
Keep combined coverage when Go cannot resolve a package - #1697
Conversation
|
Thanks @Boulea7 - this is a real fix for a long-standing issue, and I've confirmed the new spec fails on master with #1323's exact error and passes with this PR. I like how you've approached it - the counting fallback is a good compromise though it doesn't always produce exactly the same numbers as One request: could we drop the Please also add a small docs note in docs/index.md that a composite computed via the fallback can differ slightly from Go's. Also, a question: you've mentioned twice now that a Gomega timeout-stack spec fails for you locally on Go 1.27.4. Which spec is it, and what does the failure output look like? I just upgraded to 1.27.4 here and Ginkgo's full race suite (and Gomega's and Biloba's) pass, so I'd love to know what's different in your setup. Thanks again! |
|
Thanks for checking the repro. The timeout spec was “doesn't get stuck because Eventually will exit and it includes the additional report provided by eventually” in I traced that to my checkout path. On macOS 27.0.1 arm64 with Go 1.27.4, the same |
|
Merged - thanks @Boulea7! The simplified fallback reads much better, and the after-run-hook specs are a neat way to force And thank you for tracking down the timeout-spec failure: you're right that it's the checkout directory name. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FockBuVhFMJNJ2AzJrBbBn
Fixes #1323.
Ginkgo writes a valid merged coverage profile after suites pass across multiple Go modules. It can still exit with an error when
go tool cover -funccannot resolve a covered package from the invoking module.When Go’s package lookup confirms that failure, compute composite coverage from the covered and total statement counts in the merged profile. Keep Go’s existing summary when it succeeds and retain errors from invalid profiles or other failures.
A CLI regression exercises two modules with different statement counts and checks the 50.0% total in default and vendor modes. All 225 CLI integration specs and
go vet ./...passed. The full suite had one Gomega timeout stack assertion failure on Go 1.27.4, also reproduced on the base commit.Developed and verified with assistance from OpenAI Codex.