- Issue created by @murz
- Merge request !247Issue #3469616: Add detection of Nightwatch tests in the `tests/modules` directory → (Merged) created by murz
- Status changed to Needs review
11 months ago 7:41am 22 August 2024 - 🇦🇲Armenia murz Yerevan, Armenia
I created an MR with the fix https://git.drupalcode.org/project/gitlab_templates/-/merge_requests/247 - please review.
- Status changed to RTBC
11 months ago 7:43am 22 August 2024 - 🇪🇸Spain fjgarlin
Thanks for this. I triggered the dowstream pipeline for the module with nightwatch tests: https://git.drupalcode.org/issue/gitlab_templates-3469616/-/pipelines/26...
It'd be great if you test this MR with your module, it's really easy: https://project.pages.drupalcode.org/gitlab_templates/info/testing-mrs/
The code looks good and I'm going to RTBC, but it would still be great to have that extra test.
- 🇦🇲Armenia murz Yerevan, Armenia
Also, we have another issue 🐛 Nightwatch tests from submodules do not run in Gitlab CI because of missing option to follow symlinks Needs review related to the submodules, where Nightwatch can't find tests in the submodules, the fix is also provided in that issue.
- 🇦🇲Armenia murz Yerevan, Armenia
@fjgarlin, thanks for the suggestion - it works well! Here is the successful pipeline: https://git.drupalcode.org/project/test_helpers/-/jobs/2517769
and the changes https://git.drupalcode.org/project/test_helpers/-/merge_requests/104/dif...But requires another fix from the issue 🐛 Nightwatch tests from submodules do not run in Gitlab CI because of missing option to follow symlinks Needs review .
- 🇪🇸Spain fjgarlin
Thanks for the extra test.
Yeah, it won't fully work until 🐛 Nightwatch tests from submodules do not run in Gitlab CI because of missing option to follow symlinks Needs review is committed but for now, this fixes the issue in the templates.
I'm copy/pasting your workaround here in case somebody arrives at this issue:
# A workaround for the issue https://www.drupal.org/project/drupal/issues/3469607 start. composer: after_script: - 'grep -qxF " follow: true," web/core/tests/Drupal/Nightwatch/nightwatch.conf.js || sed -i "/ ignore: process.env.DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES/i\ follow: true," web/core/tests/Drupal/Nightwatch/nightwatch.conf.js' # A workaround for the issue https://www.drupal.org/project/drupal/issues/3469607 end.
-
fjgarlin →
committed 09bf9b85 on main authored by
murz →
Issue #3469616 by murz, fjgarlin: Nightwatch tests in the test modules...
-
fjgarlin →
committed 09bf9b85 on main authored by
murz →
- Status changed to Fixed
11 months ago 9:46am 22 August 2024 - 🇬🇧United Kingdom jonathan1055
@murz for your info, and in case you need to modify any jobs in future, it can be done a little more easily than what you had in the issue summary. For rule snippets that do not need to be changed, you can refer to the original using
!reference [ .the-rule-name ]
instead of repeating the definition. So you workaround would be shortened to just:.nightwatch-tests-exist-rule: &nightwatch-tests-exist-rule - exists: - tests/src/Nightwatch/**/*.js - modules/*/tests/src/Nightwatch/**/*.js # A fix for the issue https://www.drupal.org/project/gitlab_templates/issues/3469616. - tests/modules/*/tests/src/Nightwatch/**/*.js when: on_success .nightwatch-base: rules: - !reference [ .opt-in-current-rule ] - !reference [ .skip-nightwatch-rule ] - *nightwatch-tests-exist-rule
Automatically closed - issue fixed for 2 weeks with no activity.