Commit a320846
committed
feat(php): add PHPUnit filter with compact output (65%+ token savings)
- New `rtk phpunit` command: state-machine filter that captures test
names, assertion messages, and file locations from PHPUnit output,
stripping version banner, progress dots, timing, and memory noise
- Supports all invocation variants: `phpunit`, `vendor/bin/phpunit`,
`bin/phpunit` (Symfony), `php vendor/bin/phpunit`, `php bin/phpunit`
- Binary detection priority: global phpunit → bin/phpunit → vendor/bin/phpunit
- Registers in discover/rules.rs for `rtk discover` and hook rewriting
- 17 tests: 7 filter tests (including token savings ≥60%), 10 registry
tests for classify/rewrite across all variants; real fixture in
tests/fixtures/phpunit_raw.txt
- "OK (X tests, Y assertions)" → already worked, now also shows
counts for the generic fallback path
- "OK, but incomplete, skipped, or risky tests!" → new handler
shows skipped count (e.g. "PHPUnit: 9 tests, 15 assertions, 2 skipped")
- Generic fallback now calls parse_counts to show test/assertion
counts instead of bare "PHPUnit: OK"
- parse_counts returns 4-tuple (tests, assertions, failures, skipped)
to support Skipped: field with trailing-period stripping
- 3 new tests covering each success variant
- catch segfault + Fatal error1 parent 2efe860 commit a320846
File tree
9 files changed
+589
-0
lines changed- scripts
- src
- cmds
- php
- discover
- tests/fixtures
9 files changed
+589
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
418 | 419 | | |
419 | 420 | | |
420 | 421 | | |
| 422 | + | |
421 | 423 | | |
422 | 424 | | |
423 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
567 | 577 | | |
568 | 578 | | |
569 | 579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments