Problem/Motivation

We are trying to integrate GitlabCI into core in this project: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core
The project is a copy of core 11.x with the GitlabCI related files. We've made really good progress, but there are still some fails that are not happening in DrupalCI.

#3375827: Investigate tests failures and https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/m... is the issue where those fails are being tracked and tested. So far #2986962: BrowserTestBase::drupalGet() does not appear to be handling base url properly, #3311469: Absolute path for oembed iframe, #2010368: Installer can't create new database on PostgreSQL have been filed from this work. Some of these were not spotted in DrupalCI due to the customizations within the test system, but they're appearing on a new system (GitlabCI) which barely has any customizations.

The remaining errors happen in "ImageUrlTest" within the "ckeditor5" core module. They can be seen here: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/j...

Testing Drupal\Tests\ckeditor5\FunctionalJavascript\ImageUrlTest
    ..........EE.....F.                                               19 / 19
    (100%)

There were 2 errors:
1) Drupal\Tests\ckeditor5\FunctionalJavascript\ImageUrlTest::testAltTextRequired with data set "Restricted" (false)
...Unable to locate element:...
2) Drupal\Tests\ckeditor5\FunctionalJavascript\ImageUrlTest::testAltTextRequired with data set "Unrestricted" (true)
...Unable to locate element:...

There was 1 failure:
1) Drupal\Tests\ckeditor5\FunctionalJavascript\ImageUrlTest::testResize with data set "Image resize is enabled" (true)
Failed asserting that false is identical to true.

I was not able to identify why they're not working so it'd be great to have help from somebody more knowledgeable.

Steps to reproduce

Run the test via GitlabCI (see previous paragraph for more details).

Proposed resolution

Investigate why this fails.

Remaining tasks

MR with fixes.

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3384764

Command icon 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

fjgarlin created an issue. See original summary.

fjgarlin’s picture

Issue summary: View changes
catch’s picture

Category: Task » Bug report
Priority: Normal » Critical
catch’s picture

Possible culprit, in ImageTestBase, this looks like it might not work in a subdirectory?

  /**
   * Provides the relevant image attributes.
   *
   * @return string[]
   */
  protected function imageAttributes() {
    return ['src' => '/core/misc/druplicon.png'];
  }

fjgarlin’s picture

longwave’s picture

Doesn't DrupalCI run in a subdirectory by default to try and catch problems like that across core?

Are there docs anywhere on how to run the same set of containers as GitlabCI uses, so someone can try to reproduce locally?

fjgarlin’s picture

Doesn't DrupalCI run in a subdirectory by default to try and catch problems like that across core?

The issue is that the subdirectory is created as a folder within the project folder. https://git.drupalcode.org/project/drupalci_testbot/-/blob/dev/src/Drupa.... Note how the code will be available in both $sourcedir and $sourcedir/subdirectory, whereas in Gitlab CI we symlink across different base folders.

#2986962: BrowserTestBase::drupalGet() does not appear to be handling base url properly and #3311469: Absolute path for oembed iframe were recently fixed as DrupalCI was not catching those errors, but GitlabCI was.

Are there docs anywhere on how to run the same set of containers as GitlabCI uses, so someone can try to reproduce locally

Not yet as it's a WIP. We are using this project https://www.drupal.org/project/gitlab_ci_testbed_for_drupal_core, and within it, the https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/b... and https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/b... files. Those contain all the GitlabCI logic.

This issue is the last remaining issue that needs fixing to have a full "green" and equivalent test with GitlabCI on Drupal core.

catch’s picture

I think it needs to be $base_path . '/core/misc/druplicon.png' or similar.

fjgarlin’s picture

Confirmed, that fixed it @catch! See https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/j...
Thanks so much!

The reason why this wasn't caught by DrupalCI is as explained in #7. The image was available both in http://localhost/core/misc/druplicon.png and http://localhost/subdirectory/core/misc/druplicon.png due to the symlink configuration of DrupalCI. In Gitlab, only the latter was valid, which is the correct URL.

MR: https://git.drupalcode.org/project/drupal/-/merge_requests/4704
Needs review

catch’s picture

Status: Active » Needs review
longwave’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. A bunch of other file upload tests prepend base_path() in the same way so this looks correct. #7 explains why this isn't broken on DrupalCI.

I think $this->container refers to the container in the test runner instead of the site under test, which is probably why that doesn't work.

  • catch committed 531383c1 on 11.x
    Issue #3384764 by fjgarlin, longwave: ImageUrlTest fails on GitlabCI...

  • catch committed 1c1cc875 on 10.1.x
    Issue #3384764 by fjgarlin, longwave: ImageUrlTest fails on GitlabCI...
catch’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 10.1.x, thanks!

wim leers’s picture

Issue tags: +gitlabci-core

Sorry I didn't see this earlier, but LGTM! 👍

Status: Fixed » Closed (fixed)

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