Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gradle --parallel and maxParallelForks

From the doc of gradle, it seems that these are two independent features?

Looking at the 56.8 section, it is not very clear to me that if tests will be run in parallel when maxParallelForks=1.

If these two are independent features, I would expect that tests under one project will never be run in parallel if maxParallelForks=1, but tests in different projects (thus belong to different test tasks) may run in parallel (when gradle --parallel used)?

like image 387
chuchao333 Avatar asked Aug 19 '13 03:08

chuchao333


People also ask

What is Gradle parallel?

Parallel execution Yet Gradle will only run one task at a time by default, regardless of the project structure (this will be improved soon). By using the --parallel switch, you can force Gradle to execute tasks in parallel as long as those tasks are in different projects.

How do I run a JUnit test in parallel Gradle?

in the src/test/resources/junit-platform. properties file. After adding this, the option to run tests in parallel is turned on. However, since JUnit 5 runs both classes and methods in a single thread by default, this won't change a thing.

How do you run a cucumber test in parallel using Gradle?

Cucumber can be executed in parallel using JUnit and Maven test execution plugins. In JUnit the feature files are run in parallel rather than scenarios, which means all the scenarios in a feature file will be executed by the same thread. You can use either Maven Surefire or Failsafe plugin to execute the runners.


1 Answers

Your expectation is correct, except that maxParallelForks is per test task (not per project).

like image 73
Peter Niederwieser Avatar answered Oct 16 '22 07:10

Peter Niederwieser