Skip to content

Fix: using custom interface in parallel mode#4688

Merged
juergba merged 2 commits into
masterfrom
juergba/ui-parallel
Jul 18, 2021
Merged

Fix: using custom interface in parallel mode#4688
juergba merged 2 commits into
masterfrom
juergba/ui-parallel

Conversation

@juergba

@juergba juergba commented Jul 13, 2021

Copy link
Copy Markdown
Contributor

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 force-pushed the juergba/ui-parallel branch from b7f1ca5 to 7c865f4 Compare July 14, 2021 15:01
@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
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