I have been trying to integrate Gatling into a Scala 2.10 project with the sbt plugin. I understand I will have to use Gatling 2.0 because 2.1 is built only against Scala 2.11.
However, I can’t find a version of the plugin and test-framework that is compatible with 2.10. Do I need any specific versions and resolvers? What would the settings be?
BTW, I need the 2.10 version because I will need to write my own protocol based on my library.
Gatling 2.0.3 is compatible with scala 2.10.4.
Gatling 2.0.0 is available in maven.
For the plugin and test framework artifacts that are compatible with 2.11, please have a look at the 2.0->2.1 migration guide, which refers the previous versions.
Also note that versions were not aligned with Gatling back then, and so the latest version of the plugin compatible with 2.10 is 1.1.
Thanks for the answers. For the benefit of anybody else looking for the correct artifacts:
addSbtPlugin(“io.gatling” % “sbt-plugin” % “1.0”)
dependencies in build.sbt:
“io.gatling” % “gatling-core” % “2.0.3” % “test”,
“io.gatling.highcharts” % “gatling-charts-highcharts” % “2.0.3” % “test” ,
“io.gatling” % “test-framework” % “1.0” % “test”
We have project that cannot upgrade to scala 2.11 in any easy way. And we are stuck with scala 2.10
Being curious: what makes migrating to Scala 2.11 so complex? Macros?
And how is this related to the version Gatling uses? Do you wrote some specific stuff based on your own libraries?
Do I understand correctly that gatling 2.1.5 is built against scala 2.11 which means it can’t be run from sbt 0.13.8 which is built against scala 2.10?
And the solution then is to downgrade to gatling 2.0.3?
And if so, where can I find this version of gatling?
SBT is indeed built with with Scala 2.10, but it can compile and run Scala 2.11 just fine.
Oh, thanks. I’m totally new to java, scala, gatling, everything. I’m trying to set up gatling with sbt and right now. I’m doing some of my editing in intellij IDEA, which right now is not recognizing the io.gatling.sbt.GatlingPlugin._ import in my root build.sbt (nor in the build.scala configuration). Compiling from the sbt console works fine so I’m not sure yet if the problem is just with intellij. Any ideas?
Be (somewhat) reassured, it’s just an issue in IntelliJ.
As long as SBT itself works as expected, you’re good!
You can of course make all these IntelliJ and Eclipse problems disappear by moving to Vim or Emacs.
It seems that you’re right. For now I’ve abandoned intellij and its SBT integration. Hopefully I’ll get back to it once I have things working and I have a better understanding of everything. Once I started from the example here and worked directly from sbt, everything seems to work. Now I’m trying to figure out where to put my request bodies (and EL files) and feeds. Opening a “bodies” folder under src/test/scala doesn’t seem to work.
Also, is there any documentation of the various gatling-sbt settings (inherited, configurable)?
It seems that you're right. For now I've abandoned intellij and its SBT
integration. Hopefully I'll get back to it once I have things working and I
have a better understanding of everything. Once I started from the example
here <https://github.com/gatling/gatling-sbt-plugin-demo> and worked
directly from sbt, everything seems to work. Now I'm trying to figure out
where to put my request bodies (and EL files) and feeds. Opening a "bodies"
folder under src/test/scala doesn't seem to work.
Simply put your files under src/test/resources, and you're good to go
Also, is there any documentation of the various gatling-sbt settings
Opening a “bodies” folder under src/test/scala doesn’t seem to work.
You can specify your data and bodies’ directories in gatling.conf (but the SBT plugin may use the resources directory by default)
For now I’ve abandoned intellij and its SBT integration
I’ll do a little write up on my Vim, Scala and SBT setup, for those who may be new to Scala and post it to the list. This is not to discredit any other editor, but I just don’t feel a heavyweight IDE is necessary when writing EL.
I have written an automated basic Scala environment set-up here:
Thanks Pierre, that worked. Is there an API to know where Gatling is looking for bodies files? It seems like I need to write to this location to pass data between simulations.