UnsupportedOperationException if there are no requests sent during a simulation

I have a collection of library classes that I built to handle certain stuff for me.

I defined unit tests so I could make sure that those classes work correctly.

But since they are a Gatling library, I need to test them in the context of Gatling. So I declared a simulation trait:

trait UnitTest extends Simulation {
def behavior : ScenarioBuilder

setUp( behavior.inject( atOnceUsers( 1 ) ) )
.protocols( Default.httpConfig )
.pauses( if ( Test.usePauses ) exponentialPauses else disabledPauses )
.assertions( global.failedRequests.count.is( 0 ) )

In Gatling 2.x, this worked fine, even for code that just did assertions to make sure that everything was wired up as intended. Now in 3.2, the test is failing, presumably because the report generator complained about there being no requests generated. Is there a way to suppress that error? Or avoid generating it in the first place?

– John

Why don’t you just disable reports generation if your run is intended to not generate any request?

That’s a great idea. Looking at the SBT plugin docs, I don’t see how to do that. Can you point me to the relevant instructions?

noReports in conf.

So there is not a way to turn it off from the command line? I don’t want to avoid producing reports all the time, just when doing UnitTests.

command line option is -nr: https://gatling.io/docs/current/general/configuration/?highlight=command%20line

-nr –no-reports Runs simulation but does not generate reports