beloyar
beloyar

Reputation: 247

karate-gatling: report is not generated when gatling feeder and simulation workflow are failing due to a login request error

If login error occurs during a gatling simulation (without feeders) normally a gatling report is generated showing that login request is failed. The login request is called only once in the karate-config.js: karate.callSingle('classpath:login.feature', config);

After defining a gatling feeder which executes a karate feature to retrieve some existing data from a database to be used during simulation, the gatling report is not generated if login error occurs during a feeder initialization.

I have tried the following workarounds:

In both cases the gatling report is not generated due to java.lang.reflect.InvocationTargetException:

Caused by: UnsupportedOperationException: There were no requests sent during the simulation, reports won't be generated
        at io.gatling.charts.report.ReportsGenerator.generateFor(ReportsGenerator.scala:49)

Although 2 login requests are logged in the karate.log.

So, what is a proper way, to define feeders (executing login feature) in a such way, that login request is sent only once for the whole simulation and a report is generated even, if the login request is failed? As if a feeder hasn't been defined at all.

Upvotes: 1

Views: 674

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58128

If you use a feeder and call a Karate feature from that, as far as I know this is "outside" of the test from a reporting point of view. If it fails and the test stops, it is expected that you don't see any requests made at all. I don't see anything wrong with this personally, because a feeder is typically a one-time action that does not "count" when collecting metrics.

Kindly consider contributing to Karate since you seem to be pushing karate-gatling to limits I haven't seen before, thanks.

Upvotes: 0

Related Questions