Repository navigation
fix(go): keep benchmark headers out of quiet test failure output - #5220
Open
helmipradita wants to merge 1 commit into
Open
helmipradita wants to merge 1 commit into
helmipradita wants to merge 1 commit into
Conversation
Signed-off-by: Helmi Pradita <[email protected]>
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.
Root cause
When
go testruns with-v=false,test2jsontags benchmark header lines (goos:,goarch:,pkg:,cpu:) with the failing benchmark'sTestkey. Inselect_go_test_failure_lines, the location-match capture logic treats the first such header (typicallygoos:) as context to keep after a failure line, so benchmark metadata leaks into quiet-mode failure output.Fix
is_go_benchmark_headerhelper matchinggoos:,goarch:,pkg:,cpu:prefixes.select_go_test_failure_lines, clearingkeep_next_context_lineso they never get captured as context.relevantfallback.Test
test_filter_go_test_failing_benchmark_quiet_omits_benchmark_headers— asserts failing benchmark output keeps the real failure line while omitting all benchmark headers.Verification
cargo test --lib cmds::go::go_cmd::tests— 31 passed, 0 failed.cargo fmt --all -- --check— clean.cargo clippy --all-targets -- -D warnings— clean.Fixes #5215