Problem/Motivation
Opening this as critical because:
- it's blocking other criticals
- every critical issue that deals with it has commit conflicts with each other
- false positives in the upgrade path tests.
The current database dump for updates was taken from pre-beta 12, and now has some modifications to make it suitable for tests that have been added.
We have false-passes in update tests because the database dump has no nodes/taxonomy terms etc.
Additionally issues like #2540416: Move update.php back to a front controller are getting blocked on inconsistent data in the database dump.
Proposed resolution
Since we know that the update path from beta 12 either works, or doesn't work in a way that is documented in existing critical issues, we should target that for the database dump, and ensure there's some data to actually get upgraded - at least nodes, users, taxonomy terms, comments, forums, contact forms, custom block, blocks with visibility conditions.
Remaining tasks
Review patch.
Steps taken for bare dump:
- Installed beta12 with standard profile and site name "Site-Install"
- Created a dump with core/scripts/dump-database-d8-mysql.php | gzip > core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz
Steps taken for filled dump:
- Installed beta12 with standard profile
- Enabled all modules
- Enabled the Stark theme
- Added a language (Spanish)
- Added a test date format
- Checked all boxes in admin/config/regional/language/detection
- Translated ‘Site name’ in admin/config/system/site-information/translate/es/edit
- Translated the ’Content’ view at admin/structure/views/view/content/translate/es/edit
- Translated an interface string ("Full comment") at admin/config/regional/translate
- Added a test image style at admin/config/media/image-styles/manage/test_image_style
- Added a test responsive image style at admin/config/media/responsive-image-style/test
- Added a shortcut at admin/config/user-interface/shortcut
- Added a test action at admin/config/system/actions
- Added a test feed at aggregator/sources/1/configure
- Added a field at /admin/config/services/aggregator/fields
- Added a test text format at admin/config/content/formats/manage/test_text_format
- Added a banned IP at admin/config/people/ban
- Added a comment type at admin/structure/comment
- Added a form mode at admin/structure/display-modes/form
- Added a view mode at admin/structure/display-modes/view
- Enabled translation for users at admin/config/people/accounts
- Added a new user at user/3, translated at es/user/3
- Added a test field at admin/config/people/accounts/fields
- Added a new translatable content type at admin/structure/types/manage/test_content_type
- Added new fields at admin/structure/types/manage/test_content_type/fields
- Added a vocabulary at admin/structure/taxonomy/manage/test_vocabulary/overview, including terms and translated terms.
- Added a menu at/admin/structure/menu/manage/test-menu, including a menu link and a translation
- Added a view at admin/structure/views/view/test_view
- Added a forum at admin/structure/forum
- Create a new article, with several revisions and a menu link
- Added a comment at node/8
- Added a new forum topic at node/3
- Added a book page at node/2
- Added a new node for the custom test content type at node/8 including an image and a file
- Added a translation at es/node/8
- Added a contact form at /admin/structure/contact, including a translation
- Added a block with visibility conditions at admin/structure/block, including a translation
- Set site name to "Site-Install"
- Created a dump with core/scripts/dump-database-d8-mysql.php | gzip > core/modules/system/tests/fixtures/update/drupal-8.filled.standard.php.gz
User interface changes
N/A
API changes
N/A
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 2551341-23.patch | 812.95 KB | stefan.r |
| #21 | drupal-8.bare_.standard.php_.gz | 110.15 KB | stefan.r |
| #21 | drupal-8.filled.standard.php_.gz | 549.79 KB | stefan.r |
| #19 | 2551341-18.patch | 779.48 KB | stefan.r |
| #15 | 2551341-15.patch | 662.86 KB | stefan.r |
Comments
Comment #2
catchComment #3
alexpottComment #4
catchComment #5
webchickNice. This is something that lots of people could do.
Comment #6
cilefen commentedI just spent a few minutes searching but I cannot find where this dump lives in the repo.
Comment #7
jibranIt is at
core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gzComment #8
mpdonadioIt's core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz
@see \Drupal\system\Tests\Update\UpdatePathTestBase() and the tests that extend it.
Comment #9
jhedstromAdding details on the dump script to the IS. We might want to rename the
baretofilledonce there is content.Comment #10
jibranAs per our discussion in critical issues meeting we are keeping the bare as well.
Comment #11
cilefen commentedComment #12
dawehnerSo I think we need two steps:
a) Update the bare one to beta 12
b) Create a new one based upon beta 12 with content.
Comment #13
jhedstromThe content based dump could be put on top of the bare dump if #2544972: Add options to limit tables, exclude data, or only export data to DbDumpCommand were used (people generating the beta12 dumps would need to manually apply that patch).
Comment #14
jhedstromComment #15
stefan.r commentedHere's a beta12 dump with some content
Comment #16
stefan.r commentedWill post a patch with both bare and filled in a bit...
Comment #18
dawehnerDo you mind describing in the IS what is part of the dump? Did you enabled all the modules, did you configured a multilingual site, did you configured some real views etc.
Comment #19
stefan.r commentedJust for the record, the test failures said
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gzMaybe I forgot to do
--binarywhen doing a git diff?Here's another try with both bare and filled, with current tests updated to use both dumps.
Comment #20
stefan.r commentedComment #21
stefan.r commentedAnd the actual raw dumps, in case there is a problem with the patch again
Comment #23
stefan.r commentedUpdated the dumps to have the site name "Site-Install" as expected by the tests.
Comment #24
stefan.r commentedComment #25
dawehnerThis looks like a quite decent list. Should we have some test code which ensures that these things continue to sort of work?
Comment #26
stefan.r commentedYes that could be nice, would it be in scope for this issue?
Comment #27
dawehnerWell, in order to know that our update path actually works we need them, so this would feel critical as well. But sure, we could do that in another issue.
Comment #28
alexpottI think it is in scope to have some tests of the content/config in UpdatePathTestBaseTest in the issue.
Comment #29
gábor hojtsyTests as in? That when you import the dump, the entity storage / config storage has them?
Comment #30
catchI think it'd be functional tests after the upgrade has run that the entities are accessible and have the right content etc.
For me personally, I think we could open another issue (major or critical) to add the explicit test coverage, but the implicit coverage this adds might mean other patches start failing where they'd otherwise pass, which would be worthwhile in itself.
Comment #31
gábor hojtsyOpened #2554151: Test content/configuration in update database dump for more explicit tests as a major. I agree this in itself will start discovering errors :)
Comment #32
dawehnerWell I see the point, the tests can be itself a major issue for itself.
Comment #33
plachIt would be nice to see this in ASAP, so we can have more maeningful test coverage in #2542748: Automatic entity updates can fail when there is existing content, leaving the site's schema in an unpredictable state.
Comment #34
catchAssigning to Alex to see what he thinks per #28.
Comment #35
alexpottLet's get this in since it help other issues. But I think the testing follow up should be critical because we've not proven anything without the tests. Committed b728936 and pushed to 8.0.x. Thanks!
Comment #37
catchCrossposted...
Put a note on #2554151: Test content/configuration in update database dump but to document @alexpott's concern from irc here. If we add the dump with no test coverage, then there's nothing guaranteeing that it actually catches the cases it should. For me #2554151: Test content/configuration in update database dump moving to critical would be plenty for that, but #33 shows why this going in as is could be a useful interim state.
Comment #38
gábor hojtsySo.... turns out none of the tests we committed here actually test what they think they test because we use this pattern:
But then, the parents reset the file list entirely:
So basically the filled dump is never tested. Fun stuff! All the tests we added here need fixing. Let's get that into #2554151: Test content/configuration in update database dump. BTW @csg found this because he used a different pattern to set the dumpfile and it found a PHP syntax error in the dump :)
Comment #39
gábor hojtsyBTW also ENTIRELY validates those tests being critical, haha.
Comment #40
gábor hojtsyBTW also ENTIRELY validates those tests being critical, haha.