Skip to content
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

Test output gets mixed up when run in parallel #859

Closed
subhojit777 opened this issue Jun 22, 2017 · 14 comments
Closed

Test output gets mixed up when run in parallel #859

subhojit777 opened this issue Jun 22, 2017 · 14 comments
Labels
🐛 bug Defect / Bug ✅ accepted The core team has agreed that it is a good idea to fix this

Comments

@subhojit777
Copy link

Continued from #855

I am using nightwatch-cucumber to run the scenarios. The parallelism is achieved by gulp task runner. I am using gulp.parallel to run the tasks parallely.

gulpfile.js

const gulp = require('gulp');
const gulpNightwatch = require('gulp-nightwatch');

gulp.task('tag1', () => {
  return gulp.src('gulpfile.js')
    .pipe(gulpNightwatch({
      configFile: 'nightwatch.conf.js',
      cliArgs: {
        tag: 'tag1'
      }
    }));
});

gulp.task('tag2', () => {
  return gulp.src('gulpfile.js')
    .pipe(gulpNightwatch({
      configFile: 'nightwatch.conf.js',
      cliArgs: {
        tag: 'tag2'
      }
    }));
});

gulp.task('default', gulp.parallel('tag1', 'tag2'));
@charlierudolph
Copy link
Member

For simplicity would the following work? Allow parallelism via a CLI option such as --parallelism <max_concurrent_scenarios>. The default value would be 1 and the parallelism option would also be passed to formatters in order for them to use logic to prevent the output from getting jumbled.

@subhojit777
Copy link
Author

Yes that would work. BUT.. if someone is using cucumber-js indirectly (like nightwatch-cucumber) is it going to work. This parallelism you are talking about will only be for cucumber-js, it won't work for others. Nightwatch has its own method of running tests in parallel.

So the conclusion is - we should implement an approach so that it works for cucumber-js as well as any dependent packages.

@subhojit777
Copy link
Author

nightwatch-cucumber uses the parallel running strategy of nighwatch, although it didn't work for me

@charlierudolph
Copy link
Member

Okay, then we could expose the formatter option that tells cucumber-js that this is part of a parallel run and thus have the formatters act as if cucumber is running in parallel even if the parallelism is provided by something else

@subhojit777
Copy link
Author

then we could expose the formatter option that tells cucumber-js that this is part of a parallel run

by expose you mean mentioning in the README?

@charlierudolph
Copy link
Member

By expose I mean adding a configuration option that can be used by users and/or tools. It would be documented in one the markdown files linked on the README

@subhojit777
Copy link
Author

sounds good. Are you planning to add a CLI option.

@charlierudolph
Copy link
Member

There is already a CLI option for format options so it would be added to that

@charlierudolph charlierudolph added 🙏 help wanted Help wanted - not prioritized by core team good first issue Good for newcomers labels Aug 5, 2017
@charlierudolph
Copy link
Member

The only formatter this could apply to is the progress formatter (since the pretty formatter was just removed). Instead of printing a character each time a test step finishes, it could be updated to print a single character per test case (analogous to scenario) or print all the step characters when the test case finishes.

@localjo
Copy link

localjo commented Oct 6, 2017

I'm also using nightwatch-cucumber and running things in parallel across 14 different environments. The output is not only collated, but it also ends up being way too long and messages about failed tests end up getting lost because they are pushed past the limit of my terminal's history.

screen shot 2017-10-06 at 4 36 27 pm

A solution for me would be to have the progress indicators completely turned off and to only display the summary for each completed environment, ie;

15 scenarios (1 failed, 14 passed)
113 steps (4 failed, 11 skipped, 98 passed)
1m45.394s

However, I can't find a silent mode or a way to make cucumber stop printing some kind of output to the console.

@charlierudolph charlierudolph removed good first issue Good for newcomers hacktoberfest 🙏 help wanted Help wanted - not prioritized by core team labels Oct 2, 2019
@fmagaldea
Copy link

Hi,

What is the state of this output mix?
As of cucumber-js version 6.0.5 in parallel it's still a mess.

At least, a more detailed doc about formatting restrictions could help.

@aslakhellesoy aslakhellesoy added the 🐛 bug Defect / Bug label Feb 2, 2021
@aslakhellesoy aslakhellesoy added this to Next in Cucumber Open Feb 2, 2021
@aslakhellesoy aslakhellesoy added the ✅ accepted The core team has agreed that it is a good idea to fix this label Feb 2, 2021
@aurelien-reeves aurelien-reeves removed this from Next in Cucumber Open Feb 16, 2021
@aurelien-reeves
Copy link
Contributor

@subhojit777 @localjo nightwatch-cucumber being deprecated in favor of nightwatch-api, and cucumber-js having a good support for parallel executions with recent version, is this still an issue? Could we close it?

@fmagaldea your comment regarding cucumber outpout in parallel still apply? Does it concern nightwatch? If not, could we open a dedicated feature request for this with detailed example of how it is at the moment, and how it may be improved?

@f1ames
Copy link

f1ames commented Mar 2, 2022

@aurelien-reeves please see #1949. I have reported separate issue as you mentioned since we stumbled upon this (not nightwach related) in our project.

@aurelien-reeves
Copy link
Contributor

Thanks

So, closing this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Defect / Bug ✅ accepted The core team has agreed that it is a good idea to fix this
Projects
None yet
Development

No branches or pull requests

8 participants