diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2018-02-06 14:54:10 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2018-02-07 09:49:35 +0100 |
commit | 7c39ad6cb4d0612f99f13894395bbbacfb281abc (patch) | |
tree | 54f0c983e696cccf3fa67e5aa93d905fecd95c24 /tests | |
parent | 75873f6400090795cefd51f8e469900d1df938f4 (diff) | |
download | sonarqube-7c39ad6cb4d0612f99f13894395bbbacfb281abc.tar.gz sonarqube-7c39ad6cb4d0612f99f13894395bbbacfb281abc.zip |
SONAR-10401 end of task log is always INFO and includes status
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/test/java/org/sonarqube/tests/ce/CeShutdownTest.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/src/test/java/org/sonarqube/tests/ce/CeShutdownTest.java b/tests/src/test/java/org/sonarqube/tests/ce/CeShutdownTest.java index 1193f9e1008..62dabd40247 100644 --- a/tests/src/test/java/org/sonarqube/tests/ce/CeShutdownTest.java +++ b/tests/src/test/java/org/sonarqube/tests/ce/CeShutdownTest.java @@ -22,7 +22,6 @@ package org.sonarqube.tests.ce; import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.build.SonarScanner; import java.io.File; -import java.io.IOException; import java.util.regex.Pattern; import org.apache.commons.io.FileUtils; import org.junit.Rule; @@ -70,6 +69,7 @@ public class CeShutdownTest { ce.resumeTask(); watch.waitForLog(); assertThat(ce.hasTaskFinishedSuccessfully()).isTrue(); + assertThat(ce.hasTaskFinishedInFailure()).isFalse(); assertThat(ce.hasErrorLogs()).isFalse(); } } @@ -97,6 +97,7 @@ public class CeShutdownTest { try (LogsTailer.Watch watch = ce.logs().watch("Process [ce] is stopped")) { watch.waitForLog(); assertThat(ce.hasTaskFinishedSuccessfully()).isFalse(); + assertThat(ce.hasTaskFinishedInFailure()).isTrue(); assertThat(ce.hasErrorLogs()).isTrue(); } } @@ -146,7 +147,11 @@ public class CeShutdownTest { } boolean hasTaskFinishedSuccessfully() { - return content.hasLineMatching(Pattern.compile(".* INFO .*Executed task \\| project=foo \\| type=REPORT.*")); + return content.hasLineMatching(Pattern.compile(".* INFO .*Executed task \\| project=foo \\| type=REPORT.*\\| status=SUCCESS.*")); + } + + boolean hasTaskFinishedInFailure() { + return content.hasLineMatching(Pattern.compile(".* INFO .*Executed task \\| project=foo \\| type=REPORT.*\\| status=FAILED.*")); } boolean hasErrorLogs() { |