Manoj Mishra
Manoj Mishra

Reputation: 117

@Karate Gatling is not generating report when i hit the endpoint once

My Gatling Simulation class,

class <MyClass> extends Simulation {
  before {
    println("Simulation is about to start!")
  }
  val smapleTest = scenario("test").exec(karateFeature("classpath:demo/get-user.feature"))
  setUp(
    smapleTest.inject(rampUsers(1) over (10 seconds))).maxDuration(1 minutes)
  //).assertions(global.responseTime.mean.lt(35))
  after {
    println("Simulation is finished!")
  }
}

My get-user.feature file,

Scenario Outline: Hit wskadmin url
    Given http://172.17.0.1:5984/whisk_local_subjects/guest 
    And header Authorization = AdminAuth
    And header Content-Type = 'application/json'
    When method get
    Then status <stat>
    * print result
    Examples:
      | stat |
      | 200  |

When i run the simulation class, below console logs i am getting:

Simulation com.karate.openwhisk.performance.SmokePerformanceTest started...
13:20:48.877 [GatlingSystem-akka.actor.default-dispatcher-5] INFO  i.gatling.core.controller.Controller - InjectionStopped expectedCount=1
13:20:49.473 [GatlingSystem-akka.actor.default-dispatcher-4] INFO  com.intuit.karate - karate.env system property was: null 
13:20:49.525 [GatlingSystem-akka.actor.default-dispatcher-7] INFO  com.intuit.karate - [print] I am here in get-user
13:20:49.706 [GatlingSystem-akka.actor.default-dispatcher-4] DEBUG com.intuit.karate - request:
1 > GET http://172.17.0.1:5984/whisk_local_subjects/guest
1 > Accept-Encoding: gzip,deflate
1 > Authorization: Basic d2hpc2tfYWRtaW46c29tZV9wYXNzdzByZA==
1 > Connection: Keep-Alive
1 > Content-Type: application/json
1 > Host: 172.17.0.1:5984
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_144)

13:20:49.741 [GatlingSystem-akka.actor.default-dispatcher-4] DEBUG com.intuit.karate - response time in milliseconds: 34
1 < 200

Note: Here i am getting the response in 34 mili seconds, but gating is unable to generate the report. Below is the error message i am getting

Error:

Generating reports...
java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
  at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Caused by: java.lang.UnsupportedOperationException: There were no requests sent during the simulation, reports won't be generated
  at io.gatling.charts.report.ReportsGenerator.generateFor(ReportsGenerator.scala:48)
  at io.gatling.app.RunResultProcessor.generateReports(RunResultProcessor.scala:76)
  at io.gatling.app.RunResultProcessor.processRunResult(RunResultProcessor.scala:55)
  at io.gatling.app.Gatling$.start(Gatling.scala:68)
  at io.gatling.app.Gatling$.fromArgs(Gatling.scala:45)
  at io.gatling.app.Gatling$.main(Gatling.scala:37)
  at io.gatling.app.Gatling.main(Gatling.scala)
  ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.199 s
[INFO] Finished at: 2018-07-24T13:20:50+05:30
[INFO] Final Memory: 30M/332M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:2.2.4:test (default-cli) on project

openwhisk: Gatling failed.: Process exited with an error: 255 (Exit value: 255) -> [Help 1]

But if i run the same simulation file simple change in feature file as below

Scenario Outline: Hit wskadmin url
        Given http://172.17.0.1:5984/whisk_local_subjects/guest 
        And header Authorization = AdminAuth
        And header Content-Type = 'application/json'
        When method get
        Then status <stat>
        * print result
        Examples:
          | stat |
          | 200  |
          | 200  |

Then gatling generates the report. Please help me someone what is the root cause.

Upvotes: 1

Views: 1096

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58088

Thank you for your interest in karate-gatling and the very detailed report.

This is a bug, which we have fixed and just made a release for.

Can you upgrade your karate-gatling version to 0.8.0.1 and let me know how it goes ?

Upvotes: 1

Related Questions