diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java index 9a3ebcf051b5b..dc8f968281772 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java @@ -373,7 +373,7 @@ private QuarkusDevModeLauncher newLauncher() throws Exception { .debugPort(System.getProperty("debugPort")) .suspend(System.getProperty("suspend")); if (System.getProperty(IO_QUARKUS_DEVMODE_ARGS) == null) { - builder.jvmArgs("-Dquarkus.test.basic-console=true") + builder.jvmArgs("-Dquarkus.console.basic=true") .jvmArgs("-Dio.quarkus.force-color-support=true"); } diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/IDELauncherImpl.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/IDELauncherImpl.java index 508e3addc5873..881b28b7935d5 100644 --- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/IDELauncherImpl.java +++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/IDELauncherImpl.java @@ -33,7 +33,7 @@ public class IDELauncherImpl implements Closeable { public static Closeable launch(Path classesDir, Map context) { System.setProperty(FORCE_COLOR_SUPPORT, "true"); - System.setProperty("quarkus.test.basic-console", "true"); //IDE's don't support raw mode + System.setProperty("quarkus.console.basic", "true"); //IDE's don't support raw mode final Path projectDir = BuildToolHelper.getProjectDir(classesDir); if (projectDir == null) { throw new IllegalStateException("Failed to locate project dir for " + classesDir); diff --git a/integration-tests/maven/src/test/resources-filtered/projects/multijar-module/runner/src/main/resources/application.properties b/integration-tests/maven/src/test/resources-filtered/projects/multijar-module/runner/src/main/resources/application.properties index e617a433772cb..c4cabe9348fd5 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/multijar-module/runner/src/main/resources/application.properties +++ b/integration-tests/maven/src/test/resources-filtered/projects/multijar-module/runner/src/main/resources/application.properties @@ -1,4 +1,5 @@ #quarkus.test.continuous-testing=enabled -#quarkus.test.basic-console=true +#quarkus.console.basic=true quarkus.live-reload.instrumentation=false -greeting=hello \ No newline at end of file +greeting=hello + diff --git a/integration-tests/maven/src/test/resources-filtered/projects/multimodule/runner/src/main/resources/application.properties b/integration-tests/maven/src/test/resources-filtered/projects/multimodule/runner/src/main/resources/application.properties index 4a57095af9477..a64943dd1ae62 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/multimodule/runner/src/main/resources/application.properties +++ b/integration-tests/maven/src/test/resources-filtered/projects/multimodule/runner/src/main/resources/application.properties @@ -1,3 +1,4 @@ greeting=bonjour quarkus.test.continuous-testing=enabled -quarkus.test.basic-console=true \ No newline at end of file +quarkus.console.basic=true + diff --git a/test-framework/junit5-internal/src/main/java/io/quarkus/test/ContinuousTestingTestUtils.java b/test-framework/junit5-internal/src/main/java/io/quarkus/test/ContinuousTestingTestUtils.java index 36197e7d12997..e1d4ef64c888d 100644 --- a/test-framework/junit5-internal/src/main/java/io/quarkus/test/ContinuousTestingTestUtils.java +++ b/test-framework/junit5-internal/src/main/java/io/quarkus/test/ContinuousTestingTestUtils.java @@ -49,7 +49,7 @@ public Boolean call() throws Exception { } public static String appProperties(String... props) { - return "quarkus.test.continuous-testing=enabled\nquarkus.test.display-test-output=true\nquarkus.test.basic-console=true\nquarkus.test.disable-console-input=true\n" + return "quarkus.test.continuous-testing=enabled\nquarkus.test.display-test-output=true\nquarkus.console.basic=true\nquarkus.test.disable-console-input=true\n" + String.join("\n", Arrays.asList(props)); } diff --git a/test-framework/maven/src/main/java/io/quarkus/maven/it/continuoustesting/ContinuousTestingMavenTestUtils.java b/test-framework/maven/src/main/java/io/quarkus/maven/it/continuoustesting/ContinuousTestingMavenTestUtils.java index e04269ff3a200..477a6036033c8 100644 --- a/test-framework/maven/src/main/java/io/quarkus/maven/it/continuoustesting/ContinuousTestingMavenTestUtils.java +++ b/test-framework/maven/src/main/java/io/quarkus/maven/it/continuoustesting/ContinuousTestingMavenTestUtils.java @@ -76,7 +76,7 @@ public Boolean call() throws Exception { } public static String appProperties(String... props) { - return "quarkus.test.continuous-testing=enabled\nquarkus.test.display-test-output=true\nquarkus.test.basic-console=true\nquarkus.test.disable-console-input=true\n" + return "quarkus.test.continuous-testing=enabled\nquarkus.test.display-test-output=true\nquarkus.console.basic=true\nquarkus.test.disable-console-input=true\n" + String.join("\n", Arrays.asList(props)); } diff --git a/test-framework/maven/src/main/java/io/quarkus/maven/it/continuoustesting/TestModeContinuousTestingMavenTestUtils.java b/test-framework/maven/src/main/java/io/quarkus/maven/it/continuoustesting/TestModeContinuousTestingMavenTestUtils.java index cc625a009b565..15b4530ea586b 100644 --- a/test-framework/maven/src/main/java/io/quarkus/maven/it/continuoustesting/TestModeContinuousTestingMavenTestUtils.java +++ b/test-framework/maven/src/main/java/io/quarkus/maven/it/continuoustesting/TestModeContinuousTestingMavenTestUtils.java @@ -3,7 +3,11 @@ import static org.awaitility.Awaitility.await; import static org.junit.jupiter.api.Assertions.fail; +import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -18,10 +22,16 @@ public class TestModeContinuousTestingMavenTestUtils extends ContinuousTestingMa // Example output we look for // 1 test failed (1 passing, 0 skipped), 1 test was run in 217ms. Tests completed at 21:22:34 due to changes to HelloResource$Blah.class and 1 other files. // All 2 tests are passing (0 skipped), 2 tests were run in 1413ms. Tests completed at 21:22:33. - private static final Pattern ALL_PASSING = Pattern.compile("All (\\d\\d*) tests are passing \\((\\d\\d*) skipped\\)", + // Windows log, despite `quarkus.console.basic=true', might contain terminal control symbols, colour decorations. + // e.g. the matcher is then fighting: 1 test failed (1 passing, 0 skipped) + private static final Pattern ALL_PASSING = Pattern.compile( + "(?:\\e\\[[\\d;]+m)*All (\\d+) tests are passing \\((\\d+) skipped\\)", Pattern.MULTILINE); private static final Pattern SOME_PASSING = Pattern - .compile("(\\d\\d*) tests? failed \\((\\d\\d*) passing, (\\d\\d*) skipped\\)", Pattern.MULTILINE); + .compile( + "(?:\\e\\[[\\d;]+m)*(\\d+) tests? failed(?:\\e\\[[\\d;]+m)* \\((?:\\e\\[[\\d;]+m)*(\\d+) " + + "passing(?:\\e\\[[\\d;]+m)*, (?:\\e\\[[\\d;]+m)*(\\d+) skipped(?:\\e\\[[\\d;]+m)*\\)", + Pattern.MULTILINE); private static final String TESTS_COMPLETED = "Tests completed at"; private final RunningInvoker running; private int startPosition = 0; @@ -39,7 +49,7 @@ public TestStatus waitForNextCompletion() { .atMost(3, TimeUnit.MINUTES).until(() -> getLogSinceLastRun().contains(TESTS_COMPLETED)); TestStatus testStatus = new TestStatus(); try { - String log = getLogSinceLastRun(); + final String log = getLogSinceLastRun(); Matcher matcher = ALL_PASSING.matcher(log); int failCount; @@ -52,7 +62,15 @@ public TestStatus waitForNextCompletion() { } else { matcher = SOME_PASSING.matcher(log); if (!matcher.find()) { - fail("Tests were run, but the log is not parseable with the patterns we know. This is the log\n: " + log); + final Path f = File.createTempFile("quarkus-maven-test-debug-log", ".txt").toPath(); + Files.writeString(f, log, StandardCharsets.UTF_8); + fail("Tests were run, but the log is not parseable with the patterns we know, " + System.lineSeparator() + + "i.e. neither \"" + ALL_PASSING.pattern() + "\" nor \"" + SOME_PASSING.pattern() + "\"." + + System.lineSeparator() + + " Note that possible terminal control characters might not be seen here. " + System.lineSeparator() + + + "Check the text file dump too: " + f.toAbsolutePath() + ". This is the log:" + + System.lineSeparator() + log); } failCount = Integer.parseInt(matcher.group(1)); passCount = Integer.parseInt(matcher.group(2));