fix: surface build failures in go test summary#274
Merged
pszymkowiak merged 1 commit intortk-ai:masterfrom Feb 28, 2026
Merged
Conversation
`go test -json` emits build failures as `build-output`/`build-fail`
actions with `ImportPath` (not `Package`/`Test`), followed by a
package-level `fail` with a `FailedBuild` field. The JSON parser
only counted failures when `event.test.is_some()`, so build errors
were silently dropped from the summary — showing "891 passed" when
a package failed to compile.
Now parses `build-output`, `build-fail`, and `FailedBuild` fields.
Build failures count toward the total and display with `[build failed]`
plus the compiler error lines.
Before:
✓ Go test: 891 passed in 74 packages
After:
Go test: 891 passed, 1 failed in 74 packages
═══════════════════════════════════════
📦 stream [build failed]
handler_test.go:64:9: undefined: undefinedVariable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Good catch. go test -json emits build-output/build-fail events (with ImportPath, not Package) when compilation fails — these were silently dropped before. The fix correctly handles both 39 go_cmd tests pass. LGTM. |
maxkulish
added a commit
to maxkulish/rtk
that referenced
this pull request
Mar 2, 2026
Bug fixes (4): - fix(registry): move "fi"/"done" to IGNORED_EXACT to prevent shadowing find commands (rtk-ai#246) - fix(hook): filter docker compose rewrites to supported subcommands only (ps/logs/build), avoid hard failures on up/down/exec (rtk-ai#245) - fix(git): add is_blob_show_arg() to prevent duplicate output on git show rev:path style args (rtk-ai#248) - fix(go): surface build failures (build-output/build-fail/FailedBuild) in go test -json summary (rtk-ai#274) Features (2): - feat(mypy): add rtk mypy command with grouped error output, 80% token reduction; delegate from lint_cmd.rs; add hook rewrites and registry entries (rtk-ai#109) - feat(gain): add --project/-p flag to scope rtk gain stats to the current working directory; add shorten_path() display helper (rtk-ai#128) Tests: 501 passed (10 new tests added)
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 test -jsonemits build failures asbuild-output/build-failactions withImportPath(notPackage/Test), followed by a package-levelfailwith aFailedBuildfieldevent.test.is_some(), so build errors were silently dropped from the summary — showing "891 passed" when a package failed to compilebuild-output,build-fail, andFailedBuildfields from the Go test JSON protocol[build failed]plus compiler error linesBefore:
After:
Test plan
var _ = undefinedVariable) in a test file✓ 891 passed(masking the failure)891 passed, 1 failedwith the build error details✓ 904 passed in 73 packagescargo build --releasesucceeds with no new warnings🤖 Generated with Claude Code