Problem/Motivation
#3173180: Add UI for 'loading' html attribute to images discovered an issue with the 9.3.0 database dumps.
#3145563: Route serialization incompatibilities between PHP 7.4 and 7.3 (9.x only) means that a database dumped from PHP >= 7.4 can't be loaded into a site running PHP 7.3, and the dumps were created on PHP 8, this broke tests on PHP 7.3 when we actually used them.
Steps to reproduce
Switch any 9.4.x test to use the 9.3.0 database dumps.
Proposed resolution
Recreate the dumps using PHP 7.3. Only do this for 9.4.x, since we don't want PHP 7.3 to be a development dependency for the entirety of Drupal 10.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 3275093-test-only.patch | 711 bytes | catch |
Issue fork drupal-3275093
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
catchComment #3
catchComment #4
larowlanComment #6
larowlanSteps taken for each of 'filled' and 'bare'
php ./app/core/scripts/db-tools.php import core/modules/system/tests/fixtures/update/drupal-9.3.0.{type}.standard.php.gzphp ./app/core/scripts/db-tools.php dump-database-d8-mysql |gzip > core/modules/system/tests/fixtures/update/drupal-9.3.0.{type}.standard.php.gzComment #7
larowlanComment #8
bbralaHmm, was hoping to review this, but not sure how :stuck_out_tongue: Comparing 9.4.x fixtures to the fixture in your MR results in only a small comment change. Which kinda confuses me, how can this be fixed by no real changes but generating a new gz file. Is the GZ format changed? That would be REALLY weird?
If that is the only diff in the fixture files, i really dont understand how that would fix the problem.
Comment #9
catchThere could potentially be a missing router rebuild step in #6, the problem we're hitting is that the router is serialized differently in PHP 7.3 vs. PHP >=7.4. So we need a PHP 7.3 version of the router table to then export.
Comment #10
larowlanIn that case wouldn't it fail on PHP 7.3?
Comment #11
catchWe're not running any tests against those fixtures in 9.x yet - they're used in 10.0.x for all the upgrade path tests, but those tests don't run on PHP 7.3, and all our 9.x upgrade path test coverage uses the 8.8 dumps (which would have been dumped on PHP 7.3 probably).
Reverting https://git.drupalcode.org/project/drupal/-/merge_requests/1287/diffs?co... is a good test-only patch.
Comment #12
larowlanHmm nevermind, I thought head was failing here
Comment #13
larowlanI'll redo this tomorrow unless someone else beats me to it
Comment #14
catchHere's a test-only patch (the revert of the above hotfix). I think we could even leave this in the final version of the commit. Not sure we need a dedicated 'test the update test database dumps test'.
This should fail on PHP 7.3, but pass on PHP 7.4 and 8.0 per the original issue that broke HEAD.
Then assuming we've diagnosed the issue right, it should pass on PHP 7.3 with the new dumps, as long as the router table has routes serialized via PHP 7.3.
Comment #15
catchbtw if anyone recreates the dumps, also need to account for #3261629: Database dumps are no longer driver-agnostic which was not fixed in 9.3.0 (so need to dump from a later-than-9.3.0 version of the script).
Comment #17
catchPHP 7.3 test run failed as expected, the 8.1 fail is an unrelated random.
Comment #18
larowlanSteps taken this time for each of 'filled' and 'bare'
php ./app/core/scripts/db-tools.php import core/modules/system/tests/fixtures/update/drupal-9.3.0.{type}.standard.php.gzdrush phpand then\Drupal::service('router.builder')->rebuild();php ./app/core/scripts/db-tools.php dump-database-d8-mysql |gzip > core/modules/system/tests/fixtures/update/drupal-9.3.0.{type}.standard.php.gzgit show 9.4.x:core/modules/system/tests/fixtures/update/drupal-9.3.0.{type}.standard.php.gz|gunzip > core/modules/system/tests/fixtures/update/drupal-9.3.0.{type}.standard.php.origcat core/modules/system/tests/fixtures/update/drupal-9.3.0.{type}.standard.php.gz|gunzip > core/modules/system/tests/fixtures/update/drupal-9.3.0.{type}.standard.php.newComment #19
larowlanComment #20
dwwI did the following:
There are now a ton of changes, so that's progress relative to #8. 😉
Other than this:
most of the changes look like this:
Looks like a different format for serializing these routes, which seems legit. I dunno off the top of my head exactly what changed in PHP between 7.3 and PHP 8 for this, but this seems plausible.
The same is true of the diff for
drupal-9.3.0.filled.standard.php(except it's 5382 lines of diff, vs. 3258 for the bare fixture).I was sad to see that the 7.3 test run against the MR failed, but those were all layout_builder random fails. So I just requeued. Of crucial interest,
core/modules/image/tests/src/Functional/ImageLazyLoadUpdateTest.phpdid not fail. Assuming the re-test comes back green, I think this is RTBC. Not sure how else to verify / review / test this.Thanks!
-Derek
Comment #21
bbralaFrom what I understood this is pretty much what to expect. But testing it manually is a bit complicated. We can probably trust the tests in this way.
Comment #22
dwwJust added myself an email notification when the test run completes. If it's green, I'll mark this RTBC. 🤞
Crediting both of us for reviews. 😉
Comment #23
dwwAll green. RTBC! 🎉
Comment #24
bbrala;) woop woop
Comment #27
catchCrediting @heddn who between us diagnosed the issue in the original update that uncovered it. The test-only hunk I uploaded was just the original part of the original issue that got reverted, not my patch so I'm OK to commit this one.
Committed 3aa89b9 and pushed to 9.4.x. Thanks!
When I originally opened this issue I thought we should make the same change to the 10.0.x dumps too, but we absolutely should not introduce a PHP 7.3 development dependency for Drupal 10, nor should we make generating these database dumps any more complicated than it already is. With a bit of luck, this will be the last time we change the 9.3 database dumps in Drupal 9.4.