Problem/Motivation
Blocks both #3084814: Deprecate Seven theme and #3249109: Deprecate Bartik. A lot of tests reference both themes, so we should handle them together.
This issue represents a first pass and updates tests in:
- block
- config
- image
- node
- system
- tour
- user
- views
However, there are many additional tests with bartik and seven references. Since these tests don't typically have dependencies between each other, but may individually be more complex, let's treat them all as followup issues so multiple contributors can work on them.
Steps to reproduce
Proposed resolution
Remaining tasks
Done. I think we need a follow-up to add a 'test_admin_theme' and 'test_frontend_theme' so that we can decouple these tests from specific core themes altogether. #3280049: Create a test admin and front end theme.
We'll also need a separate 10.x-only patch that rebuilds the 9.3.0 database dumps to include olivero and claro.
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#29 | core-3278124-29.10.x.patch | 30.8 KB | nod_ |
| |||
#29 | core-3278124-29.9.5.x.patch | 30.79 KB | nod_ |
#24 | core-3278124-24.10.x.patch | 34.43 KB | nod_ |
#20 | interdiff_3278124_8-20.txt | 1.57 KB | andregp |
#20 | 3278124-20.patch | 34.43 KB | andregp |
Comments
Comment #2
catchIncomplete patch, nothing clever in here, but hopefully the tests pass with the theme changes.
Comment #3
catchComment #6
catchWhen I opened this issue I was thinking we should just switch the hard-coding of Bartik/Seven to Olivero/Claro and then open follow-ups to switch to test themes. However, looking at some of the test failures here (like copying blocks to a new default theme), it might be easier to switch to using a test theme in this issue instead - if we need to change test assumptions we might as well do it once instead of twice.
This ought to fix the router test.
Comment #7
andregp CreditAttribution: andregp at CI&T commentedI tried to reduce the number of test errors but wasn't able to fix NewDefaultThemeBlocksTest.php
Doing some debug I discovered that, by default on this test, the
$default_block_names
and$new_blocks
(lines 61 and 64 respectively) store values like:But after changing the
$new_theme
(line 48) to 'olivero' we then get:What is weird to me is that the random characters at the end of the block names inside
$default_block_names
are only generated for the default (bartik) theme (lines 34-45) and are somehow passed to the stark block names which makes me suspect that the theme installation (in line 52) behaves differently on bartik and olivero.Comment #8
quietone CreditAttribution: quietone at PreviousNext commentedDid some debugging to find out what is causing the behavior explained in the last paragraph of #7.
During theme installation, the ThemeInstaller does
$this->moduleHandler->invokeAll('themes_installed', [$themes_installed]);
and since this about blocks I looked at \block_themes_installed() which will call \block_theme_initialize. The first thing that function does is load all the blocks for the given theme. If the theme does not have blocks (Bartik does not) it will duplicate the blocks of the existing theme, Stark. Duplicate meaning replace Stark with Bartik in the block id and put the block in the same region, if it exists. If the theme has blocks (Olivero has many in olivero/config/optional) then that duplication process does not happen.It isn't clear to me what this test is really trying to test. It seems to be the hook. If this is testing Olivero then it just needs to confirm that blocks exists but surely testing blocks are loaded is done somewhere in the configuration system tests? I agree with catch that a testing theme should be used.
This patch changes to test_theme in NewDefaultThemeBlocksTest.php.
Comment #9
quietone CreditAttribution: quietone at PreviousNext commentedCreated the followup, #3280049: Create a test admin and front end theme.
Comment #10
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedThe patch in #8 looks good to me.
However, I'm still seeing a ton of references to both Bartik and Seven:
It looks like many of these are tests that don't need to rely on those themes. For example,
core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php
just sets Bartik as the default theme, when it could probably be Olivero. There's a minority of tests that are actually testing Bartik or Seven themselves, likecore/tests/Drupal/FunctionalTests/Theme/BartikTest.php
.Is updating all of these tests expected for this issue? Even if it was, I think it would make sense to audit the above files and create individual issues so we can work on this incrementally. We could retitle this issue to match the patch so it could be merged as is?
Comment #11
catch@deviantintegral it'd be absolutely fine to split this into a handful of issues and commit them independently of each other if we can.
Bartik/Seven-specific tests should be moved into Bartik/Seven themselves - that could be one or two issues and makes sense to handle that on its own.
I'm not sure what a good split is for the other tests here but if there is one that makes sense - we just shouldn't do one-issue-per-test since that can make things harder overall.
Comment #12
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedComment #13
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedI've updated this issue title and summary to reflect the current patch.
I've filed (more) than a handful of new issues, but I've tried to break them down and combine them into groupings based on subsystem and estimated complexity. My hope is there's a good range in here of both easy and hard issues to be actionable by new and experienced contributors alike. Of course, I'm sure there will be areas I've got that wrong once someone actually dives into each issue.
Complex Issues
#3281427: Update Block and Theme setting migrations to not use Bartik and Seven
#3281429: Update Block non-Migration tests to not use Bartik and Seven
#3281430: Update non-migration Color tests to not use Bartik
#3281434: Update System module tests to not use Bartik and Seven
Mid-level issues
#3281444: Update Installer tests to not use Bartik and Seven
#3281446: Update Media Library tests to not use Bartik and Seven
#3281449: Update Core unit tests to not use Bartik and Seven
#3281452: Update Core kernel tests to not use Bartik and Seven
#3281451: Update Ajax FunctionalJavascript test to not use Bartik and Seven
#3281454: Update various module tests to not use Bartik and Seven
Small Issues
#3281438: Update CKEditorTest to not use Bartik and Seven
#3281439: Update Help Topics tests to not use Bartik and Seven
#3281440: Update Shortcut tests to not use Bartik and Seven
#3281441: Update Settings Tray tests to not use Bartik and Seven
#3281443: Update Taxonomy tests to not use Bartik and Seven
#3281457: Move Seven and Bartik tests in the core FunctionalTests\Theme namespace to their respective themes
As I previously reviewed the current patch, and it's passing, I think those updates are ready to be committed.
Comment #14
longwaveComment #15
longwaveTried to fix the typo and autocorrect got me!
Comment #17
alexpottI think the providers changed here...
should be done in a different issue. If we do that then we can backport all the other changes to 9.4.x which helps merge fixes across the different branches. Especially since we have so many other issues.
Comment #19
catchAgreed, let's split that out for a clean backport.
Comment #20
andregp CreditAttribution: andregp at CI&T commentedUndid some of the changes as suggested by @alexpott in #17.
Comment #21
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedI tried to save, and andregp beat me to it!
Comment #22
daffie CreditAttribution: daffie commentedAssign this issue to the parent #3285205: [META] Convert test that use Bartik/Seven to Olivero/Claro.
Comment #24
nod_reroll for 10.x, looks good to me.
Comment #26
catch10.x failure is real:
Comment #27
nod_Olivero is a bit too optimistic about color values :) should we have the fix to make _olivero_hex_to_hsl more resilient as part of this patch or a followup is better?
Comment #28
catchCould we spin the ConfigUIImportTest changes to their own issue (and fix Olivero there too if we need to)? Then we can just commit the rest of the patch here easily.
Comment #29
nod_removed the problematic test and opened a follow-up
Comment #30
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedPatch in #29 looks good to me, flipping the ConfigUIImportTest tests back to bartik. I've confirmed the only changes in the 9.5.x patch are line numbers.
Comment #32
catchCommitted/pushed to 10.1.x and cherry-picked to 10.0.x, then the 9.5.x patch respectively, thanks!