From 7d78eec5b2d58940d36fb8fe4c1d4cd9c6a3edf8 Mon Sep 17 00:00:00 2001 From: Lucas Monteiro Date: Tue, 9 Apr 2024 22:08:00 -0300 Subject: [PATCH] test: update gatling configs to run performance tests --- .../src/gatling/kotlin/AdminDoCatalogoPerformanceTest.kt | 2 +- infrastructure/src/gatling/kotlin/CategoryPerformanceTest.kt | 4 ++-- infrastructure/src/gatling/kotlin/Configuration.kt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/infrastructure/src/gatling/kotlin/AdminDoCatalogoPerformanceTest.kt b/infrastructure/src/gatling/kotlin/AdminDoCatalogoPerformanceTest.kt index 9116209a..2293536a 100644 --- a/infrastructure/src/gatling/kotlin/AdminDoCatalogoPerformanceTest.kt +++ b/infrastructure/src/gatling/kotlin/AdminDoCatalogoPerformanceTest.kt @@ -66,7 +66,7 @@ class AdminDoCatalogoPerformanceTest : Simulation() { init { setUp( scenario.injectClosed( - constantConcurrentUsers(100).during(360) + constantConcurrentUsers(100).during(300) ).protocols(httpProtocol) ) } diff --git a/infrastructure/src/gatling/kotlin/CategoryPerformanceTest.kt b/infrastructure/src/gatling/kotlin/CategoryPerformanceTest.kt index 1d00c388..222fdedb 100644 --- a/infrastructure/src/gatling/kotlin/CategoryPerformanceTest.kt +++ b/infrastructure/src/gatling/kotlin/CategoryPerformanceTest.kt @@ -5,6 +5,7 @@ import io.gatling.javaapi.core.CoreDsl.scenario import io.gatling.javaapi.core.Simulation import io.gatling.javaapi.http.HttpDsl.http import io.gatling.javaapi.http.HttpDsl.status +import java.time.Duration class CategoryPerformanceTest : Simulation() { @@ -72,8 +73,7 @@ class CategoryPerformanceTest : Simulation() { init { setUp( scenario.injectClosed( - constantConcurrentUsers(100).during(360) - // rampConcurrentUsers(10).to(20).during(10) + constantConcurrentUsers(100).during(Duration.ofMinutes(5)) ).protocols(httpProtocol) ) diff --git a/infrastructure/src/gatling/kotlin/Configuration.kt b/infrastructure/src/gatling/kotlin/Configuration.kt index fbc1d987..c01c6b66 100644 --- a/infrastructure/src/gatling/kotlin/Configuration.kt +++ b/infrastructure/src/gatling/kotlin/Configuration.kt @@ -1,7 +1,7 @@ object Configuration { - const val TOKEN_URL = "http://localhost:18080/realms/codeflix/protocol/openid-connect/token" + const val TOKEN_URL = "http://keycloak.internal:8443/realms/codeflix/protocol/openid-connect/token" const val CLIENT_ID = "admin-do-catalogo" - const val CLIENT_SECRET = "aougNuf62ULKc1QSA8yeXDCy6VdJ6Bu3" + const val CLIENT_SECRET = "Td5scdSINqzhib0ket0UFUnvEPP6KAal" const val USERNAME = "lukinhasssss" const val PASSWORD = "123456" const val GRANT_TYPE = "password"