development-and-dinosaurs/gatling-lambda-extension

support for gatling 3.5.0

Closed this issue · 2 comments

The latest version of gatling was published recently. I tried upgrading locally, and the changes required look pretty small:

diff --git a/src/main/scala/io/toolebox/gatlinglambdaextension/action/InvokeAction.scala b/src/main/scala/io/toolebox/gatlinglambdaextension/action/InvokeAction.scala
index f67d89e..7762949 100644
--- a/src/main/scala/io/toolebox/gatlinglambdaextension/action/InvokeAction.scala
+++ b/src/main/scala/io/toolebox/gatlinglambdaextension/action/InvokeAction.scala
@@ -71,7 +71,7 @@ class InvokeAction(
   override def clock: Clock = coreComponents.clock

   private def logSuccess(session: Session, start: Long, end: Long) {
-    statsEngine.logResponse(session, name, start, end, OK, None, None)
+    statsEngine.logResponse(session.scenario, session.groups, name, start, end, OK, None, None)
     next ! session.markAsSucceeded
   }

@@ -81,7 +81,7 @@ class InvokeAction(
       end: Long,
       message: String
   ) {
-    statsEngine.logResponse(session, name, start, end, KO, None, Some(message))
+    statsEngine.logResponse(session.scenario, session.groups, name, start, end, KO, None, Some(message))
     next ! session.markAsFailed
   }

diff --git a/src/main/scala/io/toolebox/gatlinglambdaextension/protocol/LambdaComponents.scala b/src/main/scala/io/toolebox/gatlinglambdaextension/protocol/LambdaComponents.scala
index 1e2583a..183f6ea 100644
--- a/src/main/scala/io/toolebox/gatlinglambdaextension/protocol/LambdaComponents.scala
+++ b/src/main/scala/io/toolebox/gatlinglambdaextension/protocol/LambdaComponents.scala
@@ -8,7 +8,7 @@ case class LambdaComponents(
     coreComponents: CoreComponents,
     lambdaProtocol: LambdaProtocol
 ) extends ProtocolComponents {
-  override def onStart: Session => Session = ProtocolComponents.NoopOnStart
+  override def onStart: Session => Session = Session.Identity

   override def onExit: Session => Unit = ProtocolComponents.Noop

Also, I don't use gradle and couldn't figure out how to set the version. No matter what I tried to configure, the version was always 0.2.1, so I built it with sbt in order to easily publish locally. Is there a way to publish locally using gradle to test changes in another project?

Hey Jo,

Thanks for raising this issue and looking into it so extensively.

I will take a look at this shortly and publish an update.

This service versions itself using the Git Versioner Plugin. If you run ./gradlew printVersion it'll tell you what the current calculated version is, then you can run ./gradlew publishToMavenLocal to publish a local build. You can then bring the new version into your project using Gradle by setting mavenLocal() as a repository, probably in your repositories block in your gradle file.

I'll try that, but I use sbt, which uses a local ivy repositories folder, but I think I can add m2 cache to it as well.