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

Mocha parallel mode and Allure API #619

Closed
epszaw opened this issue Feb 20, 2023 · 5 comments · Fixed by #967
Closed

Mocha parallel mode and Allure API #619

epszaw opened this issue Feb 20, 2023 · 5 comments · Fixed by #967
Assignees
Labels
theme:mocha Mocha related issue type:bug Something isn't working

Comments

@epszaw
Copy link
Member

epszaw commented Feb 20, 2023

Describe the bug
We have a problem related to mocha parallel mode for a long time, there is some related issues in the repository: #485, #486.

To Reproduce
Steps to reproduce the behavior:

  1. Use allure mocha reporter in parallel mode
  2. Try to call any allure API method such as label
  3. You'll see an error in console

Expected behavior
We should be able to use Allure API with mocha in parallel mode.

Additional context
At this moment, the problem can't be solved because mocha parallel mode implementation. The running uses workerpool module, what doesn't work with plain node IPC messages. Additionally, mocha doesn't provide any way to send messages from tests to the reporter, what works in the main thread, so we can't do anything at this moment to make both parts work correctly.

As temporal solution, I suggest to use single thread mode, if you need Allure API.

All the updates about the problem I'll post here, in the issue.

@islam-tenovos
Copy link

@baev so it is the solution that error will be displayed only. I need help how to implement allure mocha for mocha parallel tests.

@baev
Copy link
Member

baev commented Apr 11, 2023

Mocha does not support the feature. From the issue description:

At this moment, the problem can't be solved because mocha parallel mode implementation. The running uses workerpool module, what doesn't work with plain node IPC messages. Additionally, mocha doesn't provide any way to send messages from tests to the reporter, what works in the main thread, so we can't do anything at this moment to make both parts work correctly.

We tried to connect with mocha developers to address the issue, actively pushing them for more than six months. So far, we have yet to be successful. They don't accept the PR, and they don't respond to issues.

It is not Allure specific issue. There is no other reporter that solves the same problem. I suggest using Mocha in single-threaded mode. Or rewrite the tests using playwright

@baev
Copy link
Member

baev commented Apr 11, 2023

If you have any idea how we can solve the problem -- feel free to mention it here, our team is always happy to help.

@islam-tenovos
Copy link

@baev can you or anyone in the team take a look on the project i have attached and see if there is any possibility to achieve the required. There are many tests we already written and working single thread with mocha and allure reporter. Now i want to run them parallel.
mocha-project.zip

@baev
Copy link
Member

baev commented Apr 11, 2023

if there is any possibility to achieve the required

I don't think this is possible without major Mocha refactoring and collaboration from the Mocha team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:mocha Mocha related issue type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants