10000 Pre-install PHPUnit 8 with simple-phpunit by ro0NL · Pull Request #116 · jakzal/toolbox · GitHub
[go: up one dir, main page]

Skip to content

Pre-install PHPUnit 8 with simple-phpunit #116

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

Merged
merged 2 commits into from
Jun 29, 2019
Merged

Pre-install PHPUnit 8 with simple-phpunit #116

merged 2 commits into from
Jun 29, 2019

Conversation

ro0NL
Copy link
Contributor
@ro0NL ro0NL commented Jun 16, 2019

See symfony/symfony#32059 (comment) for relevant info.

simple-phpunit will start installing PHPunit 8 (e.g. latest major) by default as of symfony/phpunit-bridge@4.4, that's November 2019 :(

It should be used using SYMFONY_PHPUNIT_VERSION=8.2 simple-phpunit, but currently you wont benefit from a default installation available on the image :(

Eventually the cycle can start over, if we want to keep installing e.g. 2 latest majors.

(As a side effect simple-phpunit is now excluded on PHP 7.1, personally i'm fine with that)

@ro0NL
Copy link
Contributor Author
ro0NL commented Jun 16, 2019

Works as expected for me 👍

@@ -719,10 +719,11 @@
"links": {"%target-dir%/simple-phpunit": "simple-phpunit"}
},
"sh": {
"command": "simple-phpunit install"
"command": "simple-phpunit install && SYMFONY_PHPUNIT_VERSION=8.2 simple-phpunit install"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to run the install command twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, see https://travis-ci.com/jakzal/toolbox/jobs/208386006#L611

this ensures it installs both v7/v8 given the current defaults of SYMFONY_PHPUNIT_VERSION (which depends on PHP version) today.

So currently you can invoke

simple-phpunit # 7.4
SYMFONY_PHPUNIT_VERSION=7.4 simple-phpunit
SYMFONY_PHPUNIT_VERSION=8.2 simple-phpunit

without any additional installation required (that's what's solved here ultimately). Invoking any other version SYMFONY_PHPUNIT_VERSION=x.y ... will trigger a custom installation on user's side. Nevertheless, defaults should be sane; supporting the last 2 majors.

As of november 2019, when we'll install symfony/phpunit-bridge@4.4 we can remove it, unless we decide to keep phpunit v7 or any version wanted then.

Copy link
Contributor Author
@ro0NL ro0NL Jun 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one thing is invoking simple-phpunit without setting SYMFONY_PHPUNIT_VERSION anywhere, let's Symfony decide the defaults (they are now bumped in symfony/symfony#32059).

So perhaps we should always set SYMFONY_PHPUNIT_VERSION=7|8 simple-phpunit install explicit during install, and a default in the image as well when the user invokes simple-phpunit

this way Toolbox is in full control of the PHPUnit version defaults.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure it's big a deal for now, worst case simple-phpunit install && SYMFONY_PHPUNIT_VERSION=8.2 simple-phpunit install will install 8.2 twice, once symfony/symfony#32059 is merged upstream. Then we should clean it up.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a look at this PR when I have a bit more time. Bare with me :)

@jakzal jakzal merged commit 34e34d4 into jakzal:master Jun 29, 2019
@jakzal
Copy link
Owner
jakzal commented Jun 29, 2019

Finally found time to give it a go, works as expected 👍

Thank you 🍺

@ro0NL ro0NL deleted the patch-1 branch June 29, 2019 11:59
jakzal added a commit to jakzal/phpqa that referenced this pull request Jun 30, 2019
* simple-phpunit is now bundled with two versions of PHPUnit (7.x and 8.2) jakzal/toolbox#116 (thanks @ro0NL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0