-
Notifications
You must be signed in to change notification settings - Fork 50
Reduced the number of travis builds. #149
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
Conversation
.travis.yml
Outdated
- SYMFONY_VERSION=3.2.* | ||
- SYMFONY_VERSION=3.1.* | ||
- SYMFONY_VERSION=2.8.* | ||
- SYMFONY_VERSION=2.8.* TEST_COMMAND="composer test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would by default not enforce any Symfony version at all. And by the way, 2.8 should be handled fine by the job using the --prefer-lowest
flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to do one by default. Otherwise composer require symfony/symfony:
will fail, right?
I used 2.8 because it is the only LTS we support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well, I would run composer require symfony/symfony
only if $SYMFONY_VERSION
is defined and not empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okey, but that would be the same as setting SYMFONY_VERSION=3.2.*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would maybe also set minimum-stability
in the composer.json
file to dev
so that you would get a build with the latest Symfony development version for free ("normal" builds could use the --prefer-stable
flag).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing against Symfony 3.3 would be nice. We just have to allow it to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nyholm it is not the same than setting SYMFONY_VERSION=3.2.*
:
- it runs tests using the unmodified composer.json, ensuring that your composer.json has the necessary requirement (remove the symfony requirement currently, and you won't see any failure on Travis as it will always re-add one)
- it runs tests against the latest stable version of Symfony, without requiring you to update the version every 6 months.
My own rule for the Travis matrix is this one:
- unmodified composer.json for normal jobs (on different PHP version)
- extra jobs for supported LTS branches of Symfony
- an extra job checking lowest deps (and without changing the Symfony requirement, otherwise this one is not validated)
- an extra job changing the minimum-stability to dev, to ensure compatibility with the upcoming dev version (this one may be allowed to fail depending on your policy)
With such config, I only need to change the build matrix when the list of supported LTS versions is changing (every 2 years)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/Incenteev/IncenteevTranslationCheckerBundle/blob/169c90a9bfc9c7475883521a0edfee30c1c141a0/.travis.yml for an example of such setup (with too much supported PHP versions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the approach @stof recommends.
Thank you for your feedback. I've updated the PR. |
if i understand correctly, we don't test with symfony 3.1 anymore like this. i would consider that useful even if its not an LTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @Nyholm !
@dbu 3.1 would be tested by normal jobs (unmodified vendors), as it is the latest stable version. And this would switch to 3.2 automatically on release (I don't care about testing 3.1 during the 2 months of support overlap after the 3.2 release, as this again involves changing the Travis matrix all the time). |
I think you are mixing versions. 3.2 will be tested in normal jobs since it is the latest stable version. Shouldn't we always test for the lowest and the highest 3.x versions? |
@Nyholm this is what there is a and btw, 3.1 is EOLed. And yeah, in my message above, shift things for different versions in time. |
Yeah, but If we consider 2.8:
So if we test on 2.8 and the latest stable sf version we know we support all versions in between. |
I don't think so, if it works with the latest LTS (2.8), it should work for all 3.x except that we may trigger deprecation notices. Thanks to Symfony BC promise! Testing LTSs, latest stable and dev should be enough (may require something special to handle 3.4 et 4.0 as dev). |
@fbourigault install the |
Yes, but 2.8 without deprecations = 3.0 = 3.1 = 3.2 = 3.3 = 3.4, no? |
@fbourigault without deprecation, yes. But currently, the testsuite does not ensure it |
@Nyholm what about testing against 2.8 without deprecations using symfony/phpunit-bridge? |
IMO, adding the bridge is a must-have (it is included in the example I linked previously btw). Your users expect to be able to run without deprecations, and so will complain if your bundle has some. |
@@ -37,7 +37,7 @@ | |||
"php-http/guzzle6-adapter": "^1.1.1", | |||
"php-http/react-adapter": "^0.2.1", | |||
"php-http/buzz-adapter": "^0.3", | |||
"symfony/symfony": "^2.8 || ^3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to travis-ci, we have either a hard dependency on TwigBundle or its at least optional and needed for testing. if its optional we should add it to the (not yet existing) suggest
section along with an explanation what its needed for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Twig is required for the profiler. I think we should depends on the WebProfilerBundle, but I think this will not be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WebProfilerBundle
only depends on the twig-bridge. But it really require the twig service (https://github.com/symfony/web-profiler-bundle/blob/master/Resources/config/profiler.xml#L11).
We probably could suggest WebProfilerBundle and TwigBundle both for using the profiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, WebProfilerBundle does not introduce a hard requirement on TwigBundle to make it usable in Silex. But using it in the fullstack context actually needs TwigBundle too (as it is the one configuring Twig). There is an issue about that on Symfony
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds fair to me to suggest both packages and adding them to require-dev. Looks better than depending on symfony/symfony.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, much better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I've required symfony/twig-bundle, symfony/twig-bridge and symfony/web-profiler-bundle
@@ -77,8 +75,8 @@ public function onEvent(Event $e) | |||
public static function getSubscribedEvents() | |||
{ | |||
return [ | |||
KernelEvents::REQUEST => ['onEvent', 1024], | |||
ConsoleEvents::COMMAND => ['onEvent', 1024], | |||
'kernel.request' => ['onEvent', 1024], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use strings over class constants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I want to avoid dependency on Symfony/console and Symfony/http-kernel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice :) An other question, you marked tests with @legacy annotation. I guess it's to avoid test failure because of deprecated functions. Can those deprecations be fixed in the code to be ready for Symfony 4.0?
env: SYMFONY_VERSION=2.8.* | ||
|
||
before_install: | ||
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should change this to require only useful bundles instead of the whole symfony?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too hard to maintain (has to be edited each time the composer.json changes).
the normal jobs already take care of using the normal deps with only relevant packages. These jobs are about testing the LTS support.
@@ -77,8 +75,8 @@ public function onEvent(Event $e) | |||
public static function getSubscribedEvents() | |||
{ | |||
return [ | |||
KernelEvents::REQUEST => ['onEvent', 1024], | |||
ConsoleEvents::COMMAND => ['onEvent', 1024], | |||
'kernel.request' => ['onEvent', 1024], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@fbourigault the legacy tests are not about Symfony 4 deprecations (if some of them are, they should not be legacy tests) but about deprecations of the bundle itself (to keep covering the BC layers with tests) |
Thank you for all the comments and feedback. |
From @xabbuh #148 (comment):