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

fix: xml output generation for parallel tests #2734

Conversation

vaibhavsingh97
Copy link
Member

@vaibhavsingh97 vaibhavsingh97 commented Jun 8, 2021

Fixes #2728

Overview
XML output files are not generated when running parallel tests on multiple browsers, because when we run concurrent tests, we only check the master process to push the results to the 'GlobalReporter', but in fact, the tests are spawn through the child process.

@@ -51,7 +51,7 @@ module.exports = class GlobalReporter {
setupChildProcessListener(emitter) {
const Concurrency = require('../runner/concurrency/concurrency.js');

if (Concurrency.isMasterProcess()) {
if (Concurrency.isMasterProcess() || Concurrency.isChildProcess()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we remove the check altogether?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should, but I wasn't sure, why the check exists in the first place. Let me update the PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is for the scenario when running in parallel with test workers. A child process will send the results back to the main process. When running tests across multiple browsers, the results aren't called by the main process anymore so it doesn't work (since the bug), so we need to make sure that the test workers scenario still works well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can probably just change the check to !Concurrency.isTestWorker()

@Dharin-shah
Copy link
Contributor

Need to add test here

@beatfactor beatfactor merged commit ce47e48 into nightwatchjs:main Jun 15, 2021
@vaibhavsingh97 vaibhavsingh97 deleted the fix/no-xml-output-for-parallel-tests branch June 15, 2021 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XML output files are not generated when running parallel tests on multiple browsers
3 participants