Overriding some of the gatling.conf properties from command line with Gradle

Is it possible to pass the run description when starting a Gatling simulation from command line?

Usually I start it with a Gradle command like: ./gradlew gatlingRun-com.foo.bar.MySimulation

I would like to pass arguments for the run description, the results directory or any other parameter which is defined in the gatling.conf resource file. It should override whatever is configured in gatling.conf.

My intention is not to set from command line which gatling.conf file I would like to use when starting a simulation but to override a property from that file.

Is that possible with a Gradle command and how?

gatling.conf uses the LightBend Config library:

  • users can override the config with Java system properties, java -Dmyapp.foo.bar=10

So you can do ./gradlew gatlingRun-com.foo.bar.MySimulation -Pfoo=bar to override a configuration defined in the file with one from a System Property.

It now worked with as expected. Thank you.

/gradlew gatlingRun-com.foo.bar.MySimulation -Dgatling.core.runDescription="abcde"