NCS-59 Create Load tests
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user