st-tech / gatling-operator

Automating distributed Gatling load testing using Kubernetes operator
MIT License
68 stars 21 forks source link

Compatibility with Gatling >= 3.8.0 #84

Closed c4rth closed 8 months ago

c4rth commented 1 year ago

Thanks for the great job.

As my tests are written in java, I use a custom 'gatlingImage' build using Gatling 3.9.2.

But the execution of this image gives an error:

gatling-waiter pod/gatling-sample01-runner-6jfz9 labeled
gatling-waiter 1/1 pods are ready
gatling-runner Wait until 2023-03-30 08:38:57
gatling-runner GATLING_HOME is set to /opt/gatling
gatling-runner Do you want to run the simulation locally, on Gatling Enterprise, or just package it?
gatling-runner Type the number corresponding to your choice and press enter
gatling-runner [0] <Quit>
gatling-runner [1] Run the Simulation locally
gatling-runner [2] Package and upload the Simulation to Gatling Enterprise Cloud, and run it there
gatling-runner [3] Package the Simulation for Gatling Enterprise
gatling-runner [4] Show help and exit
gatling-runner Exception in thread "main" java.util.NoSuchElementException: next on empty iterator
gatling-runner     at scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
gatling-runner     at scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
gatling-runner     at scala.io.BufferedSource$BufferedLineIterator.next(BufferedSource.scala:82)
gatling-runner     at scala.io.BufferedSource$BufferedLineIterator.next(BufferedSource.scala:67)
gatling-runner     at io.gatling.bundle.BundleIO$$anon$2.readInt(BundleIO.scala:33)
gatling-runner     at io.gatling.plugin.io.input.InputChoice.inputInt(InputChoice.java:59)
gatling-runner     at io.gatling.plugin.io.input.InputChoice.inputFromList(InputChoice.java:113)
gatling-runner     at io.gatling.plugin.io.input.InputChoice.inputFromStringList(InputChoice.java:144)
gatling-runner     at io.gatling.bundle.commands.RunCommand.run(RunCommand.scala:59)
gatling-runner     at io.gatling.bundle.GatlingCLI$.main(GatlingCLI.scala:97)
gatling-runner     at io.gatling.bundle.GatlingCLI.main(GatlingCLI.scala)
gatling-runner gatling.sh has failed!
Stream closed EOF for default/gatling-sample01-runner-6jfz9 (gatling-runner)
Stream closed EOF for default/gatling-sample01-runner-6jfz9 (gatling-waiter)

Since Gatling 3.8.0 (to be confirmed), gatling.sh requires a run mode parameter

I tested by running my docker image and using the same args used by the gatling-runner container. The test is executed if the '-rm' parameter is added: gatling.sh -sf ${SIMULATIONS_DIR_PATH} -s com.example.gatling.TodoSimulation -rsf ${RESOURCES_DIR_PATH} -rf ${RESULTS_DIR_PATH} -nr -rm local

gold-kou commented 8 months ago

Done. https://github.com/st-tech/gatling-operator/pull/96