From 8750d941408df7470bdcd835b3497fa8ce1ed89a Mon Sep 17 00:00:00 2001 From: andreaTP Date: Thu, 2 Dec 2021 18:03:46 +0000 Subject: [PATCH] [KEYCLOAK-19847] - Restore Docker Dist tests coverage --- .github/workflows/ci.yml | 2 +- .../java/org/keycloak/it/cli/dist/BuildCommandDistTest.java | 4 +++- .../java/org/keycloak/it/cli/dist/StartCommandDistTest.java | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23130e60b2..bf0cf659a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -414,7 +414,7 @@ jobs: - name: Run Quarkus Tests in Docker run: | - mvn clean install -nsu -B -f quarkus/tests/pom.xml -Dkc.quarkus.tests.dist=docker -Dtest=StartDevCommandTest | misc/log/trimmer.sh + mvn clean install -nsu -B -f quarkus/tests/pom.xml -Dkc.quarkus.tests.dist=docker | misc/log/trimmer.sh TEST_RESULT=${PIPESTATUS[0]} exit $TEST_RESULT diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/BuildCommandDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/BuildCommandDistTest.java index 7327fa56ba..688e8e4e77 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/BuildCommandDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/BuildCommandDistTest.java @@ -51,6 +51,8 @@ class BuildCommandDistTest { () -> "The Error Output:\n" + result.getErrorOutput() + "doesn't contains the expected string."); assertTrue(result.getErrorOutput().contains("For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command."), () -> "The Error Output:\n" + result.getErrorOutput() + "doesn't contains the expected string."); - assertEquals(4, result.getErrorStream().size()); + String errorString = ""; + for (String s: result.getErrorStream()) { errorString += s + "\n"; } + assertEquals(4, errorString.split("\n").length); } } diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/StartCommandDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/StartCommandDistTest.java index 0d0114598c..2576787111 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/StartCommandDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/StartCommandDistTest.java @@ -35,6 +35,8 @@ public class StartCommandDistTest extends StartCommandTest { void failIfAutoBuildUsingDevProfile(LaunchResult result) { assertTrue(result.getErrorOutput().contains("ERROR: You can not 'start' the server using the 'dev' configuration profile. Please re-build the server first, using 'kc.sh build' for the default production profile, or using 'kc.sh build --profile=' with a profile more suitable for production."), () -> "The Output:\n" + result.getErrorOutput() + "doesn't contains the expected string."); - assertEquals(4, result.getErrorStream().size()); + String errorString = ""; + for (String s: result.getErrorStream()) { errorString += s + "\n"; } + assertEquals(4, errorString.split("\n").length); } }