From 1c8fddf8eace350d348aed61deb8d57cb51e9ed2 Mon Sep 17 00:00:00 2001 From: Cheryl King Date: Mon, 15 Jul 2024 17:08:17 -0500 Subject: [PATCH 1/2] Update messages related to running tests when skipTests is set to true --- .../tools/common/plugins/util/DevUtil.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java index dd995c4a..89b54830 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java @@ -691,6 +691,12 @@ public void runTests(boolean waitForApplicationUpdate, int messageOccurrences, T error(e.getMessage(), e); } } + } else { + if (projectName != null) { + info("Tests will not run on demand for " + projectName + " because skipTests is set to true."); + } else { + info("Tests will not run on demand because skipTests is set to true."); + } } } @@ -2522,12 +2528,15 @@ private void printDevModeMessages(boolean inputUnavailable, boolean startup) thr } private void printTestsMessage(boolean formatForAttention) { - if (hotTests) { - String message = "Tests will run automatically when changes are detected. You can also press the Enter key to run tests on demand."; - info(formatForAttention ? formatAttentionMessage("Enter - " + message) : message); - } else { - String message = "run tests on demand, press Enter."; - info(formatForAttention ? formatAttentionMessage("Enter - " + message) : "To " + message); + // setting skipTests to true overrides the setting of hotTests, and prevents any tests from running in dev mode (automatically or on demand) + if (!skipTests) { + if (hotTests) { + String message = "Tests will run automatically when changes are detected. You can also press the Enter key to run tests on demand."; + info(formatForAttention ? formatAttentionMessage("Enter - " + message) : message); + } else { + String message = "run tests on demand, press Enter."; + info(formatForAttention ? formatAttentionMessage("Enter - " + message) : "To " + message); + } } } From 409d413021e7ab72b600942fd24cbf9a9c1004e3 Mon Sep 17 00:00:00 2001 From: Cheryl King Date: Tue, 16 Jul 2024 16:30:46 -0500 Subject: [PATCH 2/2] review comment --- .../tools/common/plugins/util/DevUtil.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java index 89b54830..8556574d 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java @@ -2529,14 +2529,15 @@ private void printDevModeMessages(boolean inputUnavailable, boolean startup) thr private void printTestsMessage(boolean formatForAttention) { // setting skipTests to true overrides the setting of hotTests, and prevents any tests from running in dev mode (automatically or on demand) - if (!skipTests) { - if (hotTests) { - String message = "Tests will run automatically when changes are detected. You can also press the Enter key to run tests on demand."; - info(formatForAttention ? formatAttentionMessage("Enter - " + message) : message); - } else { - String message = "run tests on demand, press Enter."; - info(formatForAttention ? formatAttentionMessage("Enter - " + message) : "To " + message); - } + if (skipTests) { + return; + } + if (hotTests) { + String message = "Tests will run automatically when changes are detected. You can also press the Enter key to run tests on demand."; + info(formatForAttention ? formatAttentionMessage("Enter - " + message) : message); + } else { + String message = "run tests on demand, press Enter."; + info(formatForAttention ? formatAttentionMessage("Enter - " + message) : "To " + message); } }