Problem/Motivation
StableDecoupledTest is now gone from 9.1.x branch.
However, it'll remain in the 9.0.x branch.
At #3138652: Remove StableDecoupledTest I raised some issues with it, based on my experience from #3033734: Horizontal scrollbar on /admin/modules:
A) $this->assertEmpty($files_inherited_from_stable); The default PHPUnit message when this assertion fails is just "Failed asserting that an array is empty." In #3033734 I had to add some debugging code to the test when running it locally to confirm system.admin.css was indeed the problem. It'd be really nice if the test output told us that directly.
B) If this test is going to fail (by design) whenever stable diverges from core markup, can we add some more comments to help folks understand how to properly fix the test in this (potentially common) case of failure? I.e. make it more obvious that 3033734.49_51.interdiff.txt is the intended solution whenever stable and core intentionally diverge?
C) There are a handful of typos in the comments.
Proposed resolution
Fix the things.
Remaining tasks
Do it.- Reviews.
- RTBC.
- Commit to 9.0.x.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3138739-2.patch | 3.4 KB | dww |
| #2 | 3138739-2.test-only.patch | 5.7 KB | dww |
Comments
Comment #2
dwwThis fixes A, B and C.
I'm also including a "test-only" version that introduces a CSS change to system.admin.css from #3033734-49: Horizontal scrollbar on /admin/modules and a drupalci.yml change to only run this test so you can see the improved test output from A.
Thoughts?
Thanks,
-Derek
Comment #4
dwwYay, that test-only failure output looks much better. ;)
Here:
vs. the original fail that prompted me to open this:
I tried to do the fancy thing with FormattableMarkup and a placeholder, but the var_export() formatting always gets HTML escaping, which makes it harder to read:
Given that this is auto-generated output based on core filenames, I can't fathom why we'd want/need any of this "properly escaped" -- it's just CLI output, not HTML in a browser...
Also, updating title to make it clear this is 9.0.x-only change.
Thanks,
-Derek
Comment #6
dwwGrrr @ media_library tests...
Re-queued.
Comment #7
bnjmnms/inhereted/inherited
After core themes were decoupled from Stable, the variable name $files_inherited_from_stable became inaccurate, so this added error message is accurate either. Now that decoupling has happened, nothing is inherited from Stable. A more accurate name at this point might be
$files_that_are_expected_to_match_stable. The error message could be something like: "these files in Stable: (filenames) were expected to match their counterparts in core. If any of these files have intentionally deviated from core, add them to the to-skip array for each theme in providerTestDecoupledStable()".The first line is also no longer accurate. The "increasingly smaller" already happened in Q1 2020, so this whole comment would need a rewrite to be accurate.
The to-skip array is for assets that are
1) Previously inherited from Stable and now inherited from core. (i.e. not overridden)
2) They are in some way different from their equivalents in Stable, but those differences are confirmed to be acceptable within the theme being tested.
It's apparent after this review that changes to this test (and possibly even removing it) should have taken place as part of #3115223: Remove Stable as a base theme of core themes, so mitigating some of the confusion from that omission is appreciated.
Comment #8
narendra.rajwar27Comment #9
narendra.rajwar27Comment #15
quietone commented@dww, thanks for making a patch to improve the test. However, Drupal 9 is EOL, therefor I am closing this one.
Cheers