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

Parallel suites/tests execution #13

Open
SheliakLyr opened this issue Feb 1, 2024 · 4 comments
Open

Parallel suites/tests execution #13

SheliakLyr opened this issue Feb 1, 2024 · 4 comments

Comments

@SheliakLyr
Copy link

Scalatest can run suites and individual tests in multiple threads.

Is it possible to achieve that using this integration?

@cheeseng
Copy link
Contributor

@SheliakLyr Sorry for replying late, for some reason I just notice this message. If you are referring to the JUnit5 test engine implementation, then I think there's more a question for JUnit 5 runner, e.g. you may try https://www.baeldung.com/junit-5-parallel-tests . Afaik JUnit5 runner will call into ScalaTestEngine to execute JUnit5 platform, and JUnit5 runner may do that in parallal manner.

I'll investigate if ParallelTestExecution will work correct with this integration.

@cheeseng
Copy link
Contributor

Ok seeing from this line here:

https://github.com/scalatest/scalatestplus-junit5/blob/main/src/main/scala/org/scalatestplus/junit5/ScalaTestEngine.scala#L282

None is being passed as distributor, so the tests in ParallelTestExecution won't be run in parallel, I'll try to see if I can make it to pass in a distributor to support parallel execution.

@cheeseng
Copy link
Contributor

@SheliakLyr Fyi I submitted the following PR to support ParallelTestExecution:

#18

@SheliakLyr
Copy link
Author

Hi @cheeseng

Sorry for the late reply, I am still very interested about this topic.

Running test cases in a single suite concurrently would be great, but I currently cannot event run separate suites in parallel. I have tried the link you provided, but tests still run in a single-threaded mode. For completeness, I did check your PR, but nothing changes.

I suspect, that your assumption about junit runner is false:

JUnit5 runner may do that in parallal manner

I think that the article you linked refers to a different TestEngine (JupiterTestEngine), which does, in fact, support parallel execution. The property junit.jupiter.execution.parallel.enabled is defined in interface org.junit.jupiter.engine.config.JupiterConfiguration.

My reasearch suggests, that TestEngine implementations are responsible for the parallelization of the executed suites.

A kind-of related issue: junit-team/junit5#2229

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

No branches or pull requests

2 participants