diff options
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.java | 15 |
1 files changed, 12 insertions, 3 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 0f6e26d256f..f31390e9933 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 @@ -4,7 +4,6 @@ package com.yahoo.vespa.hosted.testrunner; import com.google.inject.Inject; import com.yahoo.vespa.defaults.Defaults; import com.yahoo.vespa.testrunner.legacy.LegacyTestRunner; -import com.yahoo.vespa.testrunner.legacy.TestProfile; import org.fusesource.jansi.AnsiOutputStream; import org.fusesource.jansi.HtmlAnsiOutputStream; @@ -114,14 +113,14 @@ public class TestRunner implements LegacyTestRunner { return builder; } - public synchronized void test(TestProfile testProfile, byte[] testConfig) { + public synchronized void test(Suite suite, byte[] testConfig) { if (status == Status.RUNNING) throw new IllegalArgumentException("Tests are already running; should not receive this request now."); log.clear(); status = Status.RUNNING; - new Thread(() -> runTests(testProfile, testConfig)).start(); + new Thread(() -> runTests(toProfile(suite), testConfig)).start(); } public Collection<LogRecord> getLog(long after) { @@ -210,4 +209,14 @@ public class TestRunner implements LegacyTestRunner { private NoTestsException(String message) { super(message); } } + static TestProfile toProfile(Suite suite) { + switch (suite) { + case SYSTEM_TEST: return TestProfile.SYSTEM_TEST; + case STAGING_SETUP_TEST: return TestProfile.STAGING_SETUP_TEST; + case STAGING_TEST: return TestProfile.STAGING_TEST; + case PRODUCTION_TEST: return TestProfile.PRODUCTION_TEST; + default: throw new IllegalArgumentException("Unknown test suite '" + suite + "'"); + } + } + } |