cargo nextest

built-in
99.4% Savings
125 Commands
1.4M Tokens saved
6 Tests

Install

tokf install cd4f347df4a8a4d28cb99ae0f43e6ec3946c5ea07974000355db6683118ece3f
Safety checks passed

Filter definition

# cargo-nextest.toml — Filter for cargo-nextest test runner output
# Raw: hundreds of PASS/FAIL lines with timing, inline failure output
# Filtered (pass): "✓ nextest: 68 passed, 0 failed, 0 skipped"
# Filtered (fail): failure details + summary

command = "cargo nextest"
description = "Summarise nextest results: pass/fail counts with failure details"
strip_ansi = true

skip = [
  "^\\s*Compiling ",
  "^\\s*Downloading ",
  "^\\s*Downloaded ",
  "^\\s*Finished ",
  "^\\s*Locking ",
  "^\\s*Blocking ",
  "^ Nextest run ID ",
  "^\\s*Starting \\d+ tests",
  "^\\s+PASS ",
  "^────+$",
  "^\\s*$",
]

# Capture FAIL lines with their inline output (stdout/stderr blocks).
# Each block starts at "  FAIL [" and ends at the next PASS/FAIL/separator/Summary.
[[section]]
name = "failure_detail"
enter = "^\\s+FAIL \\["
exit = "^\\s+(PASS|FAIL) \\[|^\\s+Summary |^  Cancelling "
include_enter = true
collect_as = "failure_blocks"

# Capture the summary line
[[section]]
name = "summary"
match = "^\\s+Summary "
collect_as = "summary_lines"

# Success: concise summary
[on_success]
output = "✓ nextest: {passed} passed, {failed} failed, {skipped} skipped"

[[on_success.aggregates]]
from = "summary_lines"
pattern = '(\d+) passed'
sum = "passed"

[[on_success.aggregates]]
from = "summary_lines"
pattern = '(\d+) failed'
sum = "failed"

[[on_success.aggregates]]
from = "summary_lines"
pattern = '(\d+) skipped'
sum = "skipped"

# Failure: show failure details + summary
[on_failure]
output = "✗ nextest: {passed} passed, {failed} failed, {skipped} skipped\n\n{failure_blocks | each: \"{value}\" | join: \"\\n\"}\n\n{summary_lines | join: \"\\n\"}"

[[on_failure.aggregates]]
from = "summary_lines"
pattern = '(\d+) passed'
sum = "passed"

[[on_failure.aggregates]]
from = "summary_lines"
pattern = '(\d+) failed'
sum = "failed"

[[on_failure.aggregates]]
from = "summary_lines"
pattern = '(\d+) skipped'
sum = "skipped"

[fallback]
tail = 30

Examples

compile error falls back to tail ~139 tokens → ~127 tokens (9% saved)
Raw output
   Compiling myapp v0.1.0 (/home/user/myapp)
error[E0308]: mismatched types
  --> src/main.rs:15:20
   |
15 |     let count: u32 = "hello";
   |                ---   ^^^^^^^ expected `u32`, found `&str`
   |                |
   |                expected due to this

error[E0425]: cannot find value `undefined_var` in this scope
  --> src/lib.rs:42:5
   |
42 |     undefined_var
   |     ^^^^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0308`.
error: could not compile `myapp` (lib) due to 2 previous errors
Filtered output
error[E0308]: mismatched types
  --> src/main.rs:15:20
   |
15 |     let count: u32 = "hello";
   |                ---   ^^^^^^^ expected `u32`, found `&str`
   |                |
   |                expected due to this
error[E0425]: cannot find value `undefined_var` in this scope
  --> src/lib.rs:42:5
   |
42 |     undefined_var
   |     ^^^^^^^^^^^^^ not found in this scope
For more information about this error, try `rustc --explain E0308`.
error: could not compile `myapp` (lib) due to 2 previous errors
single failure with cancel ~925 tokens → ~205 tokens (78% saved)
Raw output
    Finished `test` profile [unoptimized + debuginfo] target(s) in 9.99s
────────────
 Nextest run ID 4bc31861-0d88-49fa-a3c1-d31fa6161ce4 with nextest profile: default
    Starting 469 tests across 12 binaries
        PASS [   0.011s] (  1/469) kiezfyi-api auth::extractor::tests::extract_bearer_token_valid
        PASS [   0.016s] (  2/469) kiezfyi-api auth::extractor::tests::extract_bearer_token_non_utf8
        PASS [   0.020s] (  3/469) kiezfyi-api config::tests::load_applies_defaults_for_host_and_port
        PASS [   0.020s] (  4/469) kiezfyi-api config::tests::validate_rejects_empty_clerk_issuer
        PASS [   0.021s] (  5/469) kiezfyi-api config::tests::load_has_empty_defaults_for_clerk_fields
        PASS [   0.024s] (  6/469) kiezfyi-api config::tests::validate_accepts_valid_clerk_config
        PASS [   0.024s] (  7/469) kiezfyi-api auth::extractor::tests::extract_bearer_token_missing_header
        PASS [   0.024s] (  8/469) kiezfyi-api auth::extractor::tests::extract_bearer_token_wrong_scheme
        PASS [   0.013s] (  9/469) kiezfyi-api error::tests::bad_request_returns_400
        PASS [   0.011s] ( 10/469) kiezfyi-api error::tests::debug_impl_contains_variant_name
        PASS [   0.015s] ( 11/469) kiezfyi-api error::tests::database_error_returns_500_with_generic_message
        PASS [   0.015s] ( 12/469) kiezfyi-api error::tests::display_impl_shows_message
        PASS [   0.014s] ( 13/469) kiezfyi-api error::tests::internal_returns_500
        FAIL [   0.022s] ( 14/469) kiezfyi-api config::tests::load_picks_up_database_url_from_env

── stdout ───
running 1 test
test config::tests::load_picks_up_database_url_from_env ... FAILED

failures:

failures:
    config::tests::load_picks_up_database_url_from_env

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 212 filtered out; finished in 0.00s

── stderr ───
thread 'config::tests::load_picks_up_database_url_from_env' (39244358) panicked at api/src/config.rs:103:9:
database_url should be populated from DATABASE_URL env var
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

        PASS [   0.015s] ( 15/469) kiezfyi-api error::tests::forbidden_returns_403
        PASS [   0.014s] ( 16/469) kiezfyi-api error::tests::service_unavailable_returns_503
        PASS [   0.015s] ( 17/469) kiezfyi-api error::tests::sqlx_error_converts_via_from
        PASS [   0.011s] ( 18/469) kiezfyi-api geo::polyline::tests::empty_polygon_returns_error
        PASS [   0.017s] ( 19/469) kiezfyi-api error::tests::not_found_returns_404
        PASS [   0.015s] ( 20/469) kiezfyi-api geo::polyline::tests::coordinate_order_swapped
        PASS [   0.017s] ( 21/469) kiezfyi-api error::tests::unauthorized_returns_401
        PASS [   0.018s] ( 22/469) kiezfyi-api geo::polyline::tests::encode_negative_coords
        PASS [  12.065s] ( 23/469) kiezfyi-api auth::jwks::tests::find_key_returns_error_for_unknown_kid
        PASS [  12.556s] ( 24/469) kiezfyi-api auth::jwks::tests::find_key_returns_error_for_missing_kid
        PASS [  12.647s] ( 25/469) kiezfyi-api auth::jwks::tests::find_key_returns_key_for_matching_kid
        PASS [  30.023s] ( 26/469) kiezfyi-api db::tests::create_pool_with_invalid_url_returns_error
  Cancelling due to test failure: 15 tests still running
────────────
     Summary [  30.023s] 29/469 tests run: 28 passed, 1 failed, 0 skipped
        FAIL [   0.022s] ( 14/469) kiezfyi-api config::tests::load_picks_up_database_url_from_env
warning: 440/469 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed
Filtered output
✗ nextest: 28 passed, 1 failed, 0 skipped


── stdout ───
running 1 test
test config::tests::load_picks_up_database_url_from_env ... FAILED

failures:

failures:
    config::tests::load_picks_up_database_url_from_env

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 212 filtered out; finished in 0.00s

── stderr ───
thread 'config::tests::load_picks_up_database_url_from_env' (39244358) panicked at api/src/config.rs:103:9:
database_url should be populated from DATABASE_URL env var
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

warning: 440/469 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

     Summary [  30.023s] 29/469 tests run: 28 passed, 1 failed, 0 skipped
multiple failures ~800 tokens → ~445 tokens (44% saved)
Raw output
    Finished `test` profile [unoptimized + debuginfo] target(s) in 5.23s
────────────
 Nextest run ID 8a2c1e4f-3b7d-4e8a-9c2f-1a3b5c7d9e0f with nextest profile: default
    Starting 150 tests across 5 binaries
        PASS [   0.010s] (  1/150) myapp auth::tests::login_succeeds
        PASS [   0.012s] (  2/150) myapp auth::tests::logout_clears_session
        PASS [   0.011s] (  3/150) myapp auth::tests::refresh_token_works
        FAIL [   0.015s] (  4/150) myapp db::tests::connection_pool_timeout

── stdout ───
running 1 test
test db::tests::connection_pool_timeout ... FAILED

failures:

failures:
    db::tests::connection_pool_timeout

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 50 filtered out; finished in 0.01s

── stderr ───
thread 'db::tests::connection_pool_timeout' panicked at src/db.rs:45:9:
assertion `left == right` failed
  left: 5000
 right: 3000
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

        PASS [   0.009s] (  5/150) myapp config::tests::load_defaults
        PASS [   0.010s] (  6/150) myapp config::tests::override_from_env
        FAIL [   0.020s] (  7/150) myapp handlers::tests::create_user_validates_email

── stdout ───
running 1 test
test handlers::tests::create_user_validates_email ... FAILED

failures:

failures:
    handlers::tests::create_user_validates_email

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 50 filtered out; finished in 0.02s

── stderr ───
thread 'handlers::tests::create_user_validates_email' panicked at src/handlers.rs:112:9:
Expected 400 Bad Request but got 200 OK
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

        PASS [   0.008s] (  8/150) myapp handlers::tests::list_users_paginated
        PASS [   0.009s] (  9/150) myapp handlers::tests::delete_user_returns_204
        FAIL [   0.018s] ( 10/150) myapp middleware::tests::rate_limiter_blocks_excess

── stdout ───
running 1 test
test middleware::tests::rate_limiter_blocks_excess ... FAILED

failures:

failures:
    middleware::tests::rate_limiter_blocks_excess

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 50 filtered out; finished in 0.01s

── stderr ───
thread 'middleware::tests::rate_limiter_blocks_excess' panicked at src/middleware.rs:78:9:
assertion `left == right` failed
  left: 200
 right: 429
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

        PASS [   0.010s] ( 11/150) myapp middleware::tests::cors_headers_present
        PASS [   0.011s] ( 12/150) myapp middleware::tests::auth_middleware_rejects_expired
────────────
     Summary [   0.250s] 12/150 tests run: 9 passed, 3 failed, 0 skipped
        FAIL [   0.015s] (  4/150) myapp db::tests::connection_pool_timeout
        FAIL [   0.020s] (  7/150) myapp handlers::tests::create_user_validates_email
        FAIL [   0.018s] ( 10/150) myapp middleware::tests::rate_limiter_blocks_excess
warning: 138/150 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed
Filtered output
✗ nextest: 9 passed, 3 failed, 0 skipped


── stdout ───
running 1 test
test db::tests::connection_pool_timeout ... FAILED

failures:

failures:
    db::tests::connection_pool_timeout

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 50 filtered out; finished in 0.01s

── stderr ───
thread 'db::tests::connection_pool_timeout' panicked at src/db.rs:45:9:
assertion `left == right` failed
  left: 5000
 right: 3000
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


── stdout ───
running 1 test
test handlers::tests::create_user_validates_email ... FAILED

failures:

failures:
    handlers::tests::create_user_validates_email

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 50 filtered out; finished in 0.02s

── stderr ───
thread 'handlers::tests::create_user_validates_email' panicked at src/handlers.rs:112:9:
Expected 400 Bad Request but got 200 OK
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


── stdout ───
running 1 test
test middleware::tests::rate_limiter_blocks_excess ... FAILED

failures:

failures:
    middleware::tests::rate_limiter_blocks_excess

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 50 filtered out; finished in 0.01s

── stderr ───
thread 'middleware::tests::rate_limiter_blocks_excess' panicked at src/middleware.rs:78:9:
assertion `left == right` failed
  left: 200
 right: 429
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

warning: 138/150 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

     Summary [   0.250s] 12/150 tests run: 9 passed, 3 failed, 0 skipped
single crate all pass ~354 tokens → ~10 tokens (97% saved)
Raw output
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.06s
────────────
 Nextest run ID cb44c8eb-b6cf-4c3b-bf20-b90037cf6e57 with nextest profile: default
    Starting 12 tests across 1 binary
        PASS [   0.009s] ( 1/12) tokf-common config::types::tests::passthrough_empty_list_never_triggers
        PASS [   0.010s] ( 2/12) tokf-common config::types::tests::passthrough_short_flag_does_not_match_long
        PASS [   0.010s] ( 3/12) tokf-common config::types_tests::match_output_validate_accepts_pattern
        PASS [   0.007s] ( 4/12) tokf-common examples::tests::reduction_pct_basic
        PASS [   0.007s] ( 5/12) tokf-common hash::tests::hash_is_stable_across_calls
        PASS [   0.009s] ( 6/12) tokf-common safety::tests::all_checks_returns_all_registered
        PASS [   0.009s] ( 7/12) tokf-common safety::tests::config_clean
        PASS [   0.011s] ( 8/12) tokf-common multipart::tests::build_body_produces_valid_multipart
        PASS [   0.008s] ( 9/12) tokf-common safety::tests::rewrite_clean_simple
        PASS [   0.009s] (10/12) tokf-common safety::tests::rewrite_detects_pipe
        PASS [   0.009s] (11/12) tokf-common test_case::tests::deserialize_minimal_test_case
        PASS [   0.008s] (12/12) tokf-common test_case::tests::serialize_round_trip
────────────
     Summary [   0.083s] 12 tests run: 12 passed, 0 skipped
Filtered output
✓ nextest: 12 passed, 0 failed, 0 skipped
pass with skipped tests ~355 tokens → ~11 tokens (97% saved)
Raw output
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.19s
────────────
 Nextest run ID 0c45a582-a5ca-4e1a-9fef-356e7378284b with nextest profile: default
    Starting 1426 tests across 32 binaries (2 tests skipped)
        PASS [   0.020s] (   1/1426) tokf auth::client::tests::debug_redacts_device_code
        PASS [   0.019s] (   2/1426) tokf auth::client::tests::deserialize_token_response_without_tos_fields
        PASS [   0.020s] (   3/1426) tokf auth::client::tests::deserialize_device_flow_with_complete_uri
        PASS [   0.021s] (   4/1426) tokf auth::client::tests::extract_error_message_raw_text
        PASS [   0.022s] (   5/1426) tokf auth::client::tests::deserialize_token_response_with_tos_fields
        PASS [   0.023s] (   6/1426) tokf auth::client::tests::deserialize_pending_response
        PASS [   0.024s] (   7/1426) tokf auth::client::tests::extract_error_message_from_json_error_field
        PASS [   0.024s] (   8/1426) tokf auth::client::tests::sanitize_error_text_truncates
        PASS [   0.024s] (   9/1426) tokf auth::client::tests::is_safe_browser_uri_checks
        PASS [   0.024s] (  10/1426) tokf auth::client::tests::extract_error_message_from_json
        PASS [   7.028s] (1426/1426) tokf remote::retry::tests::retries_on_429_up_to_max
────────────
     Summary [   7.572s] 1426 tests run: 1426 passed, 2 skipped
Filtered output
✓ nextest: 1426 passed, 0 failed, 2 skipped
workspace all pass with skipped ~700 tokens → ~11 tokens (98% saved)
Raw output
    Finished `test` profile [unoptimized + debuginfo] target(s) in 9.99s
────────────
 Nextest run ID 0c45a582-a5ca-4e1a-9fef-356e7378284b with nextest profile: default
    Starting 1504 tests across 33 binaries (2 tests skipped)
        PASS [   0.020s] (   1/1504) tokf auth::client::tests::debug_redacts_device_code
        PASS [   0.019s] (   2/1504) tokf auth::client::tests::deserialize_token_response_without_tos_fields
        PASS [   0.020s] (   3/1504) tokf auth::client::tests::deserialize_device_flow_with_complete_uri
        PASS [   0.021s] (   4/1504) tokf auth::client::tests::extract_error_message_raw_text
        PASS [   0.022s] (   5/1504) tokf auth::client::tests::deserialize_token_response_with_tos_fields
        PASS [   0.023s] (   6/1504) tokf auth::client::tests::deserialize_pending_response
        PASS [   0.024s] (   7/1504) tokf auth::client::tests::extract_error_message_from_json_error_field
        PASS [   0.024s] (   8/1504) tokf auth::client::tests::sanitize_error_text_truncates
        PASS [   0.009s] (   9/1504) tokf-common config::types::tests::passthrough_empty_list_never_triggers
        PASS [   0.009s] (  10/1504) tokf-common config::types::tests::passthrough_args_defaults_to_empty
        PASS [   0.011s] (  11/1504) tokf-common config::types::tests::passthrough_exact_match
        PASS [   0.012s] (  12/1504) tokf-common config::types::tests::passthrough_prefix_match
        PASS [   0.009s] (  13/1504) tokf-common hash::tests::hash_is_stable_across_calls
        PASS [   0.008s] (  14/1504) tokf-common safety::tests::config_clean
        PASS [   0.008s] (  15/1504) tokf-common safety::tests::rewrite_clean_simple
        PASS [   0.009s] (  16/1504) tokf-common test_case::tests::serialize_round_trip
        PASS [   0.010s] (  17/1504) tokf filter::cleanup::tests::strip_ansi_removes_codes
        PASS [   0.010s] (  18/1504) tokf filter::dedup::tests::dedup_basic
        PASS [   0.011s] (  19/1504) tokf filter::extract::tests::extract_first_match
        PASS [   0.012s] (  20/1504) tokf filter::group::tests::group_basic
        PASS [   0.009s] (  21/1504) tokf filter::skip::tests::skip_filters_lines
        PASS [   0.010s] (  22/1504) tokf filter::template::tests::simple_template
        PASS [   0.012s] (  23/1504) tokf config::tests::resolve_basic
        PASS [   0.014s] (  24/1504) tokf config::cache::tests::round_trip
        PASS [   2.071s] (1502/1504) tokf::cli_shell make_shell_override_filters_git_status
        PASS [   2.832s] (1503/1504) tokf::cli_shell shell_c_filters_git_no_pager_log
        PASS [   7.023s] (1504/1504) tokf remote::retry::tests::retries_on_429_up_to_max
────────────
     Summary [   7.442s] 1504 tests run: 1504 passed, 2 skipped
Filtered output
✓ nextest: 1504 passed, 0 failed, 2 skipped
Warning: Community filters are third-party code. Review the filter definition above before installing it in production environments.
Browse all filters