Skip to content
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

Drop support for PHP < 7.2 and improve test matrix #868

Merged
merged 8 commits into from
Jan 2, 2020

Conversation

mfn
Copy link
Collaborator

@mfn mfn commented Jan 1, 2020

Based on the feedback in #865 (comment) I tried to come up with a possible solution here:

This is mostly driven by two factors:

As such, the changes summarized here are:

  • drop support for < 7.1 and explicitly bump php verison in composer.json
  • rework the travis test matrix to be explicit
    • Previously it was unclear what was really tested because only the PHP version was specified and all the dependencies aligned itself, but that didn't express what Laravel version was actually tested => this is now explicit
    • as such was we now can run phpunit for all supported versions 🎉
  • this requires relaxing the version constraint for orchestra/testbench so composer can chose the best supported version
  • still some special work was needed for Laravel 5.5:
    • a shim for assertNotStringContainsString
    • explicitly install mockery/mockery, as older orchestra/testbanch versions didn't require it
      => was removed
  • added mockery as root dependency
  • added --prefer-lowest to test matrix

Does not approach make sense to everyone?

mfn added 5 commits January 1, 2020 23:45
.travis.yml Show resolved Hide resolved
# We assume the older PHP/Laravel versions and thus restore a working dependency system for them
composer remove --dev orchestra/testbench --no-interaction --no-update
fi
- travis_wait 20 travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

travis_wait also not necessary anymore, the resolving of the version constraint without --prefer-lowest does not require it anymore

- if [[ $RUN_PHPCS = 1 ]]; then vendor/bin/phpcs --standard=psr2 src/; fi
- if [[ $RUN_PHPUNIT = 1 ]]; then vendor/bin/phpunit; fi
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I decided to run phpunit tests first, i.e. make them more important to fail a build then the phpcs, hope that's good

@mfn mfn mentioned this pull request Jan 1, 2020
tests/TestCase.php Outdated Show resolved Hide resolved
@barryvdh
Copy link
Owner

barryvdh commented Jan 2, 2020

Can't we just always require mockery?

In laravel-cors, I do it like this: https://github.com/fruitcake/laravel-cors/blob/master/.travis.yml
I don't think we need to list all versions explicitly, just the framework and the rest will follow. Possibly Testbench will just follow as well (as you do now)

@mfn
Copy link
Collaborator Author

mfn commented Jan 2, 2020

Can't we just always require mockery?

Yeah, I thought about that too. Probably should be anyway, because we're explicitly using it!

In laravel-cors, I do it like this: https://github.com/fruitcake/laravel-cors/blob/master/.travis.yml
I don't think we need to list all versions explicitly, just the framework and the rest will follow. Possibly Testbench will just follow as well (as you do now)

Roger that, will give it another spin and ping you then!

@mfn
Copy link
Collaborator Author

mfn commented Jan 2, 2020

@barryvdh all addressed, all green!

@barryvdh barryvdh merged commit 015cc6c into barryvdh:master Jan 2, 2020
@mfn mfn deleted the mfn-travis branch January 2, 2020 14:08
@mfn mfn mentioned this pull request Jun 25, 2020
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