{"record":{"id":"a4acfc9b6ba3844b","repo":"rtk-ai/rtk","slug":"test-s-failed","errorCode":null,"errorMessage":"{} test(s) failed","messagePattern":"(.+?) test\\(s\\) failed","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/hooks/verify_cmd.rs","lineNumber":45,"sourceCode":"\n    if total == 0 {\n        println!(\"No inline tests found.\");\n    } else {\n        println!(\"{}/{} tests passed\", passed, total);\n    }\n\n    if require_all && !results.filters_without_tests.is_empty() {\n        for name in &results.filters_without_tests {\n            eprintln!(\"MISSING tests for filter: {}\", name);\n        }\n        anyhow::bail!(\n            \"{} filter(s) have no inline tests (use --require-all in CI)\",\n            results.filters_without_tests.len()\n        );\n    }\n\n    if failed > 0 {\n        anyhow::bail!(\"{} test(s) failed\", failed);\n    }\n\n    Ok(())\n}\n","sourceCodeStart":27,"sourceCodeEnd":50,"githubUrl":"https://github.com/rtk-ai/rtk/blob/d977e1c31621fe8704e6500ceeb9c7a0de2b6836/src/hooks/verify_cmd.rs#L27-L50","documentation":"rtk verify applies each filter to its inline test inputs and compares the transformed output against the declared `expected` value. A nonzero failure count exits with '{n} test(s) failed'; the filters themselves ran, but at least one no longer transforms its fixture as specified. Each failure is printed above with filter name, test name, and expected vs actual.","triggerScenarios":"Editing a filter's patterns (match_output/strip_lines_matching/replace rules) without updating its inline `expected` strings — or vice versa — then running `rtk verify`; bail at src/hooks/verify_cmd.rs:47.","commonSituations":"Tightening a regex fixes one command but breaks another fixture; a formatting change (headers, ellipsis, grouping) invalidates many expectations at once.","solutions":["Read the per-test 'FAIL [filter] name / expected / actual' block printed above the bail","If the new actual output is the intended behavior, update the inline expected strings; otherwise fix the filter rules","Re-run `rtk verify` until the summary shows 0 failed before merging"],"exampleFix":"# .rtk/filters.toml — regex tightened, fixture stale\n[[tests.make]]\ninput = \"make[1]: Entering directory '/x'\\ngcc foo.c\\n\"\nexpected = \"make[1]: Entering directory '/x'\\ngcc foo.c\\n\"   # stale\n\n# updated to the new intended behavior\nexpected = \"gcc foo.c\\n\"","handlingStrategy":"validation","validationCode":"# run inline tests locally before pushing filter changes\nrtk verify","typeGuard":null,"tryCatchPattern":"In CI, parse the 'FAIL [<filter>] <test>' stderr blocks: fail the job, print the expected/actual pair, and never auto-update `expected` — a human must decide whether the filter or the fixture is right.","preventionTips":["Treat inline tests as the filter's spec: update `expected` only when the intended output deliberately changed","Run `rtk verify` after every regex or rule edit, before commit","Keep one test per distinct transformation the filter performs so failures localize quickly"],"tags":["verify","testing","filters","regression"],"backgroundTag":null,"analyzedSha":"d977e1c31621fe8704e6500ceeb9c7a0de2b6836","analyzedAt":"2026-08-16T05:40:46.291Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}