NCS-59 Create Load tests

This commit is contained in:
LQ63
2026-05-03 14:40:36 +02:00
parent 3fa39bb4f4
commit cec85a094d
6 changed files with 70 additions and 33 deletions
@@ -1,35 +1,13 @@
package simulations
import base.BaseSimulation
import endpoints.BoardEndpoints
import io.gatling.core.Predef._
import io.gatling.http.Predef._
/**
* Smoke test: verifies the cluster is reachable and the bearer token is accepted.
*
* Runs a single virtual user that hits GET /healthz and asserts:
* - HTTP 200
* - Response time under 2 000 ms
*
* Use this as a reference when writing new simulations.
*
* Run:
* ./gradlew gatlingRun -PbaseUrl=http://<cluster-service> -PauthToken=<token>
*/
class SmokeTestSimulation extends BaseSimulation {
private val healthzPath: String =
sys.props.getOrElse("healthz.path", "/healthz")
private val scn = scenario("Smoke Test")
.exec(
http(s"GET $healthzPath")
.get(healthzPath)
.check(status.is(200))
.check(responseTimeInMillis.lte(2000))
)
setUp(
scn.inject(atOnceUsers(1))
scenarioFromEndpoint(BoardEndpoints.createGame)
.inject(atOnceUsers(1))
).protocols(httpProtocol)
}