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
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:
- 3384764-imageurltest-fails-on
changes, plain diff MR !4704
Comments
Comment #2
fjgarlin commentedComment #3
catchComment #4
catchPossible culprit, in ImageTestBase, this looks like it might not work in a subdirectory?
Comment #5
fjgarlin commentedI tried to make the URL "core/misc..." and the error remains the same.
- Commit: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/m...
- Job: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/j...
Comment #6
longwaveDoesn'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?
Comment #7
fjgarlin commentedThe 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.
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.
Comment #8
catchI think it needs to be
$base_path . '/core/misc/druplicon.png'or similar.Comment #10
fjgarlin commentedConfirmed, 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
Comment #11
catchComment #12
longwaveLooks 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->containerrefers to the container in the test runner instead of the site under test, which is probably why that doesn't work.Comment #15
catchCommitted/pushed to 11.x and cherry-picked to 10.1.x, thanks!
Comment #16
wim leersSorry I didn't see this earlier, but LGTM! 👍