I would like to run two gatlingRun
tasks (created by gatling gradle plugin) with different parameters (on 2 environments) at the same time.
I know that new gradle provides Worker API, but this seems to be not applicable in this case.
Like you said, Gradle Worker API is not really applicable in your case because it enables parallel processing, but in the context of a single Task, as the documentation states:
The Worker API provides the ability to break up the execution of a task action into discrete units of work and then to execute that work concurrently and asynchronously.
In order to make different tasks run in parallel, you could maybe use Parallel execution feature. But note that you can run tasks in parallel only if when they belong to different sub-projects (of a same multi-project build):
Most builds consist of more than one project and some of those projects are usually independent of one another. 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.
If your build script is used "only" as a launcher for Gatlin load tests, then maybe you can implement your build script as a multi-projects build, with one sub-project per target environment to test; then you could enable the --parallel
option to execute the load test tasks in parallel.