Skip to content

feat(mvn): enrich test output with Surefire/Failsafe XML reports#3

Open
mariuszs wants to merge 34 commits intomasterfrom
feat/mvn-surefire-xml
Open

feat(mvn): enrich test output with Surefire/Failsafe XML reports#3
mariuszs wants to merge 34 commits intomasterfrom
feat/mvn-surefire-xml

Conversation

@mariuszs
Copy link
Copy Markdown
Owner

Summary

  • Ports maven-mcp's SurefireReportParser + StackTraceProcessor to Rust.
  • Adds pom.xml <groupId> autodetect for framework-frame classification.
  • Post-text-filter enrichment reads target/surefire-reports/ and target/failsafe-reports/ XMLs (time-gated by started_at) and appends structured failure details to the rtk mvn output.
  • Red-flag heuristic: no tests run with no fresh reports now surfaces a diagnostic instead of silently pretending everything is fine.
  • Override via RTK_MVN_APP_PACKAGE env var.

Spec: docs/superpowers/specs/2026-04-15-mvn-surefire-xml-enrichment-design.md
Plan: docs/superpowers/plans/2026-04-15-mvn-surefire-xml-enrichment.md

Stacks on feat/mvn-rust-module (upstream PR rtk-ai#1089).

Test plan

  • cargo test --all — 1548 passed, 6 ignored (incl. new stack_trace, surefire_reports, pom_groupid, mvn_cmd tests)
  • cargo fmt --all --check — clean
  • Snapshot tests — 3 accepted, deterministic
  • Token savings — happy path identity, failure path ~99.4% (threshold ≥85%)
  • Release build + hyperfine — startup 562 µs in a dir with 50 surefire XMLs (target <10ms)
  • cargo clippy --all-targets -- -D warnings — 6 pre-existing warnings on branch baseline (main.rs function_casts, hooks/ unused items); none introduced by this PR

aeppling and others added 30 commits March 31, 2026 20:24
Co-Authored-By: ahundt <ATHundt@gmail.com>
+ remove unused import
  What changed:
  - Add `run_claude()` with permissions check, audit logging, tool_input
    preservation, and Ask/Allow/Deny support
  - Add `run_cursor()` with flat JSON format (`permission`/`updated_input`)
  - Add `audit_log()` (best-effort append when RTK_HOOK_AUDIT=1)
  - Fix `run_gemini()` to load exclude_commands from config
  - Convert all hook stdout to `writeln!` with `#[deny(clippy::print_stdout)]`
    to prevent JSON protocol corruption (Claude Code bug #4669)
  - Replace string-based heredoc detection with lexer-based `has_heredoc()`
    (quote-aware: `<<` inside quotes no longer false-positives)
  - Add shell prefix peeling (noglob, command, builtin, exec, nocorrect)
    to `rewrite_segment()` in registry.rs
  - Fix python3 -m pytest pattern, add pip show, add gt (Graphite) to RULES
  - Remove `command ` from IGNORED_PREFIXES (was blocking `command git status`)
  - Register `rtk hook claude`/`rtk hook cursor` binary commands in
    settings.json instead of writing bash script files
  - Add legacy script migration (deletes old rtk-rewrite.sh on `rtk init`)
  - Simplify hook_check and integrity for script-free model
Integrates ~30 develop commits (PR rtk-ai#997): AWS expansion (8→25 cmds),
SSH signing for git commit/push, go test context, grep stdin leak fix,
default-to-ask permissions, gh pr merge passthrough.

Conflict resolution (4 files):
- git.rs: kept .output()+stdin(inherit) for commit/push (SSH/GPG signing)
- go_cmd.rs: accepted incoming + added pub(crate) visibility
- hook_check.rs: merged binary_hook_registered + other_integration_installed
- hook_cmd.rs: fixed permissions path, println→writeln for Gemini deny

Verified: 1445 tests pass, 0 clippy errors, all manual integration tests pass.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- pipe_cmd: fix panic on multi-byte UTF-8 at 1024 byte boundary (floor_char_boundary in auto_detect_filter)
- pipe_cmd: cap stdin at 10 MiB to prevent OOM (reuses RAW_CAP)
- stream: hoist RAW_CAP to pub const at module level
- hook_cmd: check deny before get_rewritten in handle_vscode
    (matches handle_copilot_cli and run_claude order)
  - hook_cmd: escape backslash and pipe in audit log sanitizer
  - tsc_cmd: hoist duplicate TSC_ERROR regex to single module-level
    lazy_static
4 fixes applied (all confirmed introduced by PR rtk-ai#956, all tests pass):

- P0 NEW-passthrough — pipe_cmd.rs: passthrough before cap read
- P1 BUFFERED-panic — stream.rs: catch_unwind on Buffered filter
- P1 STREAM-postcap — stream.rs: stop feeding filter after cap
- P2 OFFBYONE-rawcap — stream.rs: 5 cap boundary checks fixed

5 findings dropped (not introduced by PR or not bugs):

- DENY-claude: pre-existing on master
- AUDIT-asymmetry: intentional scope choice, not a bug
- GEMINI-test: pre-existing test pattern from master
- SAVINGS-threshold: 40% is correct (filters achieve ~46%)
- STDERR-test: cosmetic CI, not correctness
- handle npm exec|run and their aliases
- handle pnpm exec|run and their aliases like npm
- handle pnpx and its alias like npx
- handle all forms of js script/package execution

Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
…npm test` commands as we don't know which test framework is used under the hood

Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
…jest

Also remove duration computation as there's no endTime attribute in json output

Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
This reverts commit 94a3532.
Build is no longer a pnpm command with specific handling.

Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
feat(discover): handle more npm/npx/pnpm/pnpx patterns
aeppling and others added 3 commits April 14, 2026 20:54
@mariuszs mariuszs force-pushed the feat/mvn-surefire-xml branch from b64e6a1 to 5a71041 Compare April 16, 2026 05:56
Add Java ecosystem support with state-machine parsers for mvn test,
compile, checkstyle:check, and dependency:tree (97-99%+ token savings).

Enrich test failure output with structured details from Surefire/Failsafe
XML reports: stack traces segmented on Caused-by with framework frames
collapsed, root-cause preserved, captured stdout/stderr per failing test.

Autodetect application package from pom.xml groupId for frame
classification (override via RTK_MVN_APP_PACKAGE). Time-gated report
reads skip stale files. Red-flag heuristic for zero-test runs.
@mariuszs mariuszs force-pushed the feat/mvn-surefire-xml branch from 2a1eea8 to b128e95 Compare April 16, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants