aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java')
-rw-r--r--vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java b/vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java
index 4308b0bba4c..5593b48aaa9 100644
--- a/vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java
+++ b/vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java
@@ -178,7 +178,7 @@ public class TestRunner implements LegacyTestRunner {
exception.printStackTrace(file);
}
catch (IOException ignored) { }
- status = Status.ERROR;
+ status = exception instanceof NoTestsException ? Status.FAILURE : Status.ERROR;
return;
}
status = success ? Status.SUCCESS : Status.FAILURE;
@@ -187,7 +187,7 @@ public class TestRunner implements LegacyTestRunner {
private void writeTestApplicationPom(TestProfile testProfile) throws IOException {
List<Path> files = listFiles(artifactsPath);
Path testJar = files.stream().filter(file -> file.toString().endsWith("tests.jar")).findFirst()
- .orElseThrow(() -> new IllegalStateException("No file ending with 'tests.jar' found under '" + artifactsPath + "'!"));
+ .orElseThrow(() -> new NoTestsException("No file ending with 'tests.jar' found under '" + artifactsPath + "'!"));
String pomXml = PomXmlGenerator.generatePomXml(testProfile, files, testJar);
testPath.toFile().mkdirs();
Files.write(testPath.resolve("pom.xml"), pomXml.getBytes());
@@ -204,4 +204,9 @@ public class TestRunner implements LegacyTestRunner {
}
}
+
+ static class NoTestsException extends RuntimeException {
+ private NoTestsException(String message) { super(message); }
+ }
+
}