- Issue created by @jonathan1055
- 🇦🇲Armenia murz Yerevan, Armenia
I found a workaround for this issue by force enabling colors:
.nightwatch-base: variables: # For some reason, Nightwatch doesn't enable colors for GitLab, but should. FORCE_COLOR: "1"
Reported an issue about this https://github.com/nightwatchjs/nightwatch/issues/4401 - please upvote :)
- 🇪🇸Spain fjgarlin
This is a great find!! I'd say let's add the variable to the nightwatch base job regardless of the outcome of that issue.
Do you want to give it a go?
- Merge request !342Issue #3516239: Force enable colors in Nightwatch output → (Merged) created by murz
- 🇦🇲Armenia murz Yerevan, Armenia
Yeah, let's give it a go, created an MR https://git.drupalcode.org/project/gitlab_templates/-/merge_requests/342 - please review.
- 🇬🇧United Kingdom jonathan1055
Thanks. I have triggered our downstream testing projects, and the Nightwatch current and next minor (running Nightwatch 3.9) are now in color.
https://git.drupalcode.org/project/gitlab_templates_downstream/-/pipelin...
It also does not affect the older versions. Does this need to be added to any documentation page and/or echo the variable to the log? Not sure it is necessary but just asking. - 🇪🇸Spain fjgarlin
I don't think we need to show this variable or add it to the documentation. It was a regression from Nightwatch which will likely be fixed. Also, it's an "internal" variable.
The code looks good to me, thanks!
- 🇦🇲Armenia murz Yerevan, Armenia
By the way, if you run Nightwatch tests in parallel, you will face another issue with GitLab CI output: https://github.com/nightwatchjs/nightwatch/issues/4396 - just sharing here for others who are trying to find how to fix this, no needs to fix this in the pipeline, cuz it should be fixed from the Nightwatch side, I believe.
-
fjgarlin →
committed f507b699 on main authored by
murz →
Issue #3516239 by murz, jonathan1055, fjgarlin: Nightwatch tests have...
-
fjgarlin →
committed f507b699 on main authored by
murz →
- 🇪🇸Spain fjgarlin
Oh, thanks for letting us know. Hopefully it'll be fixed upstream then.
I've merged the changes. Fixed!
- 🇬🇧United Kingdom jonathan1055
@murz I am interested to know how you discovered the environment variable
FORCE_COLOR=1
- 🇦🇲Armenia murz Yerevan, Armenia
@murz I am interested to know how you discovered the environment variable FORCE_COLOR=1
Just explored a lot of similar issues on other packages with missing colors, and then - found this: https://nodejs.org/download/release/v16.9.0/docs/api/cli.html#cli_force_...
And it surprisingly started to work well! :)