How to run junit test classes in parallel but list a few gradle exceptions

I would like to run all junit test classes in parallel (due to the settings in each test, I DO NOT want the tests in the same class to work in parallel or they step on each other with false state changes)

However, I have some selenium tests that should run sequentially, but can be run during other tests.

  • Can gradle run test classes in parallel without running tests inside the class in parallel (again due to general state)
  • Is it possible to exclude some tests that should be performed sequentially.

thanks dean

+7
junit4 gradle
source share
2 answers

I am more Maven-oriented, but should not create a new task for gradle and set values ​​for the maxParallelForks and forkEvery properties (perhaps this property should be set to 1) do the job?

Something like an example

+1
source share

According to their documentation and some of their topics in the forum, if you use a test script in parallel, it starts new processes based on the maxParallelForks property you maxParallelForks , and in these spawned processes it will run forkEvery no. test classes. You can run some of the tasks sequentially, specifying them as dependent on each other.

+1
source share

All Articles