Currently the test runner is mostly written in node. We could write it in full PHP, this would have the following benefits: - lighter docker image: only php has to be embeded - easier contribution from PHP's track participant - in depth usage of phpunit, should ease the upgrade to the spec version 3 #9 - improved testing # Current behavior The current test runner does the following; 1. runs PHPUnit (from cli) 2. use `jo` to output error for a generic error 3. uses a node program to convert the report to exercism's interface # Target behavior The idea would be to use PHPUnit as a library instead of with the CLI: 1. declare a `symfony/console` application 2. (Customize the test runner to fit our use case, see below) 3. generate the report in php directly ## Test runner customization to do - [ ] Properly load tests (using `.meta/config.json`) - [ ] Listen to `PHPUnit\Event\Test\Errored`, `PHPUnit\Event\Test\Failed` and `PHPUnit\Event\Test\Passed` to register the status - [ ] Allow the addition of annotation on top of test to specify the task id During this work we could also upgrade to PHP 8.2, in fact I did mentor 2 solutions where PHP 8.2 would have changed the outcome: - One was using dynamic properties which are now deprecated: https://www.php.net/manual/fr/functions.arguments.php - Another one was relying on a behavior change of the `str_split` function: https://www.php.net/manual/fr/function.str-split
Currently the test runner is mostly written in node. We could write it in full PHP, this would have the following benefits:
Current behavior
The current test runner does the following;
joto output error for a generic errorTarget behavior
The idea would be to use PHPUnit as a library instead of with the CLI:
symfony/consoleapplicationTest runner customization to do
.meta/config.json)PHPUnit\Event\Test\Errored,PHPUnit\Event\Test\FailedandPHPUnit\Event\Test\Passedto register the statusDuring this work we could also upgrade to PHP 8.2, in fact I did mentor 2 solutions where PHP 8.2 would have changed the outcome:
str_splitfunction: https://www.php.net/manual/fr/function.str-split