diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2020-08-24 16:10:53 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2020-08-24 16:10:53 +0200 |
commit | 163b975b6d6899c434fe8502123a872aaaf4d12f (patch) | |
tree | d58f25a37412b0f98a21c4a0644186830d030a8f /vespa-testrunner-components/src/main/java/com/yahoo | |
parent | 8580fba57538e23e5d0e4192f9d18f14a8d9cd7a (diff) |
Treat no test jar like no staging/system tests: failure
Diffstat (limited to 'vespa-testrunner-components/src/main/java/com/yahoo')
-rw-r--r-- | vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java | 9 |
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); } + } + } |