lstrojny / phpunit-clever-and-smart
A clever test runner for PHPUnit
Installs: 110 933
Dependents: 4
Suggesters: 1
Security: 0
Stars: 169
Watchers: 8
Forks: 13
Open Issues: 10
Requires
Requires (Dev)
- athletic/athletic: ~0.1
- symfony/process: 2.*
This package is auto-updated.
Last update: 2024-12-16 05:54:45 UTC
README
Mission
Enable fast feedback cycles by storing test case results in a database and reorder tests on consecutive runs in the following order:
- Failures and errors
- So far unrecorded tests
- Remaining tests by execution time in ascendant order (fastest first)
It’s probably not yet very stable but try it out.
What it does
Run a test suite once with errors
PHPUnit 3.7.28 by Sebastian Bergmann.
.............................................FSFS.............. 63 / 280 ( 22%)
............................................................... 126 / 280 ( 45%)
............................................................... 189 / 280 ( 67%)
............................................................... 252 / 280 ( 90%)
.........................
Rerun that test suite and see how the previous failing tests have been sorted to the beginning of the test run:
PHPUnit 3.7.28 by Sebastian Bergmann.
FSFS........................................................... 63 / 280 ( 22%)
............................................................... 126 / 280 ( 45%)
............................................................... 189 / 280 ( 67%)
............................................................... 252 / 280 ( 90%)
.........................
Installation
add the following line to your projects' composer.json require-dev
section.
"lstrojny/phpunit-clever-and-smart": "0.*"
Configuration
To play around with it, add this to your phpunit.xml(.dist)
<listeners> <listener class="PHPUnit\Runner\CleverAndSmart\TestListener"> <arguments> <object class="PHPUnit\Runner\CleverAndSmart\Storage\Sqlite3Storage"/> </arguments> </listener> </listeners>
you might alter the location of the sqlite storage file, by passing a path to the Sqlite3Storage class:
<listeners> <listener class="PHPUnit\Runner\CleverAndSmart\TestListener"> <arguments> <object class="PHPUnit\Runner\CleverAndSmart\Storage\Sqlite3Storage"> <arguments> <string>/my/path/to/.phpunit-cas.db</string> </arguments> </object> </arguments> </listener> </listeners>
Roadmap
- Test it with as many test suites as possible
- Stabilize
- Merge into PHPUnit core