Summary
When cargo test fails during compilation before any test suites run, RTK can lose the main rustc diagnostic context and fall back to a weak tail-output summary.
Reproduction
- Introduce a compile error in a test target or crate used by
cargo test.
- Run:
or a focused repro such as:
rtk cargo test --test repro_compile_fail
Example repro file:
#[test]
fn repro_compile_error() {
let _ = missing_symbol;
}
Actual behavior
On the unfixed path, RTK falls back to truncated tail output and loses the main diagnostic header and source location context:
3 | let _ = missing_symbol;
| ^^^^^^^^^^^^^^ not found in this scope
For more information about this error, try `rustc --explain E0425`.
error: could not compile `rtk` (test "repro_compile_fail") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
Expected behavior
When cargo test fails before test execution begins, RTK should preserve the primary compile diagnostics in a compact cargo test: summary format:
cargo test: 1 errors, 1 warnings (1 crates)
═══════════════════════════════════════
error[E0425]: cannot find value `missing_symbol` in this scope
--> tests/repro_compile_fail.rs:3:13
|
3 | let _ = missing_symbol;
| ^^^^^^^^^^^^^^ not found in this scope
warning: build failed, waiting for other jobs to finish...
Impact
This makes compile-failing test runs harder to debug, especially when no test result: summary is produced and the useful rustc error is the most important part of the output.
Proposed fix
Detect compile-error-only cargo test output, reuse the existing build diagnostic formatter, and relabel the summary from cargo build: to cargo test:.
Summary
When
cargo testfails during compilation before any test suites run, RTK can lose the main rustc diagnostic context and fall back to a weak tail-output summary.Reproduction
cargo test.rtk cargo testor a focused repro such as:
rtk cargo test --test repro_compile_failExample repro file:
Actual behavior
On the unfixed path, RTK falls back to truncated tail output and loses the main diagnostic header and source location context:
Expected behavior
When
cargo testfails before test execution begins, RTK should preserve the primary compile diagnostics in a compactcargo test:summary format:Impact
This makes compile-failing test runs harder to debug, especially when no
test result:summary is produced and the useful rustc error is the most important part of the output.Proposed fix
Detect compile-error-only
cargo testoutput, reuse the existing build diagnostic formatter, and relabel the summary fromcargo build:tocargo test:.