- Issue created by @murz
- 🇪🇸Spain fjgarlin
Do you have a link to a nightwatch job log?
As we are displaying them when the value is set to 1 in nightwatch (https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes...), the log should show if they are available or not.
That's for the variable to be available in the logs. If you want them available in the yarn jobs, we might need to add a
-E
option to the command or something different.This issue might probably be solved by 🐛 BROWSERTEST_OUTPUT_VERBOSE is not passed to run-tests.sh when running with it Active , but that's waiting on a core issue, which is RTBC at the moment.
I think this is a duplicate but I'll leave it as postponed, to review that the above would actually fix this. - 🇦🇲Armenia murz Yerevan, Armenia
I created an example to reproduce this issue: https://git.drupalcode.org/project/opentelemetry/-/jobs/3262018
- 🇪🇸Spain fjgarlin
Thanks for the link.
Right now, we are calling the nightwatch job like this:
sudo BABEL_DISABLE_CACHE=1 -u www-data yarn test:nightwatch --tag=$MODULE_NAME
So this doesn't pass any variable from the CI to the job, and because it uses sudo, nightwatch cannot access the job env variables.
Out of curiosity, can you add the following to your gitlab file and see what happens?
nightwatch: after_script: - cd $CI_PROJECT_DIR/$_WEB_ROOT/core && corepack enable && sudo BABEL_DISABLE_CACHE=1 -u www-data -E yarn test:nightwatch --tag=$MODULE_NAME
Note that this will run the nightwatch job twice, but if the solution works (I added
-E
) we might not need to wait for the other issues to be fixed and fix it in this one. - 🇦🇲Armenia murz Yerevan, Armenia
Thanks, I tried this but we got an error with NPM permissions: https://git.drupalcode.org/project/opentelemetry/-/jobs/3262379
$ cd $CI_PROJECT_DIR/$_WEB_ROOT/core && corepack enable && sudo BABEL_DISABLE_CACHE=1 -u www-data -E yarn test:nightwatch --tag=$MODULE_NAME node:internal/process/promises:288 triggerUncaughtException(err, true /* fromPromise */); ^ [Error: EACCES: permission denied, open '/root/.cache/node/corepack/lastKnownGood.json'] { errno: -13, code: 'EACCES', syscall: 'open', path: '/root/.cache/node/corepack/lastKnownGood.json' } Node.js v18.20.4 WARNING: after_script failed, but job will continue unaffected: command terminated with exit code 1
Here is my issue for testing: https://www.drupal.org/i/3485086 → - you can get the write access and try on your own.
- 🇪🇸Spain fjgarlin
Thanks for testing that. Yeah it confirms that we need the other issues addressed first.
As the core one is RTBC it might be committed soon.
- 🇦🇲Armenia murz Yerevan, Armenia
Actually, only adding the www-data user to the root group seems not enough, see the https://git.drupalcode.org/project/opentelemetry/-/jobs/3268672#L521
The
/root/
directory is available only for the user root, not for the group members.So, seems we need to extend the permission of the root homedir, or put another directory to the $HOME env.
- 🇦🇲Armenia murz Yerevan, Armenia
The
sudo -H
parameter helps resolving the home directory problem! See https://git.drupalcode.org/project/opentelemetry/-/jobs/3269735 - 🇪🇸Spain fjgarlin
The related issue 🐛 BROWSERTEST_OUTPUT_VERBOSE is not passed to run-tests.sh when running with it Active was merged. Can this be tested again using
main
as reference? More info on how to do it here https://project.pages.drupalcode.org/gitlab_templates/info/templates-ver... - 🇦🇲Armenia murz Yerevan, Armenia
Started to test, but faced another issue - see 🐛 Nightwatch pipeline started to fail if the module contains Nightwatch commands Active