Skip to content

feat: test output filter — failures only for cargo test/nextest #428

@bug-ops

Description

@bug-ops

Parent

Epic: #426

Summary

Filter cargo test and cargo nextest run output to show only failures, error details, and summary line. Passing tests are omitted.

Expected Savings

94-99% reduction on green test suites, 60-80% on mixed results.

Behavior

Input (raw cargo test output):

running 150 tests
test config::tests::parse_default ... ok
test config::tests::parse_override ... ok
... (148 more ok lines)
test agent::tests::tool_loop ... FAILED

failures:

---- agent::tests::tool_loop stdout ----
thread 'agent::tests::tool_loop' panicked at 'assertion failed'
note: run with `RUST_BACKTRACE=1`

failures:
    agent::tests::tool_loop

test result: FAILED. 149 passed; 1 failed; 0 ignored

Output (filtered):

test agent::tests::tool_loop ... FAILED

---- agent::tests::tool_loop stdout ----
thread 'agent::tests::tool_loop' panicked at 'assertion failed'

test result: FAILED. 149 passed; 1 failed; 0 ignored

All-pass case:

test result: ok. 150 passed; 0 failed; 0 ignored

Implementation

  • TestOutputFilter implementing OutputFilter
  • State machine: IDLE → TEST_LINES → FAILURE_BLOCK → SUMMARY
  • Matches: cargo test, cargo nextest run, cargo nextest r
  • On exit_code 0: emit only summary line
  • On exit_code != 0: emit failed test names, failure details, summary

Acceptance Criteria

  • Passing suite → summary only
  • Failed suite → failures + details + summary
  • Nextest format supported (different output format)
  • Unit tests with captured real output samples

Metadata

Metadata

Assignees

No one assigned

    Labels

    M26Milestone 26: Smart tool output filteringP0Critical prioritysize/MtestingTests and qualitytoken-savingsToken economy improvementstoolsTool execution and MCP integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions