Skip to content

Use g1a/composer-test-scenarios to test more php versions. #84

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 5 commits into from
Jun 14, 2018

Conversation

greg-1-anderson
Copy link
Collaborator

I noticed that the tests for this project were failing on php 7.2. phpunit 4 does not like php 7.2, but on the flip side, phpunit 6 does not like any php prior to 7.0. The composer-test-scenarios project was designed specifically for this sort of instance.

You may or may not want to test with all of the permutations in the included matrix, but here they are to prove they work (or to fiddle with them until they work).

@greg-1-anderson
Copy link
Collaborator Author

@webflo
Copy link
Member

webflo commented Jun 9, 2018

Great improvement. Is it possible to gitignore the scenarios folder and create it in Travis CI in the install step?

@greg-1-anderson
Copy link
Collaborator Author

I should probably explain the purpose of the scenarios folder in the documentation. This directory is in essence like your composer.lock file for your different test scenarios. You therefore must commit it to your repository so that your dependencies will be consistent between tests. If you have a scenario that is only ever used with highest or lowest tests, then you can create it with --no-lockfile, and that scenario will not need an entry in the scenarios directory. However, even if you create all scenarios without a lockfile, I still stash a setup script there, because I need it on a fresh project clone so that things work correctly when folks git clone ; composer install a project.

@greg-1-anderson
Copy link
Collaborator Author

When the composer scenarios are complicated (e.g. multiple versions of Symfony), then the composer test scenario scripts provide a lot of convenience. For example, you can run composer scenario symfony2 and then do ad-hoc testing with Symfony 2 dependencies.

In the case of this project, the only scenario we have is phpunit4. It would be easy enough to dispense with composer test scenarios and just adjust the composer.json with several lines of scripts in the travis file, controlled by multiple environment variables in the test matrix. Later today I'll make a second PR to show the alternative for the sake of comparison.

@greg-1-anderson
Copy link
Collaborator Author

The other question is, would it be an improvement to rename the scenarios folder to something else, e.g. .scenarios (hide it from casual observation), scenarios.lock (make it clear that this is like composer.lock) or perhaps even .scenarios.lock (both at once)?

@greg-1-anderson
Copy link
Collaborator Author

CircleCI just transitioned from circle.yml to .circleci/config.yml, so I decided that the hidden .scenarios.lock was probably most appropriate.

@webflo webflo merged commit f94a689 into master Jun 14, 2018
@webflo webflo deleted the composer-test-scenarios branch June 14, 2018 17:45
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