How to make Jenkins fail when Gatling download tests go down

Has anyone tried to fail the Jenkins Job when Gatling statements fail, or if the requests fail?

For instance:

  • mark Jenkins as unstable when the global average for the 95th percentile is below a certain value, say 1.2 sec for response time
  • mark the Jenkins build unsuccessful if a certain percentage of requests did not respond

Does anyone have an idea how this can be achieved using existing Maven / Jenkins Gatling plugins.

My maven plugin settings:

<plugin> <groupId>io.gatling</groupId> <artifactId>gatling-maven-plugin</artifactId> <version>${gatling.version}</version> <configuration> <failOnError>true</failOnError> <simulationsFolder>src/test/scala</simulationsFolder> <runMultipleSimulations>true</runMultipleSimulations> <configFolder>src/main/resources</configFolder> </configuration> <executions> <execution> <id>GoOrBust</id> <phase>test</phase> <goals> <goal>execute</goal> </goals> <configuration> <simulationClass>mine.OnePunch</simulationClass> <failOnError>true</failOnError> </configuration> </execution> </executions> </plugin> 

<failOnError>true</failOnError> will only affect the generation of the report, but not the work of Jenkins (obviously).

I would prefer to not explicitly exclude exceptions from the tests, performing individual control / handling of exceptions.

+7
source share
2 answers
  1. Gatling Solution: You need to define a global statement in your Gatling script, for example:

     setUp(scn.inject( ... )) .protocols(httpProtocol) .assertions( global.successfulRequests.percent.greaterThan(99) ) 
  2. Alternative. You can run your Gatling script using the Taurus tool as a shell. He can use existing Gatling tests and apply flexible criteria for passing / failing to them. In the event of a failure, the Taurus trigger will return a non-zero exit code, therefore, the Jenkins job will fail.

+6
source

If Dmitry 1 failed for you, see https://groups.google.com/forum/#!topic/gatling/OjsdqXej2_s

 setUp(scn.inject( ... ) .protocols(httpProtocol)) .assertions( global.successfulRequests.percent.greaterThan(99) ) 
0
source

All Articles