Repository navigation
fix(go): preserve explicitly requested verbose test output - #3992
Open
tianhaotian wants to merge 2 commits into
Open
tianhaotian wants to merge 2 commits into
tianhaotian wants to merge 2 commits into
Conversation
📊 Automated PR Analysis
SummaryFixes go test output handling so that explicitly requested verbose flags (-v, -test.v, their double-dash aliases, and =true/=false value forms) trigger a passthrough runner that preserves original stdout, stderr, and exit codes instead of injecting -json. Flag parsing correctly respects test argument boundaries (-args, --) and value-taking flags so selectors/paths like -v=false aren't misinterpreted, and adds unit and subprocess regression tests plus doc updates. Review Checklist
Linked issues: #3985 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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
go testexplicitly requests verbosity (-v,-test.v, their double-dash aliases and boolean values), using the existing passthrough runner without injecting-json.-v=falseis not mistaken for a verbosity switch. Document the behavior.Fixes #3985.
Test plan
cargo fmt --all --checkcargo clippy --all-targetscargo test --all— 3573 passed, 8 ignored.cargo test --all -- --ignored --test-threads=1— all 8 additional tests passed.Go test: 1 passed in 1 packages; the final version preserves the passing-test marker and original stdout exactly, along with stderr and exit codes 0/1.go testcovering verbose/quiet flag forms, pass/fail runs and flag-like-o/-coverprofilevalues. Exit codes and the required diagnostics match.Validated locally on macOS arm64 with Rust 1.98.0. Flag-policy unit tests are platform-independent; subprocess shim tests use
cfg(unix). Windows and Linux coverage remains with the repository CI.