Problem/Motivation
#2352949: Deprecate using Classy as the default theme for the 'testing' profile set a new direction for how to avoid having our tests be dependent on themes that may disappear. It also introduced a BC layer. For now, Drupal core uses that BC layer, and because of that deprecation errors are triggered.
They're suppressed thanks to \Drupal\Tests\Listeners\DeprecationListenerTrait::getSkippedDeprecations().
Proposed resolution
This issue is about removing the suppression of that deprecation error from \Drupal\Tests\Listeners\DeprecationListenerTrait::getSkippedDeprecations() and instead updating all relevant tests.
(This then also unblocks the next step: #3083275: [meta] Update tests that rely on Classy to not rely on it anymore.)
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #74 | 3082655-8.9.x-74.patch | 965.88 KB | alexpott |
| #74 | 3082655-9.0.x-74.patch | 965.87 KB | alexpott |
| #69 | 3082655-9.0.x-69.patch | 965.48 KB | alexpott |
| #69 | 3082655-8.9.x-69.patch | 965.5 KB | alexpott |
| #69 | 65-69-interdiff.txt | 1.82 KB | alexpott |
Comments
Comment #1
wim leersWim Leers created an issue. See original summary.
Comment #2
wim leers#2352949: Deprecate using Classy as the default theme for the 'testing' profile is green now. Let's get this going. First, let's get a list of all the failing tests if we disallow this deprecation in Drupal core.
Comment #3
wim leersIt looks like most of the tests can actually switch to
stark🥳So far, only one tests needed to continue to use
classy.I think this issue and patch are simple enough that a novice contributor can continue this 😊
Comment #4
wim leersHere's one more, so I have an excuse to roll this on top of #2352949-82: Deprecate using Classy as the default theme for the 'testing' profile :)
Comment #5
wim leersThe next step after this: #3083275: [meta] Update tests that rely on Classy to not rely on it anymore.
Comment #6
wim leersRebased on top of #2352949-92: Deprecate using Classy as the default theme for the 'testing' profile, which is RTBC 🥳
Comment #7
wim leers#2352949: Deprecate using Classy as the default theme for the 'testing' profile landed! 🥳
Rebased.
Comment #9
wim leersThis is now ready for somebody new to Drupal core contribution to take completion!
Comment #10
xjmComment #11
xjmComment #12
xjmComment #13
iyyappan.govindHi xjm,
I just analysed the test failers of latest patch. It shows ~1500 test failers . So can we create child issues per module? Thanks
Comment #14
dwwRe: #13: I don't think we want to split this up. It's super trivial boiler-plate that needs to happen.
However, the key piece is this:
That's what turns on the deprecation errors that shows you what's still missing. We'd have to wait to do that until all the child issues are resolved, but without including that part, we wouldn't know if each child issue was complete.
Plus, it's just a ton of issue churn, separate reviews, test bot runs, etc. I believe it'll ultimately be faster and easier to simply do it in 1 big patch. There shouldn't be any discussion needed. If you're changing assertions in this issue, You're Doing It Wrong(tm). ;) Any of that belongs in #3083275: [meta] Update tests that rely on Classy to not rely on it anymore. The only things in here should be setting tests to either explicitly use
stark(if possible) orclassy(if necessary).That said, if someone wants to spin up a sandbox to work on this, I'm not opposed. But I don't think sandboxes get automated testing, so that probably wouldn't help much.
If someone wants to add a list of modules to the Remaining tasks portion of the summary so we can
cross them offas we complete modules, that'd be fine, too.Personally, I'd try writing a script to set *everything* to use
starkand see how many failures we still have. Anything that fails asstarkshould be set toclassyand we should be RTBC.At least, that's my take on the simplest path forward here.
Cheers,
-Derek
Comment #15
wim leersYes, one issue please. There are no semantical or conceptual differences between the tests in various modules. It's the same pattern applied across all tests: try to use
starkif you can (if it doesn't require changes in assertions), otherwise useclassy. As is explained briefly in #3 and in detail in the change record.There is a person who reached out to me in Drupal Slack (username:
DrupalTree). They asked a lot of questions, I answered all of them. They haven't posted here yet though.#14 is right. But personally I'd do the copy/paste work faster than I can write that script. :)
Comment #16
iyyappan.govindHi I am working on this issue.
Comment #17
wim leersThanks, @iyyappan.govind! (Turns out he is the
DrupalTreeperson I mentioned in #15!)Comment #18
dwwIn #2352949: Deprecate using Classy as the default theme for the 'testing' profile we changed our minds on what this should be called...
@iyyappan.govind - yes, thanks for taking this on!
@Wim Leers - whatever's faster. ;)
Cheers,
-Derek
Comment #19
iyyappan.govindHi I have added the $defaultTheme property to below 14 modules.
Thanks
Comment #20
wim leersGood job! That brought us from 1526 failures in #7 to 1449 failures in #19. Progress! 🎉 👏 Thank you :)
Comment #21
iyyappan.govindHi @wimleers, Thanks for the appreciation. I just re-rolling the block and block_content module function $defaultTheme from stark to classy.
Comment #22
iyyappan.govindRe-rolled comment, config modules to classy and added stark as $defaultTheme in jsonapi module. Thanks
Comment #23
dww@iyyappan.govind thanks for continuing to work on this! 2 things:
1) It's not exactly clear from your comments if you're doing this, but please don't change entire modules as stark vs. classy. The intention of this issue is to try to get as many tests as possible using stark. If individual tests need to be rolled back to classy to pass, so be it, but we want to leave as many tests using stark as we can.
2) Please attach interdiff files so we can more easily try to see what's happening and make sure you're on the right track. For example, I'm attaching the ones between #19 and #21, and between #21 and #22.
Thanks!
-Derek
Comment #24
iyyappan.govindAdded the $defaultTheme to jsonapi module. Thanks
Comment #25
iyyappan.govindHi I have added the $defaultTheme = Stark in all the core module test files. Just adding the patch to review. Thanks
Comment #26
iyyappan.govindFixed the syntax error. Updated the patch.
Comment #27
iyyappan.govindHi Re-rolled the patch. Thanks
Comment #28
iyyappan.govindRemoved the binary file entry on the patch. Thanks
Comment #29
iyyappan.govindComment #30
wim leersEPIC progress here, @iyyappan.govind! 👏👏👏👏
@iyyappan.govind asked me to help him with the last 10 failures.
BuildTestTest::testPortMany()failure is most certainly unrelated. Also, I cannot reproduce it locally.GetTestMethodCallerExtendsTestandGetTestMethodCallerTestwere legitimate, we need to update their assertions slightly.PageCacheTagsIntegrationTestwas caused by the addition of$defaultTheme: this is one of the few tests in core where that's not necessary, because it uses thestandardinstall profile, which contains configuration that already sets a specific default them. Easy fix: revert the change :)BreadcrumbTest.WorkspaceSwitcherTestfailed because it was usingstarkbut had to useclassy. Fixing this also required removingWorkspaceTestUtilities::$defaultThem, which did not really make sense to add anyway (the default theme should be set on individual test classes or base test classes, not on traits).DrupalSelenium2DriverTestjust didn't have$defaultThemeyet :)Also fixed one coding standard violation in
EditModeTest(one extraneous blank line).Comment #31
wim leersApparently this needs to be created with
--binarybecause ofgit diffbeing braindead:Rerolled #30.
Comment #33
wim leersI apparently omitted the change I mentioned in #30.3. Not sure how that happened. But yeah, I've been doing this for so long and I still make silly mistakes as you can see 😇
Comment #34
iyyappan.govindHi @wimleers,
Thank you for your help on this.
Comment #35
dwwFantastic work, here! THANK YOU @iyyappan.govind and @Wim Leers!!!
I asked at #2659890-36: [Policy] [Plan] Drupal 9 and 10 markup and CSS backwards compatibility about how @xjm (release manager) and @lauriii (front end manager) want to handle this issue. There was talk of adding
@todo @seecomments at every reference toclassythat would point to #3083275: [meta] Update tests that rely on Classy to not rely on it anymore. I'm hoping they can clarify if that's really what they want, and if so, exactly what they want the comments to look like, so we can get this RTBC and committed.Onward! ;)
-Derek
Comment #36
wim leers#35: I don't think this needs such a@todocomment for every single occurrence of$defaultTheme = 'classy';. Some of them will turn out to be legitimate/necessary. Besides, we won't forget to do this anyway, since the follow-up already exists.That's before I read your comments at #2659890-36: [Policy] [Plan] Drupal 9 and 10 markup and CSS backwards compatibility and #3083275-4: [meta] Update tests that rely on Classy to not rely on it anymore: this patch sets Classy as the default theme 890 times. Stark is fortunately set as the default theme an order of magnitude more: 7145 times. Still, that's indeed still a lot of Classy.
I too defer to release managers and the front end framework manager then 🙂
I'll do some spot testing on those 890 Classy uses: I'll try to bring that number down. Nonetheless, I'm already quite happy with this significant progress in the right direction :)
Comment #37
wim leersApparently @iyyappan.govind spent a good portion of his 3 days of holidays last week on this issue! 🤯😳
We should all be very thankful to @iyyappan.govind! 🙏
Comment #38
iyyappan.govindHi Wimleers, Really thanks for appreciating me. Your appreciation gives me a motivation to contribute more on the Drupal. Thanks again.
Comment #39
wim leersDid that. I tried switching the following from
protected $defaultTheme = 'classy';toprotected $defaultTheme = 'stark';:\Drupal\Tests\book\Functional\BookContentModerationTest\Drupal\Tests\block_content\Functional\BlockContentListTest\Drupal\Tests\dblog\Functional\DbLogViewsTest\Drupal\Tests\image\Functional\ImageDimensionsTest\Drupal\Tests\big_pipe\Functional\BigPipeTest\Drupal\Tests\node\Functional\NodeTypeTest\Drupal\Tests\contact\Functional\ContactStorageTest\Drupal\Tests\system\Functional\Entity\EntityViewControllerTest\Drupal\Tests\media\FunctionalJavascript\MediaSourceImageTest\Drupal\Tests\page_cache\Functional\PageCacheTestAll of them except that last one resulted in a failing test. Meaning 9 out of the 10 I tested were correctly using
classy👍 Many of them could easily be switched from Classy to Stark, but that's what we have #3083275: [meta] Update tests that rely on Classy to not rely on it anymore for. This patch is really hard to keep applying to HEAD: any test file rename or test addition forces this patch to be updated! So I think this is ready 🚢Comment #40
wim leers#31:
This happened again 😬😬😬😬
Also, recent HEAD changes broke this patch again.
Comment #41
wim leersComment #42
wim leersSomething went wrong in #40's rebase evidently.
Comment #43
lauriii$defaultThemeinDrupal\FunctionalJavascriptTests\DrupalSelenium2Driver?Should we open follow-up to change the default theme for the tests that are specifically testing themes?
🎉
Comment #44
wim leersAlso rebased again…
Comment #47
wim leers🙃 4 fails, 4 new tests since I rolled a fresh patch against head 🙃
Worst chasing of head I’ve ever had I think — fortunately it’s not complex!
Comment #48
wim leersIn the past ~14 hours a number of new tests were added… but none of them tests that need this! So, the re-test of #47 should still pass all tests 🤞🤓
Comment #50
wim leersNICE I just trolled myself there. The sole failure was added by #3084069: Allow marking themes as experimental, which I helped get to RTBC 😅😂 Will rebase once more.
Comment #51
wim leersComment #53
wim leersAnother test run, another fail triggered by a newly added test 🧐 This time #3081587: Multilingual content is shown double in the media library view.
Comment #54
wim leersIn the past 15 minutes two more core commits happened, so another rebase. 😬
Comment #56
wim leersDiscussed with core committers.
I realized that committing this would break every single RTBC patch that adds a new functional test. That’s far too disruptive just before alpha. So I now think the smarter strategy is to core committers agree that this patch is okay to land after alpha-deadline issues.
@larowlan, @alexpott, @catch committers were positive about this, and @xjm suggested tagging this . So, did that :)
Comment #58
xjmThis should be scheduled for some date after beta 1, so the week of the Nov. 11.
Comment #59
alexpottRe-rolled the patch - I expect any new tests added in the interim to fail.
Comment #60
wim leersI was going to work on making this green again, but per #58 that should only happen next week.
Comment #61
alexpottOkay we need different patches on 8.x.x and 9.0.x due to differences in \Drupal\Tests\Listeners\DeprecationListenerTrait::getSkippedDeprecations - the patch in #59 is good for 9.0.x but here are new clearly labelled patches.
Comment #63
alexpottFixed the new tests... The interdiff is the same for both the 9.0.x and 8.x.x patches.
Comment #64
alexpottHmmm... for some reason
Drupal\Tests\media_library\FunctionalJavascript\TranslationsTestis going to fail. I thought it was due to #3087036: third_party_settings in THEME.settings.yml cannot be dependency managed but it's due to something else... wow!Ah I see the tests depend on classy's markup...
Comment #68
dwwWeird that the testbot didn't mark this needs work automatically...
Comment #69
alexpottTrivial changes to fix tests that rely on classy and add $defaultTheme to another new test.
Comment #70
dwwWoo hooo! Green patches again. Let's land this sucker. ;)
Thanks!
-Derek
p.s. I'm now preemptively defining
defaultThemein new test classes I'm adding, so they/this don't have to be re-rolled again. See #3092125-14: Add test coverage of Views RSS feeds with translated content for example...Comment #71
wim leersI agree with the RTBC of #69. See my original RTBC in #39, which includes a detailed rationale. @alexpott in his recent rerolls has followed the same rationale: start with
stark, but change toclassywhen that causes test failures.#70: 👍
Comment #72
iyyappan.govindGreat!! Excited to see the green patches again. : 👍
Comment #73
catchNeeds one more re-roll (I'm hoping to commit this today just before the beta is tagged).
Comment #74
alexpottRerolled - not sure if there are any new tests but the testbot can tesll us that. git did a 3-way merge.
Comment #78
catchSeveral linear metres of PHPCS terminal output later...
Committed/pushed to 9.0.x, 8.9.x and 8.8.x, thanks!
Comment #79
wim leersROFL 🤣
Not very surprising though because IIRC this took
gitmore than a minute to apply. On a very recent machine. 🙃