Skip to content

Line breaks in the test output are missing in CI output in the Parallel mode #4396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MurzNN opened this issue Mar 20, 2025 · 6 comments
Open

Comments

@MurzNN
Copy link

MurzNN commented Mar 20, 2025

Description of the bug/issue

When I run Nightwatch in GitLab CI using the parallel mode - I see no line breaks in the output, here is an example:
Image

Here is an example of a job with badly formatted output: https://git.drupalcode.org/project/commercetools/-/jobs/4723196

Steps to reproduce

  1. Enable colors using "FORCE_COLOR=1" in the pipeline.
  2. Run the Nightwatch test in the parallel mode by adding these to the settings:
{
  "test_workers": {
    "enabled": true,
    "workers": "auto"
  }
}
  1. Run the parallel mode locally - you will see a well-formatted colored output.
    Image

  2. Run the same on the GitLab pipeline - you will see that the line breaks are missing, making the output not readable at all:
    Image

Sample test

Command to run

Verbose Output


Nightwatch Configuration

Nightwatch.js Version

3.12.1

Node Version

18.20.7

Browser

Chrome

Operating System

Linix (GitLab Runner)

Additional Information

No response

@MurzNN
Copy link
Author

MurzNN commented Mar 20, 2025

By the way, colors for GitLab CI are not enabled automatically, we have to force enable them by the FORCE_COLOR=1 environment variable.

But without colors we have the same issue with missing line breaks.

@garg3133
Copy link
Member

@MurzNN Can you try setting disable_output_boxes: true in your Nightwatch config? This config will go on the same level as src_folders in the config file.

Or, if you use a separate env for CI inside your Nightwatch config file, you can set this property inside that env itself instead of enabling it globally.

If this works, we'll try to add this in the documentation itself as many people have been raising this.

@MurzNN
Copy link
Author

MurzNN commented Mar 28, 2025

Yeah, adding disable_output_boxes: true resolves the issue, here is a well-formed output with this option: https://git.drupalcode.org/project/commercetools/-/jobs/4803918

So, the issue seems is with the output boxes rendering, would be good to fix it, if possible.

@MurzNN
Copy link
Author

MurzNN commented Mar 29, 2025

By the way, colors are not enabled automatically on GitLab CI, I have to set FORCE_COLOR: "1" to enable them. Maybe the same missing GitLab CI detection leads to missing line breaks?

@DovieW
Copy link

DovieW commented Mar 31, 2025

This ticket should not be closed until disable_output_boxes is added to the documentation and man pages or wtvr

EDIT: ah just noticed garg3133 already said we'll add it.

@reallymello
Copy link
Contributor

@MurzNN Can you try setting disable_output_boxes: true in your Nightwatch config? This config will go on the same level as src_folders in the config file.

Or, if you use a separate env for CI inside your Nightwatch config file, you can set this property inside that env itself instead of enabling it globally.

If this works, we'll try to add this in the documentation itself as many people have been raising this.

For sure the documentation, I remember this coming up in the past, but couldn't remember the setting despite searching the issues forum for it to help out. Perhaps it should also get added to the nightwatch.conf.js base template (defaulting to not disabling the setting) with a comment above it explaining what it does like we do for the other common settings. I think most people ultimately use it in a pipeline where the boxes don't seem to format correctly though it is great when developing and running the tests locally in an IDE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants