I saw that if I make a bunch of checks for requests, for example, the most popular one, check the status code 200 OK, or some slightly different ones, parsing a response body and looking for specific values. So, these errors exist at the end of the stack trace, and in general, in the report, anyone can see these errors, but these errors do not fail the Gradle task in any way. That is the Gradle task has the exit status - 0. That is a successful “build”.
exec( getAccessTokenRq() .check(status().is(Status.OK)) .check(jsonPath("$.token").saveAs("token")) );
For some reason, I thought that, for example, these checks, which go immediately after the request, should also fail the Gradle task. But - no.
The only one configuration that fails the Gradle task is if I add assertions in the simulation, these assertions fail the build 100%.
Can someone please help me understand what setting to pass to Gatling so that when there are errors from the checks, it sends the status code -
1 to Gradle? Regardless of the number of those errors, even if there is 1 error - the build should be failed.
- Gradle higher - 7 version
- Gatling Gradle plugin -
id 'io.gatling.gradle' version '220.127.116.11'
- Java 17