fix: handle benchmark-only go test output#571
Open
DevNewbie1826 wants to merge 1 commit intortk-ai:masterfrom
Open
fix: handle benchmark-only go test output#571DevNewbie1826 wants to merge 1 commit intortk-ai:masterfrom
DevNewbie1826 wants to merge 1 commit intortk-ai:masterfrom
Conversation
Author
|
A small reviewer note: the important design choice here is that this PR does not count benchmarks as test passes. Instead, it detects benchmark result lines and uses them only to avoid collapsing benchmark-only runs into I also covered both output shapes I could verify:
So the main review questions are whether that summary behavior feels right for |
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.
Problem
rtk go testtreated benchmark-only runs as if nothing had executed.For a command like
go test -json -run=^$ -bench=., Go emits benchmark result lines but does not emit a test-levelpassevent for the benchmark itself. The old parser only counted test-scoped pass/fail/skip events, so benchmark-only output could collapse to:What changed
go test -jsonoutput and store them separately from test pass countsTestoutputGo test: No tests foundN passedtest counter so the summary stays semantically accurateBefore / After
Given a benchmark-only run, the old behavior could report:
With this change,
rtknow produces a benchmark-aware summary like:Why this approach
Go's
test2jsonbenchmark event model is incomplete and does not consistently provide benchmark lifecycle events the same way it does for tests. This change takes the smallest safe approach:Tests
Verification
Run from the repository root.
docker run --rm -v "$PWD:/work" -w /work rust:1.85 cargo test benchmark_only -- --nocapturedocker run --rm -v "$PWD:/work" -w /work rust:1.85 cargo test go_cmd::tests -- --nocapturedocker run --rm -v "$PWD:/work" -w /work rust:1.85 cargo build