We have created a plugin for RedLine13 users to execute Gatling tests using SBT + Java.
This is accomplished by first using SBT Assembly to package a JAR prepared with everything required to run the tests.
After the package is created you can test locally
java -jar target/scala-2.11/gatling-tests-as-jar-1.0.jar -s example.SomeGatlingSimulation
A community member provided an example project that can be used to model here. After we have used SBT to package our JAR, we can take the generated JAR file and scale this on RedLine13.com. Executing Gatling Tests via SBT + Java supports the same features as running Gatling tests via Simulations. You can aggregate the results and generate a full Gatling report + RedLine13 reports.
Getting Started With The Plugin
To begin using the plugin, log into your RedLine13 account, locate the “Account” tab, and navigate to “Your Plugins”
Next, install the SBT + Java Plugin by clicking the “+”. You can verify the instillation by navigating to the “Installed” tab:
Once the plugin is successfully installed, navigate back to your dashboard home, click “Start Test”, and then begin to create a new Gatling test. Upload your simulation that you generated in SBT, and be sure to click the “Save the response output from individual tests and calculate percentiles” (important: this will enable aggregated Gatling reports):
You will then want to scroll down and locate the “Advanced Gatling Test Options” tab. Here we will activate the plugin by checking the box next to “SBT with Java”. You will also want to inject the appropriate simulation class and any other parameters. Once this has been completed, you can then run your test.
Once your test has completed, you can view the results inside RedLine13. To access the generated Gatling report, navigate to the “Output Files” tab. Here you will find your generated Gatling report that you can download.
The Gatling report will be downloaded as a .TAR. Extract the files, navigate to the extracted “Report-Files” folder, and find your generated Gatling report (it will be a .HTML). Now you can simply drag the .HTML into your browser of choice, and can view your Gatling report:
With this plugin we now have three ways to execute Gatling Tests:
- Upload Simulation file
- Create and execute via Maven project
- Create Assembly via SBT and execute via java command