Problem/Motivation
As discovered in #3267458-6: Deprecate aggregator module in Drupal 9.4:
Modules which are deprecated are still testing for valid config routes, thus triggering the deprecation warning, making TestBot sad.
Steps to reproduce
- Deprecate module with a config route
- Run test
- Weep
Proposed resolution
Exclude deprecated modules from being tested in \Drupal\KernelTests\Core\Extension\ModuleConfigureRouteTest::testModuleConfigureRoutes
and add a legacy test that tests deprecated modules without triggering a deprecation notice.
Remaining tasks
Stuff
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|
Issue fork drupal-3270323
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
SpokjeComment #4
catchLooks good.
Comment #5
xjmWe're losing test coverage here. Shouldn't we add a legacy test that explicitly tests this for deprecated modules, if we skip them here?
Comment #6
SpokjeComment #7
SpokjeMakes sense, attempted to add that legacy test.
Comment #8
SpokjeComment #9
catchTest failures look real.
Comment #10
SpokjeI would argue that even The Struggle is real, but at the very least I've made another stab to fix the test failures
Comment #11
SpokjeComment #12
SpokjeTesting the plain diff from the current MR on
9.4.x-dev
which actually has a deprecated module (HAL).Comment #13
murilohp CreditAttribution: murilohp at CI&T commentedThe test looks good! Commenting here because for some reason if I comment only on the MR, the issue is not automatically followed.
Comment #14
SpokjeThanks for the review @murilohp!
I've changed (and resolved) one of your threads, and left an explanation in the other.
Hope the helps, if not: Just leave a remark :)
Added a new plain diff from the current state of the MR for testing against
9.4.x-dev
.Comment #15
murilohp CreditAttribution: murilohp at CI&T commentedThe patch looks good to me! The testbot is happy and all the threads were addressed, so it's RTBC!
Comment #17
catchI didn't know you could use @group legacy on methods that aren't the actual test, that's clever.
Committed/pushed to 10.0.x and cherry-picked to 9.4.x, thanks!
Comment #18
xjmMe neither -- neat!
Comment #19
murilohp CreditAttribution: murilohp at CI&T commentedSorry for coming back here and say that unfortunately this will not solve the problem :(, testing here using the parent issue branch, we still see the deprecation notice.
Comment #20
SpokjeWay too clever as it turns out, this is just not working, as @murilohp discovered.
The testing against
9.4.x-dev
was moot, since at this point only hal is deprecated and that module doesn't have a configure route, meaning this test was skipped before installing it.(When something seems to good to be true, it probably isn't...)
So, I've re-opened this one and made separate test methods for deprecated and non-deprecated modules.
Running it locally against #3267458: Deprecate aggregator module in Drupal 9.4 worked for me.
Writing a test to test a test seems a bit much, but I've been wrong before...
(...basically all comments in this issue)
Comment #21
longwaveThe code works and I ran the tests locally to confirm with and without the aggregator patch.
I do wonder if we should open a followup to pre-filter in the data provider, rather than skipping most of the tests? Locally it takes over two minutes to run but over 75% of the tests are skipped so this is a lot of wasted setup (not as bad as if they were functional tests, but still):
Comment #23
catchThis explains how we'd never thought of it before ;)
Yep was thinking the same with the data provider. I think we discussed that already in another issue, but I can't remember where or if there's already a follow-up, so I opened #3271010: Add stable/deprecated versions of coreModuleListDataProvider.
Committed/pushed to 10.0.x and cherry-picked to 9.4.x, thanks!
Comment #25
Spokje