Do not use general debug log level for tests (#26242)

Closes #26241

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
This commit is contained in:
Martin Bartoš 2024-01-16 18:42:37 +01:00 committed by GitHub
parent af4954acb6
commit 8b552b34e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 13 deletions

View file

@ -88,7 +88,7 @@ public class BuildAndStartDistTest {
dist.setEnvVar("KEYCLOAK_ADMIN", nextUsername);
dist.setEnvVar("KEYCLOAK_ADMIN_PASSWORD", password);
CLIResult cliResult = dist.run("start-dev", "--log-level=debug");
CLIResult cliResult = dist.run("start-dev", "--log-level=org.keycloak.services:debug");
cliResult.assertMessage("Skipping create admin user. Admin already exists in realm 'master'.");
cliResult.assertStartedDevMode();

View file

@ -74,20 +74,13 @@ public class LoggingDistTest {
}
@Test
@Launch({ "start-dev", "--log-level=off,org.keycloak:warn,debug" })
@Launch({ "start-dev", "--log-level=off,org.keycloak:warn,warn" })
void testSetLastRootLevelIfMultipleSet(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
assertTrue(cliResult.getOutput().contains("DEBUG [io.netty.util.internal"));
assertFalse(cliResult.getOutput().contains("INFO [org.keycloak"));
cliResult.assertStartedDevMode();
}
@Test
@Launch({ "start-dev", "--log-level=off,org.keycloak:warn,debug" })
void testWinSetLastRootLevelIfMultipleSet(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
assertTrue(cliResult.getOutput().contains("DEBUG [io.netty.util.internal"));
assertFalse(cliResult.getOutput().contains("INFO [org.keycloak"));
assertFalse(cliResult.getOutput().contains("INFO"));
assertFalse(cliResult.getOutput().contains("DEBUG"));
assertFalse(cliResult.getOutput().contains("Listening on:"));
assertTrue(cliResult.getOutput().contains("WARN [org.keycloak"));
cliResult.assertStartedDevMode();
}