own vote
favorite
|
has anyone tried to fail the running Jenkins Job when Gatling asserts are not met or if the requests fail?
For instance:
- mark a Jenkins build as unstable when the Global mean value for the 95th percentile is under a specific value, say 1.2 sec for response time
- mark a Jenkins build as failed if a certain percent of requests are not answered
Does anyone have an idea how this can be achieved with the existing Maven / Jenkins plugins for Gatling.
my maven Plugin settings are:
~~<br><plugin><br> <groupId>io.gatling</groupId><br> <artifactId>gatling-maven-plugin</artifactId><br> <version>${gatling.version}</version><br> <configuration><br> <failOnError>true</failOnError><br> <simulationsFolder>src/test/scala</simulationsFolder><br> <runMultipleSimulations>true</runMultipleSimulations><br> <configFolder>src/main/resources</configFolder><br> </configuration><br> <executions><br> <execution><br> <id>GoOrBust</id><br> <phase>test</phase><br> <goals><br> <goal>execute</goal><br> </goals><br> <configuration><br> <simulationClass>mine.OnePunch</simulationClass><br> <failOnError>true</failOnError><br> </configuration><br> </execution><br> </executions><br></plugin><br>
~~
the<failOnError>true</failOnError>
will only influence the report generation but not the Jenkins Job (obviously).
I would prefer not to explicitly throw exceptions from inside the tests by doing custom exception monitoring / handling.
|
You have to use Assertions.
But it’s all or nothing: you can chose to fail or mark as unstable, but can’t chose either one depending on a given condition.