feat(php): add PHPUnit support with compact output (65%+ token savings)#874
Open
Beninho wants to merge 1 commit intortk-ai:masterfrom
Open
feat(php): add PHPUnit support with compact output (65%+ token savings)#874Beninho wants to merge 1 commit intortk-ai:masterfrom
Beninho wants to merge 1 commit intortk-ai:masterfrom
Conversation
- 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 error
|
Benjamin LETELLIER seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rtk phpunitcommand with a state-machine output filter (65%+ token savings)phpunit,vendor/bin/phpunit,bin/phpunit(Symfony),php vendor/bin/phpunit,php bin/phpunitChanges
src/phpunit_cmd.rssrc/main.rsis_operational_commandregistrationsrc/discover/rules.rssrc/discover/registry.rstests/fixtures/phpunit_raw.txtscripts/test-all.shREADME.mdCHANGELOG.md[Unreleased]feature entryFilter design
State machine:
Header → Failures → DoneOutput:
Test plan
cargo test --all— 1134 passed, 0 failedcargo fmt --all && cargo clippy --all-targets— clean for updated files. See src/rake_cmd.rs:18:31rtk phpunit --helpshows descriptionphpunit tests/→rtk phpunit tests/