-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: Streamline running of tests against all PHPUnit versions #819
Labels
Comments
I've had another play with this, but still haven't found a way to handle this gracefully using Composer scripts alone (and I'd prefer not to introduce bash scripts as they are typically not usable cross-OS). Something like the below doesn't work. "test": [
"phpunit --atleast-version 10 && @test10 || @testlt10"
],
"testlt10": [
"@php ./vendor/phpunit/phpunit/phpunit --no-coverage"
],
"test10": [
"@php ./vendor/phpunit/phpunit/phpunit -c phpunit10.xml.dist --no-coverage"
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The PR #817 introduced a new configuration file for PHPUnit 10, separate from the previous configuration file. In order to run tests against PHPUnit 10, you now have to run
composer test10
instead of onlycomposer test
.It would be preferable to have only a singular entry point of
composer test
that is smart enough to run PHPUnit against the right configuration file.While looking into this, we've found that PHPUnit has a very convenient flag
--atleast-version <version>
which could be used to run the tests conditionally. So, the idea is to have something like this (simplified):That should generally work.
However, we have yet to find a way to combine this with the use of
@php
to reuse the exact PHP process that Composer is running under. According to the Composer documentation, you cannot combine multiple commands like this:This is why PR #817 has separate Composer scripts at this point:
composer test
&composer test10
.This goes against Composer conventions and requires the user to know details about the test flow and dependencies in order to run the tests.
The text was updated successfully, but these errors were encountered: