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: using custom interface in parallel mode #4688

Merged
merged 2 commits into from Jul 18, 2021
Merged

Conversation

juergba
Copy link
Member

@juergba juergba commented Jul 13, 2021

Description

see discussion in #4659, thanks to @love-expressen for his analysis.

When using the --ui option together with --parallel the ui option is not passed to the workers. This causes errors when running test files that depend on the UI being set up in the worker executing the test.

The root cause of the issue is that mocha refers to external UI:s in the options object as function references and not the UI identifier string. When the options object is being serialized all functions are (thankfully) ignored. This causes the mocha instance in the workers to default to the bdd UI.

Description of the Change

Mocha's native interfaces are cached in Mocha.interfaces as function references where each key corresponds to an interface name. The interface name can easily be serialized and passed to the parallel workers.
Now we use an identical approach for third party interfaces and add them to Mocha.interfaces.

Applicable issues

closes #4659

@juergba juergba self-assigned this Jul 13, 2021
@juergba juergba added type: bug a defect, confirmed by a maintainer area: parallel mode Regarding parallel mode semver-patch implementation requires increase of "patch" version number; "bug fixes" labels Jul 13, 2021
@juergba juergba added this to the next milestone Jul 13, 2021
@juergba juergba marked this pull request as ready for review July 14, 2021 15:19
@juergba juergba requested a review from a team July 14, 2021 15:19
@juergba juergba merged commit 3722201 into master Jul 18, 2021
@juergba juergba deleted the juergba/ui-parallel branch July 18, 2021 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: parallel mode Regarding parallel mode semver-patch implementation requires increase of "patch" version number; "bug fixes" type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom UI option is not passed to parallel workers
1 participant