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

Comments

Mile23 created an issue. See original summary.

mile23’s picture

Status: Active » Needs review
StatusFileSize
new3.13 KB

I discovered that once we run composer update --prefer-lowest, we then have to run composer 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.

mile23’s picture

StatusFileSize
new5.13 KB

I suppose it belongs in core/ doesn't it?

Status: Needs review » Needs work

The last submitted patch, 3: 2976407_3.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new5.13 KB
new443 bytes

Misnamed composer.max. I guess we need to work on this: #2956525: Warn users that their build tasks have clashing names

Status: Needs review » Needs work

The last submitted patch, 5: 2976407_5.patch, failed testing. View results

mile23’s picture

Click 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.

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new8.08 KB
new2.95 KB

Added 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.

Status: Needs review » Needs work

The last submitted patch, 8: 2976407_8.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new4.77 KB
new3.54 KB

Reverted 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 @expectedDeprecations against 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:

1) Drupal\Tests\ComposerIntegrationTest::testMinPHPVersion
doctrine/cache has a PHP dependency requirement of "~7.1"

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 update as 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=1 and 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. :-)

Status: Needs review » Needs work

The last submitted patch, 10: 2976407_10.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new6.74 KB
new1.97 KB

Followed 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:

   * @todo This can be removed when DrupalCI supports dependency regression
   *   testing in https://www.drupal.org/node/2874198

That's basically the testbot issue that corresponds to this issue.

Status: Needs review » Needs work

The last submitted patch, 12: 2976407_12.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new7.36 KB
new1.88 KB

Making 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.

mile23’s picture

StatusFileSize
new9.19 KB
new3.02 KB

Based 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. :-)

Status: Needs review » Needs work

The last submitted patch, 15: 2976407_15.patch, failed testing. View results

mile23’s picture

I 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:

1) Drupal\Tests\action\Functional\ConfigurationTest::testActionConfiguration
Object of class Drupal\Core\StringTranslation\TranslatableMarkup could not be converted to int

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. :-)

Anonymous’s picture

Yep, 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.

mile23’s picture

Comment made in error. Disregard. :-)

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new10.16 KB
new1.22 KB

Thanks, @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/commits

This 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.

Status: Needs review » Needs work

The last submitted patch, 20: 2976407_20.patch, failed testing. View results

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

Issue tags: +Needs reroll
mile23’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new6.44 KB

Reroll.

mile23’s picture

+++ b/core/composer.json
@@ -18,26 +18,26 @@
-        "symfony/http-foundation": "~3.4.14",
...
+        "symfony/http-foundation": "~3.4.11",

Missed that one...

Status: Needs review » Needs work

The last submitted patch, 25: 2976407_25.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new10.71 KB
new6.36 KB

Fixed #26 which it turns out is left over from https://www.drupal.org/SA-CORE-2018-005, so yah. We want that.

mile23’s picture

StatusFileSize
new10.75 KB
new465 bytes

If you check the CI console log for the last couple of patches, you see that the max update does this:

18:44:05   - Updating doctrine/common (v2.5.0 => v2.10.0): Downloading (100%)

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.

The last submitted patch, 28: 2976407_28.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 29: 2976407_29.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new10.72 KB

Status: Needs review » Needs work

The last submitted patch, 32: 2976407_32.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new5.85 KB
new5.87 KB

behat/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.

Status: Needs review » Needs work

The last submitted patch, 34: 2976407_34.patch, failed testing. View results

mondrake’s picture

StatusFileSize
new1.93 KB
new12.51 KB

#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.

mondrake’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 36: 2976407_36.patch, failed testing. View results

mondrake’s picture

Hm 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.

mondrake’s picture

Status: Needs work » Needs review
StatusFileSize
new3.07 KB

Since 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.

Status: Needs review » Needs work

The last submitted patch, 40: 2976407_40.patch, failed testing. View results

mondrake’s picture

mondrake’s picture

Status: Needs work » Needs review
StatusFileSize
new10.76 KB
new531 bytes

Following the stream of thought in #40, this is #32 with the run_tests.max limited 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.

Status: Needs review » Needs work

The last submitted patch, 43: 2976407_43.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new12.06 KB
new2.04 KB

Here'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.

Status: Needs review » Needs work

The last submitted patch, 45: 2976407_45.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new12.05 KB
new538 bytes

PEBKAC.

Status: Needs review » Needs work

The last submitted patch, 47: 2976407_46.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new7.25 KB
new7.93 KB

Opcache clearing ripped off from rebuild.php this time.

Status: Needs review » Needs work

The last submitted patch, 49: 2976407_49.patch, failed testing. View results

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new7.25 KB
new478 bytes

More PEBKAC.

Status: Needs review » Needs work

The last submitted patch, 51: 2976407_51.patch, failed testing. View results

mondrake’s picture

I 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

      container_command:
        commands:
          - sudo -u www-data service apache2 reload

to the drupalci.yml file just before the run-tests.max section, 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.

mondrake’s picture

Status: Needs work » Needs review
StatusFileSize
new2.46 KB
new6.78 KB

This 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.

Status: Needs review » Needs work

The last submitted patch, 54: 2976407_54.patch, failed testing. View results

mondrake’s picture

Something 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.

mondrake’s picture

mondrake’s picture

Status: Needs work » Needs review
Related issues: +#3020301: Remove composer integration PHP version test (rely on DrupalCI PHP version runs instead)
StatusFileSize
new6.11 KB

Rerolled, 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).

Status: Needs review » Needs work

The last submitted patch, 58: 2976407_58.patch, failed testing. View results

mondrake’s picture

Shouldn'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.

effulgentsia’s picture

Priority: Normal » Major

I 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.

mile23’s picture

In 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

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

catch’s picture

Priority: Major » Critical
Issue tags: +Drupal 9

Bumping to critical, this is going to be important for when Drupal 9 opens up.

mile23’s picture

This will probably be one of the use cases for #3031379: Add a new test type to do real update testing

jibran’s picture

I totally disagree with #65. This can be achived very easily via CI IMO.

mile23’s picture

OK, 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.

mondrake’s picture

Status: Needs work » Needs review
Related issues: +#3044175: [DO NOT COMMIT] Vendor minimum testing issue
StatusFileSize
new6.9 KB

Reroll, incorporating learnings from #3044175: [DO NOT COMMIT] Vendor minimum testing issue. Sorry no interdiff.

ghost of drupal past’s picture

Please make sure this reset script is protected from malicious access.

mondrake’s picture

#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.

Status: Needs review » Needs work

The last submitted patch, 68: 2976407-68.patch, failed testing. View results

Mixologic’s picture

Status: Needs work » Postponed

This 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:

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.

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.

mondrake’s picture

#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.json constraints. 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).

mondrake’s picture

Title: Use drupalci.yml for composer dependency min/max testing » Use drupalci.yml for composer dependency min/max testing - DO NOT COMMIT

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

catch’s picture

Priority: Critical » Normal

Downgrading since there's not anything actionable in this issue.

mondrake’s picture

Status: Needs review » Closed (won't fix)

Let’s close wont fix this, actually. See #72.