-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
CI review for PHP 8.1/decisions requested #37
Comments
PsalmFor phpdocumentor/typeresolver I recently switched to a composer installed psalm. And upgrade to the latest psalm version would be great. Testworkflow
phpunitSince this package is part of the set of libraries used by phpunit, I think we have to allow failures on php 8.1 for now. We did the same think for php 8. Ignore the failures to allow phpunit to proceed in their workflow. And create a new release if bugfixes are needed. This library is so small that I just took that risk :-). GeneralI didn't know If it helps, I think it is Ok if we would drop php 7.2 from this lib. This library nearly gets any patches. It would allow you to upgrade to phpunit 9? Thanks for all this input! |
Done - see PR #42
In that case, I think it was applied incorrectly. As things stand, ALL test builds would be allowed to I'm going to suggest removing it for now. With optionally adding When the build against PHP 8.1 gets added, I will revisit this.
I'm not sure I understand or rather, this doesn't seem to answer my question. The tests for this package pass on PHP 8.1 when the tests are run via Composer or via bleeding-edge (Temporarily) installing PHPUnit via Composer for PHP 8.1 in CI would bypass that issue. Alternatively, waiting a few more days/weeks for the PHPUnit 9.5.8 Phar to be released would also allow the test runs to pass. As a last resort, I can configure the workflow to allow failing test runs for PHP 8.1 for the time being (but only for PHP 8.1, in contrast to how this was done before). UPDATE: PHPUnit 9.5.8 has been released, so the Phar issue no longer exists.
Done. See PR #39
The library already has a minimum PHP requirement of PHP 7.3 and already uses PHPUnit 9.x. The only question now still open is about the test runs. Other than that, I have lined up a number of PRs which should be good to go and all contribute to getting the CI to pass again. |
I'm not 100% sure if this will work... php will autoload the classes in a certain order, because this library is part of phpunit's dependencies. It might happen that this library version will conflict with phpunit constraints. We had this in the past. Using composer installed phpunit only works on the master branch or branches which are aliased in our composer.json.
I think we have an issue here... this library is a dependency of prophecy, which is a dependency of phpunit. This library must support 8.1 in a tagged version to allow phpunit to release a phar for 8.1 :-)
However, it sounds bad. I think the last resort is the best solution. We changed nothing since the last release, so it would be kind of safe to do this. So please allow php 8.1 to fail for now, once there is a official supported version of phpunit on php 8.1 we can remove the check and be strict again. |
Well, I tested it and it did work (with some tweaks for the circular dependency - basically you need to set a
While PHPUnit 9.5.8 may not 100% officially support PHP 8.1 yet due to Prophecy, as you're not using Prophecy in your test suite, the tests will pass without problem, so no need. |
Hi @jaapio,
As discussed, I've done a review of the CI setup with an eye on getting the tests running on PHP 8.1.
Aside from some obvious fixes which are needed, I also found a number of things for which there are multiple solution directions available and I would like to ask you for guidance as to what is your preferred solution.
I have a (passing) WIP branch prepared and will pull the various PRs once I receive your replies.
Psalm
At this moment, there is an inconsistency between the Psalm version for local dev use and the Psalm version used in CI.
For local dev, Psalm is installed via Phive and fixed at version
3.11.2
which yields no issues. An upgrade to version3.18.2
(last 3.x release) would be needed due to the age of the version, but that is an update without consequence.For CI, Psalm is installed via the
tools
option of thesetup-php
action without fixed version, which in practice means that the latest version of Psalm is used, which is version4.6.1
, which would yield one issue.Options:
setup-php
to install Psalm in CI, but fix the version being installed to the same version as installed via Phive.This would add a maintenance burden as the version numbers in
phive.xml
and in thepush.yml
workflow file would need to be manually kept in sync.version
for Psalm needed.Note: I'm not sure how to ensure that Phive will always install the latest version and haven't been able to find information on the XML schema to figure out if I can just remove the
installed
key or set it tolatest
or something.Additional question:
Test workflow
In the
phpunit
job, the actual running of the tests has acontinue-on-error
directive. This means that even when a test build fails, the workflow will continue and not be marked as "failed", nor will email notification about the failed build be send out.Individual builds will still be marked as failed.
I suspect this may have been set-up this way to make sure that all matrix variations of test builds will actually be run ?
I'm proposing to change this now by:
continue-on-error
for the test run step.fail-fast
key and setting it tofalse
.By default this key is set to
true
, which means that if any individual build within the job fails, all other builds within the job will be cancelled.By setting it to
false
, all builds in the matrix will still be run, but if any of them fail, the workflow will be marked as "failed".PHPUnit vs PHP 8.1
The latest release of the PHPUnit 9.5 Phar still contains an incompatibility with PHP 8.1-beta1 (and higher).
Using the PHPUnit Phar will therefore fail the build, even though the tests do actually pass on PHP 8.1.
The next Phar release of PHPUnit (9.5.8) will contain a fix for the above mentioned issue.
Options:
General
In various jobs in the workflow, steps are included to cache the Composer
downloads
directory and runcomposer install
. However, this package has no dependencies, so these steps are redundant.Options:
composer dumpautoload
.ramsey/composer-install
action to clean up the script and maintain the existing behaviour.Please let me know what action you'd prefer for each of these issues.
The text was updated successfully, but these errors were encountered: