fix: report package-level failures (timeouts, signals) in go test summary#959
Merged
aeppling merged 1 commit intortk-ai:developfrom Apr 9, 2026
Merged
Conversation
Contributor
Author
|
Why is the GitHub actions being required to sign the CLA?! 🤔 |
…mary
When go test times out or is killed by a signal, the JSON stream
contains a package-level {"action":"fail"} with no Test field and no
FailedBuild field. The parser only handled test-level and build-level
failures, so this event was silently dropped. The summary then saw
0 passes + 0 fails and reported "No tests found" instead of the
actual failure.
The fix adds handling for package-level failures: a new else branch
in the fail handler, package-level output capture in the output
handler, and inclusion in the summary count and display.
Before: "Go test: No tests found"
After: "Go test: 0 passed, 1 failed in 1 packages" with the
timeout output shown under the package name.
Fixes rtk-ai#958
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5db8a6e to
c85a387
Compare
Contributor
Author
|
Rebased on the latest develop. This should be ready for review when you get a chance. @aeppling are you the right person to ping? |
aeppling
approved these changes
Apr 9, 2026
pszymkowiak
approved these changes
Apr 9, 2026
Collaborator
pszymkowiak
left a comment
There was a problem hiding this comment.
Tested locally:
- Compilation: OK (release build)
- Unit tests: 4/4 go_cmd tests pass including new
test_filter_go_test_timeout_package_fail - Real timeout test: Confirmed fix works —
rtk go test -timeout 3son a hanging test now correctly reports0 passed, 1 failedwith exit code 1 (was:No tests foundexit code 0) - No regression: Normal passing tests still report correctly
Clean fix, well-scoped, good test coverage.
Contributor
Author
|
thanks @pszymkowiak and @aeppling ! |
Merged
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.
When
go testtimes out or gets killed by a signal, the JSON stream contains a package-level{"action":"fail"}with noTestfield and noFailedBuildfield. The parser infilter_go_test_json(go_cmd.rs:447) only handled test-level fails (event.test.is_some()) and build-level fails (event.failed_build.is_some()), so this event fell through silently. The summary saw 0 passes + 0 fails and reported "No tests found."Before:
After:
Changes in
go_cmd.rs:PackageResultstruct: addedpackage_failedandpackage_fail_outputfields"fail"handler: addedelsebranch for package-level failures that aren't test or build failures"output"handler: captures package-level output (timeout messages, signal info) whenevent.testis Nonehas_failuresand displays them with captured outputThe exit code was already correct (Go exits 1, rtk propagates it at line 94). Only the summary message was wrong.
Fixes #958
This contribution was developed with AI assistance (Claude Code).