Running integration tests in parallel for each test class, with multiple sub-projects

not-a-bug

(Aral Can Kaymaz) #1

Hello Gradle Forums,

I’ve been looking around for some time within the forums and the documentation, but I’m not sure exactly how I can achieve what I’m trying to do, and looking for some pointers. I’ve been stuck for some time now.

I have a main java project, with multiple sub-projects. Each sub-project has a their own integration testing classes. I’m utilizing the suggested paths for source codes, tests and resources. These integration tests do not depend on each other, and so I would like to run each class in parallel.

I have been reading some stuff around, such as:
1- https://guides.gradle.org/performance/
2- How to execute JUnit tests in parallel?
3- Can we run tasks in parallel in single build project
and many more links around that I can’t find right now.

I have tried with --parallel, maxParallelForks, have tried to create a new task for each class using the test class and using again --parallel.

As a last resort, I have been trying to implement it with WorkerAPI, but I could not wrap my head around how I can start the tests from within the Runnable interface.

What’s the best way to approach this? In summary, I would like to have parallelism both on sub-project and class level.

Thank you