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 global reporting in parallel mode (fixes #1205) #1861

Merged
merged 1 commit into from
Jan 22, 2019

Conversation

aberonni
Copy link
Collaborator

This is an attempt at fixing #1205 - I have fixed the original bug but some tests are failing and I cannot understand why. The test output is not very verbose and it does not point me in any direction.

Also I would have like to add a test case that reproduces the original bug but was not able to.

I'm opening this as WIP because I need some pointers

@lreading
Copy link

I don't fully understand the "why" as of yet, but it looks like the global-reporter is getting an undefined reporter passed to the constructor. The reporter param is actually supposed to be a string representing either a path to a reporter, or the name of a built-in reporter.

As a workaround for the failing tests, you could change line 26 in global-reporter.js to say:
this.reporterFile = reporter || 'junit'; // Default the reporter to junit if one is not provided

This will make the tests pass, but it is a bit of a hack. I don't fully understand how the code paths work yet, so it's hard for me to say why that is happening.

@aberonni
Copy link
Collaborator Author

@lreading thanks for the tip, I'll wait for @beatfactor to chip in on this, he might be able to confirm your hypothesis

@stale
Copy link

stale bot commented Dec 16, 2018

This issue has been automatically marked as stale because it has not had any recent activity.
If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.

@stale stale bot added the stale label Dec 16, 2018
@aberonni
Copy link
Collaborator Author

Not stale, @beatfactor please take a look whenever you can - not sure whether this is still relevant with the latest version. If it could be then I will rebase

@stale stale bot removed the stale label Dec 17, 2018
@aberonni aberonni force-pushed the fixes/fix-1205 branch 2 times, most recently from 7cd76fe to 7d744d2 Compare January 9, 2019 17:22
@aberonni
Copy link
Collaborator Author

aberonni commented Jan 9, 2019

@beatfactor I've rebased the branch and included the fix mentioned by @lreading above. It looks like it is working, and I cannot reproduce the bug anymore after testing 1206 here.

I tried adding a test case for the bug I'm fixing but didn't manage to, maybe it will be easier for you or you can point me in the right direction

lib/runner/global-reporter.js Outdated Show resolved Hide resolved
lib/runner/test-runners/default.js Show resolved Hide resolved
@beatfactor beatfactor added this to High priority in Nightwatch v1.0/v1.1 Jan 17, 2019
@aberonni aberonni changed the title WIP: Fix global reporting in parallel mode Fix global reporting in parallel mode (fixes #1205) Jan 21, 2019
return this.concurrency
.runMultiple(testEnvArray, modules)
.then(exitCode => {
this.reportResults();
Copy link
Member

Choose a reason for hiding this comment

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

this.reportResults() returns a Promise so we should wait for it.

Suggested change
this.reportResults();
return this.reportResults().then(hasFailures => {
return exitCode
})

@beatfactor beatfactor merged commit 342975e into nightwatchjs:master Jan 22, 2019
Nightwatch v1.0/v1.1 automation moved this from High priority to Closed Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants