Problem/Motivation
Eventually, DrupalCI will give us a way to tie different build processes to different needs, using the idea of 'triggers.'
One such build trigger will likely be a dependency min/max test. This could be run all the time, or it could be run once a week, or what-have-you.
This issue discusses how to address a dependency min/max test.
Currently, since we don't have that build trigger available, we'll have to discuss how to implement this type of test by running the testbot in this issue.
Proposed resolution
Use a drupalci.yml to perform these steps:
- composer update --prefer-lowest
- composer run-script drupal-phpunit-upgrade
- run-tests.sh
- composer update
- run-tests.sh
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #68 | 2976407-68.patch | 6.9 KB | mondrake |
Comments
Comment #2
mile23I discovered that once we run
composer update --prefer-lowest, we then have to runcomposer run-script drupal-phpunit-upgrade. And since that script only updates phpunit/phpunit, it disallows re-updating to PHPUnit 6+. Therefore we have to explicitly update phpspec/prophecy as well.Comment #3
mile23I suppose it belongs in core/ doesn't it?
Comment #5
mile23Misnamed composer.max. I guess we need to work on this: #2956525: Warn users that their build tasks have clashing names
Comment #7
mile23Click through to the test results and you see a ton of deprecation errors: https://www.drupal.org/pift-ci-job/977869
You can click through to the artifacts to see more details: https://dispatcher.drupalci.org/job/drupal_patches/59892/artifact/jenkin...
For instance, in the run_tests.min folder, there is a run_testsoutput.txt file which shows you the fails resulting from installing the dependencies with --prefer-minimum.
There's also a phpunit-xml folder which contains all the detailed junit reports for each test run.
Comment #8
mile23Added deprecation notices to the deprecation listener whitelist. They're the same as existing ones, except replacing 'Symfony' with 'version', and no period at the end. ::shrug::
This should give us an indication of what's actually 'broken,' as opposed to what's deprecated.
Comment #10
mile23Reverted the deprecation whitelist and just set it to suppress deprecations.
What can we learn from this?
1) Symfony changed their deprecation notices from saying 'since version x' to 'since Symfony x'. This change occurs in Symfony 3.4.3. https://github.com/symfony/symfony/commit/74383b6e5982fce66119b8e8a0e0a4...
This breaks a few of our tests, which have
@expectedDeprecationsagainst the newer messages.We should change our minimum from
"symfony/http-foundation": "~3.4.0",to ~3.4.3. This is probably a de-facto change to all the Symfony components, as well.2) When we perform the upgrade we sometimes break
ComposerIntegrationTest:That test exists to make sure there's no dependency in composer.lock that requires a PHP version higher than 5.5. When this test says
composer updateas part of this test, it re-writes the lock file for the current version of PHP.So either we have to remove this test or we have to figure out a way to signal it to skip. We could set an environmental variable like
DRUPAL_MIN_MAX_TEST=1and then have the test skip on this value.3) It might be that kernel tests break
--suppress-deprecations.4) Add your discovery... More to come no doubt. :-)
Comment #12
mile23Followed the advice from #10.1. That Symfony change in https://github.com/symfony/symfony/commit/74383b6e5982fce66119b8e8a0e0a4... touches all our declared dependencies except one, so I just changed them all to ~3.4.3.
Also marked
ComposerIntegrationTest::testMinPHPVersion()as skipped for the purposes of learning more stuff. Note that it also has this todo:That's basically the testbot issue that corresponds to this issue.
Comment #14
mile23Making the dependencies of #2976417: Update symfony (security release) and #2965887: Require egulias/email-validator >= 1.2.14 explicit here, and also a few others that are now in line with composer.lock which seems to make things happy locally. Let's see what the testbot does.
Comment #15
mile23Based on #14, it turns out that if we want guzzlehttp/guzzle to work under PHP 7.2, we have to specify ^6.3. That's fine because it's what's in the current lock file, and only requires PHP 5.5.
So now that we've got passing tests for unit and kernel tests, let's add back functional and simpletest. This will make the test runs much longer but hopefully will give us some more nice fails to look at. :-)
Comment #17
mile23I can't repro the errors in #15 because some errors cause redirects to be sent to the wrong port within functional tests. I'm using MAMP which uses port 8888, and when guzzle gets a redirect from mink, it's to port 80.
However, I found a ton of tests which use
t(), and many of the test fail errors you'll see in that report look like this:I'm unable to determine which subsystem allows us to say things like
$this->assertRaw(t('something'));based on versions in composer.lock, but not the min/max.So here we sit. :-)
Comment #18
Anonymous (not verified) commentedYep, fail for PHP 7.2 in #14 should solve fix https://github.com/guzzle/guzzle/pull/1686 (which is available since 6.3.0 only).
I guess, #15 fails related to #2948700: Casting $text value to string in responseContains/responseNotContains methods.
Comment #19
mile23Comment made in error. Disregard. :-)
Comment #20
mile23Thanks, @vaplas.
Pinned behat/mink to
"behat/mink": "1.7.x-dev#9ea1cebe3dc529ba3861d87c818f045362c40484"to lock in #2808085: Pipe char in locators break Mink and Symfony element search That's the commit that's in composer.lock, and you can see what it does here: https://github.com/minkphp/Mink/pull/720/commitsThis has (or should have) the side-effect of mitigating #2948700: Casting $text value to string in responseContains/responseNotContains methods. If we end up committing the constraints here, we should be sure and modify core/composer.json in that other issue to move away from requiring specific commits. Todo here would be to figure out which mink releases perform the casting we need and use that as an upper version constraint.
Comment #21
Anonymous (not verified) commentedThe regression happened with https://github.com/minkphp/Mink/pull/743 (https://github.com/minkphp/Mink/commit/803db2c14216f55f6085cca45b69d01b5...)
Previous commit: https://github.com/minkphp/Mink/commit/f0df6b8c8d7e42f13e8eaaca543fa3fab... (https://github.com/minkphp/Mink/pull/755)
Comment #24
andypostComment #25
mile23Reroll.
Comment #26
mile23Missed that one...
Comment #28
mile23Fixed #26 which it turns out is left over from https://www.drupal.org/SA-CORE-2018-005, so yah. We want that.
Comment #29
mile23If you check the CI console log for the last couple of patches, you see that the max update does this:
That is, updates to doctrine/common 2.10. That accounts for about 90% of the fails, because: #2986725: doctrine common 2.9 has moved reflection
I re-opened that issue and added a patch.
Comment #32
mile23Rerolled after #2986725: doctrine common 2.9 has moved reflection
Comment #34
mile23behat/mink has had a release since #20, so it's at 1.7.1.
It turns out that's not the only culprit for #20, because we also have to give a boost to symfony/browser-kit to ^3. I included it here because I can see it in my stack trace, but we get the same effect if we boost symfony/dom-crawler the same way. Maintainers might have an opinion about that one way or another.
This patch reverts to 8.7.x's lock file, so the interdiff is weird.
Comment #36
mondrake#2986725: doctrine common 2.9 has moved reflection has been reverted. Here adding a script entry to clear APC cache to see if with Composer updating to doctrine/common 2.10 we fix the issues identified in #28. Starting from patch in #32.
Comment #37
mondrakeComment #39
mondrakeHm it looks like you cannot clear APC opcode cache from CLI, http://php.net/manual/en/function.apc-clear-cache.php#109667 ; rather a reload of the web server is necessary https://ma.ttias.be/clear-apc-cache-php/. I do not know enough about the DrupalCI internals to say if that is possible.
Comment #40
mondrakeSince it's only functional tests that are failing, it looks like it's the PHP environment embedded in the httpd service that fails to update.
Here's a patch to test on highest dependencies only (i.e. without updating to lowest first), to see what fails in the scenario of Drupal installing on latest. I do not mean to hijack #32, that one remains the one patch to build on.
Comment #42
mondrakeThe page cache test fails in #40 are being addressed @ #3021236: Page cache test fails with Symfony 3.4.19 and above.
Comment #43
mondrakeFollowing the stream of thought in #40, this is #32 with the
run_tests.maxlimited to Unit and Kernel tests. If results are reasonable, then we should figure out a way to clean APC opcode caches between the min and the max test runs, only for the PHP environment embedded in the httpd daemon.Comment #45
mile23Here's an informative issue: #2551309: Increase opcache.max_accelerated_files and an old issue from drupalci_environments: #2446719: Need test runners without bytecode caching
And a patch with an opcode cache clearing script. It might not be something we should actually add to core, though maybe we should.
Adding back functional tests to the max portion of the build as well.
Comment #47
mile23PEBKAC.
Comment #49
mile23Opcache clearing ripped off from rebuild.php this time.
Comment #51
mile23More PEBKAC.
Comment #53
mondrakeI think the problems with #47 and #51 are that they are resetting the caches on CLI. But CLI seems OK, and rather it's the PHP accessed from the apache2 service that still has the old file locations cached.
I tried adding
to the
drupalci.ymlfile just before therun-tests.maxsection, to follow the suggestion in https://ma.ttias.be/clear-apc-cache-php/ (see #3015974-22: Ignore, testing issue), but that did not work either, same results. Also tried the service restart, but that actually fails.Comment #54
mondrakeThis may do the trick. It's very rough, but it's to give the gist. Instead of running the php script from CLI, we open a curl session to the test web server and trigger execution there via an HTTP GET.
Comment #56
mondrakeSomething is dramatically increasing test run times with highest dependencies under php 7.2 - that is not the case with php 5.5 where hi and lo test run times are more or less the same.
Comment #57
mondrake#40 now pass after commit of #3021236: Page cache test fails with Symfony 3.4.19 and above.
Comment #58
mondrakeRerolled, skipping composer integration test is no longer necessary as it has been removed in #3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead).
Comment #60
mondrakeShouldn't priority be bumped up here, especially in light of #2976394: Allow Symfony 4.4 to be installed in Drupal 8? This sounds like a must have if in the future we allow both Symfony 3 and 4 in composer.json.
Comment #61
effulgentsia commentedI agree that this issue is at least Major.
I also don't think that we should commit #3020303: Consider using Symfony flex to allow switching between major Symfony versions without resolving this issue first, so if that issue stays Critical, then this one might need to be bumped to Critical too, but I asked on that issue if it should stay Critical.
Comment #62
mile23In terms of prioritizing, there's also this issue on the testbot: #2951375: Allow for build targets
The idea there was that you could set up your drupalci.yml so it would do, for instance, a 'release' target versus an 'issue' target and so forth, with different DrupalCI builds.
We might care about min/max for some circumstances but not for others.
Otherwise, if we add the build steps from this issue to drupalci.yml, then it will happen for all builds in all circumstances. That's only an undesirable outcome from the perspective of run time.
The work in this issue is based on some Travis-CI based tests, mainly https://github.com/paul-m/drupal_dependency_bounds_test but also some
dependency tweaks gleaned from https://github.com/paul-m/drupal_component_tester
Comment #64
catchBumping to critical, this is going to be important for when Drupal 9 opens up.
Comment #65
mile23This will probably be one of the use cases for #3031379: Add a new test type to do real update testing
Comment #66
jibranI totally disagree with #65. This can be achived very easily via CI IMO.
Comment #67
mile23OK, so the blocker here is that #58 needs a way to clear the opcache so that it uses the upgraded/downgraded PHP.
#3031379: Add a new test type to do real update testing makes a new PHP-based HTTP server for every test class specifically because this blocker exists in this issue.
If there is a testbot-level change someone wants to suggest, we can do that, too.
Comment #68
mondrakeReroll, incorporating learnings from #3044175: [DO NOT COMMIT] Vendor minimum testing issue. Sorry no interdiff.
Comment #69
ghost of drupal pastPlease make sure this reset script is protected from malicious access.
Comment #70
mondrake#69 agree, this can't be a final solution - see #54. We need to find a suitable solution to clear the opcache, as @Mile23 pointed out.
Comment #72
MixologicThis was originally opened to as a POC that we can do min/max testing with drupalci.yml when we first introduced that functionality.
However, #62 / #2951375: Allow for build targets is the only path forward that we can support on drupalci. Im tempted to Closed (won't fix) this, because, from the issue summary:
Drupalci will not run min/max tests on a permanent basis using drupalci.yml in the same test. If something like this gets committed I will have to alter drupalci to ignore those directives because we cannot afford to to double our testing times. Min/max testing is something that happens out of band, and does not require tests on every patch or commit.
Comment #73
mondrake#72 yeah, "won't fix" is the final fate of this issue; likewise, #3044155: PHP7.1 vendor max Testing issue - DO NOT COMMIT and #3044175: [DO NOT COMMIT] Vendor minimum testing issue.
Before that, I think the 2 fails in #68 deserve some attention. With both #3044155: PHP7.1 vendor max Testing issue - DO NOT COMMIT and #3044175: [DO NOT COMMIT] Vendor minimum testing issue being green now, I would have expected the patch in #68 to pass, since it replicates the same
composer.jsonconstraints. The failures are for the same test in both hi/lo configurations, which sounds to me an issue related with the sequence/concurrency of the test run, not with the dependencies (the test fail on a before/after count of the number of tables).Comment #74
mondrakeComment #76
catchDowngrading since there's not anything actionable in this issue.
Comment #77
mondrakeLet’s close wont fix this, actually. See #72.