Skip to content

fix: flags only partially processed#701

Merged
RomainMuller merged 1 commit into
mainfrom
romain.marcadier/fix-flag-processing
Sep 18, 2025
Merged

fix: flags only partially processed#701
RomainMuller merged 1 commit into
mainfrom
romain.marcadier/fix-flag-processing

Conversation

@RomainMuller

Copy link
Copy Markdown
Contributor

When using go test and providing the test package set before some flag, the subsequent flags were not correctly processed, resulting in particular in the -coverpkg flag not being appropriately expanded when necessary. This resulted in relative patterns being passed to child builds which is the cause of some build ID mismatch errors.

This was caused by an incorrect assumption that all go building commands demand flags are presented before any positional argument, which is at least not true for go test (and likely also for go run).

When using `go test` and providing the test package set before some flag, the
subsequent flags were not correctly processed, resulting in particular in the
`-coverpkg` flag not being appropriately expanded when necessary. This resulted
in relative patterns being passed to child builds which is the cause of some
build ID mismatch errors.

This was caused by an incorrect assumption that all `go` building commands
demand flags are presented before any positional argument, which is at least not
true for `go test` (and likely also for `go run`).
@RomainMuller
RomainMuller requested a review from a team as a code owner September 17, 2025 15:39
@RomainMuller
RomainMuller added this pull request to the merge queue Sep 18, 2025
Merged via the queue into main with commit bca0ed6 Sep 18, 2025
57 checks passed
@RomainMuller
RomainMuller deleted the romain.marcadier/fix-flag-processing branch September 18, 2025 08:45
@codecov

codecov Bot commented Sep 18, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.06%. Comparing base (e061d12) to head (6f36908).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #701      +/-   ##
==========================================
+ Coverage   65.72%   67.06%   +1.34%     
==========================================
  Files         113      114       +1     
  Lines        7926     8040     +114     
==========================================
+ Hits         5209     5392     +183     
+ Misses       2192     2128      -64     
+ Partials      525      520       -5     
Components Coverage Δ
Generators 80.24% <ø> (ø)
Instruments ∅ <ø> (∅)
Go Driver 77.44% <100.00%> (+1.62%) ⬆️
Toolexec Driver 70.85% <100.00%> (+3.32%) ⬆️
Aspects 74.30% <100.00%> (+2.39%) ⬆️
Injector 74.85% <100.00%> (+2.06%) ⬆️
Job Server 66.99% <ø> (+1.07%) ⬆️
Other 67.06% <40.42%> (+1.34%) ⬆️
Files with missing lines Coverage Δ
internal/goflags/flags.go 79.02% <100.00%> (+2.62%) ⬆️

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants