Problem/Motivation

Classy theme has been removed from Drupal and therefore tests which are using this theme are failing.

Steps to reproduce

Run tests or see https://www.drupal.org/pift-ci-job/2473687

Proposed resolution

We need to replace classy with startekit_theme.

Comments

sorabh.v6 created an issue. See original summary.

anchal_gupta’s picture

StatusFileSize
new3.26 KB

I have Uploaded the patch. Please review it

anchal_gupta’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 3311367.patch, failed testing. View results

xjm’s picture

Thanks @Anchal_gupta for providing a patch!

  1. +++ b/tests/src/FunctionalJavascript/MediaLibraryTest.php
    @@ -27,7 +27,7 @@ class MediaLibraryTest extends WebDriverTestBase {
    -  protected $defaultTheme = 'classy';
    +  protected $defaultTheme = 'stark';
    
    +++ b/tests/src/FunctionalJavascript/MediaTest.php
    @@ -79,7 +79,7 @@ class MediaTest extends WebDriverTestBase {
    -  protected $defaultTheme = 'classy';
    +  protected $defaultTheme = 'stark';
    

    So Stark is the best choice for the long term, but it won't have the classes these tests are relying on. It would be better to use starterkit_theme which will be closer to what was in Classy, just to do as little work as possible since this module will be end-of-life in about a year.

  2. +++ b/tests/src/FunctionalJavascript/MediaTest.php
    @@ -242,18 +242,18 @@ class MediaTest extends WebDriverTestBase {
    -    // Test when using the classy theme, an additional class is added in
    -    // classy/templates/content/media-embed-error.html.twig.
    -    $this->assertTrue($this->container->get('theme_installer')->install(['classy']));
    +    // Test when using stark theme, an additional class is added in
    ...
    +    $this->assertTrue($this->container->get('theme_installer')->install(['stark']));
         $this->config('system.theme')
    -      ->set('default', 'classy')
    +      ->set('default', 'stark')
    

    This especially is not going to work. @sorabh.v6 observed that this file no longer exists in Classy, and it definitely never existed in Stark in the first place.

Adding credit for @sorabh.v6 for investigating the media-embed-error.html.twig issue.

media-embed-error.css also does not exist in starterkit_theme. We may need to copy that file and associated assets into this module. We may also need to create an entirely new test theme fixture to test this behavior, or just remove that whole part of the test as something we no longer support. I'll consult the maintainers.

lauriii’s picture

Could we add Classy as a dev dependency for this module to make the tests pass?

wim leers’s picture

Could we add Classy as a dev dependency for this module to make the tests pass?

+1 — that is the simplest possible solution IMHO 🤓

wim leers’s picture

Actually, can we first try switching to starterkit_theme instead?

That worked fine for Quick Edit in #3309243: New test failures on D10: `UnknownExtensionException: Unknown themes: classy` 😊

lauriii’s picture

Depending on classy is much more less likely to run into problems in future. Starterkit theme is likely to change in future and could lead into the tests breaking.

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new384 bytes

Status: Needs review » Needs work

The last submitted patch, 11: 3311367-11.patch, failed testing. View results

lauriii’s picture

Status: Needs work » Needs review
StatusFileSize
new594 bytes

Status: Needs review » Needs work

The last submitted patch, 13: 3311367-14.patch, failed testing. View results

lauriii’s picture

It looks like Classy is also broken because it should have a dependency on drupal/stable . 🤦‍♂️

lauriii’s picture

Status: Needs review » Needs work

The last submitted patch, 13: 3311367-14.patch, failed testing. View results

wim leers’s picture

Assigned: sorabh.v6 » Unassigned
Status: Needs work » Needs review

Still lots of new failures for #13 even after #3311528: HEAD broken because of missing dependency on Stable (although only 6 instead of 12):

Exception: Warning: scandir(core/assets/vendor/ckeditor/lang): Failed to open directory: No such file or directory

I very much prefer my patch from #11 though, because then we don't have to deal with maintaining a composer.json file and how the d.o composer facade interacts with that. So re-testing that.

wim leers’s picture

Priority: Normal » Critical
Related issues: +#3311028: 1.0.x Branch Tests Failing

Closed #3311028: 1.0.x Branch Tests Failing as a duplicate of this.

The last submitted patch, 11: 3311367-11.patch, failed testing. View results

wim leers’s picture

StatusFileSize
new382 bytes

Only now do I see what a collossally stupid mistake I made in #11 🙈

Status: Needs review » Needs work

The last submitted patch, 22: 3311367-22.patch, failed testing. View results

wim leers’s picture

Ah, I bet that #22 doesn't work simply because we need d.o's composer facade to make it be respected by Drupal CI… 😬

So … going ahead and committing #22, then I should start seeing the 6 failures that @lauriii's #13 saw.

wim leers’s picture

Title: Fix Unknown themes: classy error in the tests » Fix "Unknown themes: classy" error in the tests

  • Wim Leers committed 2719314 on 1.0.x
    Issue #3311367 by Wim Leers, lauriii, Anchal_gupta, xjm, sorabh.v6,...
lauriii’s picture

I think #22 doesn't work because modules can't add dependencies on themes 🤓

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new1.19 KB
wim leers’s picture

#27: argh. What a mess. Can't wait for Drupal to have way better validation, because it'd massively improve the DX.
What you say makes sense, sadly, @lauriii 😞

wim leers’s picture

… although https://www.drupal.org/pift-ci-job/2485695 did work just fine 🤓

Like I said … a huge mess 🙈

wim leers’s picture

StatusFileSize
new1.73 KB
new2.88 KB

The remaining 2 failures are both in \Drupal\Tests\ckeditor\Kernel\CKEditorTest, and they can only be tested in Drupal <10.0, because they depended on extensions providing explicit CKEditor 4 support.

The last submitted patch, 28: 3311367-26.patch, failed testing. View results

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#3270438: Remove CKEditor 4 from core

To clarify

because they depended on extensions providing explicit CKEditor 4 support.

→ the changes in #3270438: Remove CKEditor 4 from core make it impossible to test this in Drupal >=10

And that's … reasonable. 👍

wim leers’s picture

The remaining failures are not happening on 10.0.x, only on 9.4.x and 9.5.x. This is due to #3306545: Replace ckeditor with ckeditor5 in the 9.4.x database dumps in Drupal 10.0.x & 10.1.x having modified the update path fixtures.

I've tested this fix locally, should work for all branches 😊

wim leers’s picture

Status: Reviewed & tested by the community » Fixed

  • Wim Leers committed 6374f3f on 1.0.x
    Issue #3311367 by Wim Leers, lauriii, Anchal_gupta, xjm, sorabh.v6,...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.