From 15d5a074b0f2ba13d1880ed54420f1e8a6797209 Mon Sep 17 00:00:00 2001 From: Pedro Igor Date: Mon, 20 Dec 2021 17:18:44 -0300 Subject: [PATCH] Avoid building configuration all the time when running tests Closes #9262 --- ...cloakQuarkusServerDeployableContainer.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusServerDeployableContainer.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusServerDeployableContainer.java index 3374f9c047..fc2294a4ca 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusServerDeployableContainer.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusServerDeployableContainer.java @@ -152,8 +152,6 @@ public class KeycloakQuarkusServerDeployableContainer implements DeployableConta commands.add("./kc.sh"); commands.add("start"); - commands.add("-Dquarkus.http.root-path=/auth"); - commands.add("--auto-build"); commands.add("--http-enabled=true"); if (Boolean.parseBoolean(System.getProperty("auth.server.debug", "false"))) { @@ -172,13 +170,20 @@ public class KeycloakQuarkusServerDeployableContainer implements DeployableConta commands.add("-Djboss.node.name=" + configuration.getRoute()); } - String cacheMode = System.getProperty("auth.server.quarkus.cluster.config", "local"); + // only run auto-build during restarts or when running cluster tests + if (restart.get() || "ha".equals(System.getProperty("auth.server.quarkus.cluster.config"))) { + commands.add("--auto-build"); + commands.add("--http-relative-path=/auth"); - if ("local".equals(cacheMode)) { - commands.add("--cache=local"); - } else { - commands.add("--cache-config-file=cluster-" + cacheMode + ".xml"); + String cacheMode = System.getProperty("auth.server.quarkus.cluster.config", "local"); + + if ("local".equals(cacheMode)) { + commands.add("--cache=local"); + } else { + commands.add("--cache-config-file=cluster-" + cacheMode + ".xml"); + } } + commands.addAll(getAdditionalBuildArgs()); return commands.toArray(new String[0]);