How to debug/run a single gatling simulation in IntelliJ IDEA without sbt command?
Asked Answered
L

4

20

How could I debug or run the BasicSimulation.scala? Now I use sbt command to run: testOnly simulations:BasicSimulation Is there any other easy way to debug? Thanks.

Lindly answered 20/5, 2015 at 10:10 Comment(1)
Add some more details. What's going wrong, why doesn't testOnly help you? etc.Brunette
M
18

You can add a simple class and run it by right click->run . Something like here: https://github.com/puppetlabs/gatling-puppet-load-test/blob/master/simulation-runner/src/main/scala/com/puppetlabs/gatling/runner/PuppetGatlingRunner.scala

Massorete answered 3/6, 2015 at 12:32 Comment(2)
This looks like a fork of the launcher Gatling's maven archetype generates: github.com/gatling/gatling-maven/blob/master/… ;)Hallock
@StephaneLandelle can be. I was just looking for an available example.Massorete
C
1

If you want to run gatling tests inside the intellij, you can go to the edit configurations in the run toolbar on the top left and add a new sbt task.

On the task field enter testOnly simulations:BasicSimulation and that's it.

Normally you should be able to debug it by clicking the debug button, but it doesn't seems to be possible for the gatling tests at least in my configuration.

Capsular answered 20/5, 2015 at 12:11 Comment(1)
i tried that and got [error] Not a valid key: MySimulationUncial
I
1

According to actual documentation this is done like:

gatling:testOnly *BasicSimulation*

Here the Documentation

As with any SBT testing framework, you’ll be able to run Gatling simulations using SBT standard test, testOnly, testQuick, etc… tasks. However, since the SBT Plugin introduces many customizations that we don’t want interfering with unit tests, those commands are integrated into custom configurations, meaning you’ll need to prefix them with gatling or gatling-it, eg. gatling:test or gatling-it:test.

(I tested this in sbt console)

Identical answered 16/7, 2020 at 15:21 Comment(0)
M
0

Everything is nicely explained in the official documentation page of the gatling project:

http://gatling.io/docs/2.2/extensions/maven_archetype/

Just use their archetype to generate a project in maven and then import in any decent IDE and voilà

Mixologist answered 18/4, 2017 at 10:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.