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)?
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.
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.
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.
Your expectation is correct, except that maxParallelForks
is per test task (not per project).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With