aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-11-17 13:58:54 +0100
committerJon Marius Venstad <venstad@gmail.com>2021-11-17 13:58:54 +0100
commitbcd400f728dd80ad4d1100efc67b0a86d6b40360 (patch)
treefa07789297fad1994867e91a4923a315e00f6e83 /vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java
parent2e228e6836ac35522d517d4218f5e81c23362768 (diff)
Move TestProfile to module where it is used
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.java15
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 + "'");
+ }
+ }
+
}