test: isolate overlay parse fixture from parallel readers - #267
Conversation
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Test-only change fixes a race by copying the shared overlay fixture into t.TempDir() before formatting and parsing, so parallel tests no longer read a truncated file. The change is focused, preserves existing assertions, and carries no production or operational impact.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Test-only change isolates the shared overlay fixture by copying it into t.TempDir() before formatting and parsing, fixing the parallel-read race; the README addition is a documentation-only Codecov badge. No production or operational behavior changes.
Re-trigger cubic
📊 Test Coverage ReportCurrent Statement Coverage: Coverage Change: ✅ No change Statement Coverage by PackageGo measures covered statements. Codecov measures fully covered lines, so its percentage can differ.
📋 Detailed Coverage by Function (click to expand)
Generated by GitHub Actions |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Why
The coverage job on main failed
TestApplyTobecauseTestParseformats the same overlay fixture that parallel apply tests read.Formatusesos.WriteFile, so a reader can see the file while it is truncated and parse an empty overlay. The apply test then compares the unchanged input against the overlaid snapshot.What changed
t.TempDir()before formatting and parsing it.Review notes
Testing
GOTOOLCHAIN=go1.26.0 mise test -count=20 -coverpkg=./... ./overlay: passed with race detection, 2,305 tests and 20 skips.GOTOOLCHAIN=go1.26.0 mise ci: passed locally, including format, dependency checks, lint, tests, CLI integration tests and build.