feat(phpt): add PHP .phpt filter for php-src run-tests.php (-99%)#1503
Open
iliaal wants to merge 1 commit intortk-ai:developfrom
Open
feat(phpt): add PHP .phpt filter for php-src run-tests.php (-99%)#1503iliaal wants to merge 1 commit intortk-ai:developfrom
iliaal wants to merge 1 commit intortk-ai:developfrom
Conversation
Collaborator
📊 Automated PR Analysis
SummaryAdds a new Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
Wraps `php run-tests.php` and collapses its per-test PASS chatter into one summary line plus a bounded list of failure diffs. On php-src's 5322-test suite with 467 failures, output drops from 1.3 MB to 6 KB (99.5% reduction). An all-pass run collapses to two lines. Handles PASS/FAIL/SKIP/BORK/WARN/LEAK/XFAIL, ANSI color codes, the ========DIFF======== / ========DONE======== blocks, and the trailing FAILED TEST SUMMARY block (which must not be re-counted).
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
Adds
rtk phpt, a filter forphp run-tests.php. It's the driver php-src and PHP extensions use for their.phpttest suite.A full php-src run emits one status line per test plus a
========DIFF========block per failure. On a 5322-test run that's about 1.3 MB of output, 99%+ of which is PASS chatter. After filtering:Filtered output keeps what the agent needs: aggregate counts, PHP version/SAPI/OS, and up to 20 failures with the first 6 diff lines each.
Example
Usage
Implementation
src/cmds/php/phpt_cmd.rsis a new filter module modeled onpython/pytest_cmd.rs: stateful line scan, regex anchors, inline tests.Status tokens match via
(?:^|\])(PASS|FAIL|SKIP|BORK|WARN|LEAK|XFAIL)\s+(.*?)\s*\[([^\[\]]+\.phpt)\]. The(?:^|\])anchor is what prevents the trailingFAILED TEST SUMMARYblock from being re-counted. Its lines aredescription [path]with no status tag.ANSI is stripped via the existing
utils::strip_ansi. Execution goes throughrunner::run_filteredwithstdout_only().tee("phpt"), same as pytest. The command is added to theis_operational_commandwhitelist so it flows through the hook pipeline.Tests
12 inline unit tests:
FAILED TEST SUMMARYblock doesn't re-count failuresPHP_OSkernel info trimmed to just the OS familyTest plan
cargo test -p rtk phptpasses 12/12cargo fmt --all -- --checkcleancargo clippy -p rtkno new warnings in diff (pre-existing errors unchanged)rtk phpt Zend/tests/67468.phpton real php-src, correct outputrtk phpt Zend/tests/ArrayAccess/(11 tests), correct output