- 🇪🇸Spain fjgarlin
We are running into this issue when trying to convert DrupalCI to GitlabCI.
See the slack message: https://drupal.slack.com/archives/C223PR743/p1692017659269539
Quoting here for those not in slack:We are trying to recreate DrupalCI with GitlabCI for Drupal core.
* Project: https://www.drupal.org/project/gitlab_ci_testbed_for_drupal_core →
* Issue: https://www.drupal.org/project/gitlab_ci_testbed_for_drupal_core/issues/... →Most tests do pass: phpunit, kernel, nightwatch… but some of the Functional tests fail, and in most cases, the reason is a duplicated subdirectory/subdirectory in the URL, leading to a 404. Having and testing Drupal in a subdirectory is intentional, but I’m not sure where that duplication comes from.
I’ve tested some variations of the htaccess file provided by Drupal core (MR here: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/m... and you can see the commit history for the MR).
You can see an example of a failed job here: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/j.... You can download the artifacts and see the logs and see that in most cases, the reason is due to a path with subdirectory/subdirectory. These same tests in DrupalCI do work.
ie: InlineBlockPrivateFilesTest produces simpletest/browser_output/Drupal_Tests_layout_builder_FunctionalJavascript_InlineBlockPrivateFilesTest-1-59609102.html and if you click on Next links, you’ll see the duplication if the 404 page where the test fails.
I'm still not sure why it fails in GitlabCI and _not_ in DrupalCI, but the situation is the same as the one presented in this issue.
If I find a solution to it, I'll also report here, I just wanted to "link" these two issues as the fix might help one another. - 🇪🇸Spain fjgarlin
I made a change that I think fixes the issue, but I find it hard to write a test that will fail...
MR: https://git.drupalcode.org/project/drupal/-/merge_requests/1950/diffSo far, DrupalCI has not caught this, even though there are multiple issues related to this.
See core:
* 📌 Improve documentation on the working of Url::fromUserInput Postponed: needs info
* 🐛 Confirmation cancel links are incorrect if installed in a subdirectory Needs work
* #2990664: Media library does not work when Drupal is installed into a sub-directory →And contrib:
* #3320228: IMCE UI generates links that are not the same as those generated by Drupal Core →
* #2899166: WORKAROUND: Issue #2582295: Confirmation cancel links are incorrect if installed in a subdirectory →
* #3046182: Work around Core bug: 404 on confirmation cancel in subdirectory installs →For this fix, while using GitlabCI for core, we can see the before and after:
* Before: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/p...
* After: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/p...“Functional Javascript” errors go from 8 to 3.
“Functional” ones from 5 to 0.The related issue where those tests are being made is: #3375827: Investigate tests failures →
- Status changed to Needs review
over 1 year ago 7:57am 17 August 2023 - last update
over 1 year ago 29,971 pass - @fjgarlin opened merge request.
- Status changed to Needs work
over 1 year ago 2:14pm 21 August 2023 - 🇺🇸United States smustgrave
Fix \Drupal\Tests\BrowserTestBase::drupalGet() so it does not lose the base path if given a uri
Could the issue summary be updated to match the new solution please.
I've been bit by this bug numerous times too and had to do some weird workarounds. Usually the failure only happened on drupalCi but would pass locally because of this issue.
Not sure if any test coverage is needed.
- Status changed to Needs review
about 1 year ago 10:53am 22 August 2023 - 🇪🇸Spain fjgarlin
Updated the issue description to match the solution proposed in the MR.
- Status changed to RTBC
about 1 year ago 3:33pm 22 August 2023 - last update
about 1 year ago 30,056 pass - last update
about 1 year ago 30,058 pass - last update
about 1 year ago 30,060 pass - last update
about 1 year ago 30,060 pass - last update
about 1 year ago 30,100 pass - Status changed to Fixed
about 1 year ago 8:37am 1 September 2023 - 🇬🇧United Kingdom catch
It's probably theoretically possible to test the trait with different values for $base_path, however this is going to be implicitly tested by every gitlab CI run for the forseeable future, so I think that could be a follow-up.
Committed/pushed to 11.x and cherry-picked to 10.1.x, thanks!
- 🇳🇿New Zealand quietone
This is tagged for a followup. Is that #5 of the remaining tasks? Does anyone know if that has been created or is no longer needed?
- 🇬🇧United Kingdom catch
Sorry the follow-up would be to add additional, explicit, test coverage to UiHelperTrait to ensure that it works with different values for $base_url. However because we have implicit test coverage of this on every test run, I'm wasn't sure whether it's really worth adding tests for the test helper in this case.
- 🇳🇿New Zealand quietone
Seems better to make one than to forget. Here it is 📌 Add tests of $base_url in UiHelperTrait Active
Removing tag
Automatically closed - issue fixed for 2 weeks with no activity.