summaryrefslogtreecommitdiffstats
path: root/vespa-testrunner-components
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-11-17 19:28:27 +0100
committerJon Marius Venstad <venstad@gmail.com>2021-11-17 19:28:27 +0100
commitfbdc8549df12ffd68f470bdbabff72d49951cf61 (patch)
tree99990861e8a28b1573f1e979f44b8d67903a7faf /vespa-testrunner-components
parent7cddf841ac8774ecb1d359cac7e1c65059314733 (diff)
Have registry injected, and wrap runners in an aggregate
Diffstat (limited to 'vespa-testrunner-components')
-rw-r--r--vespa-testrunner-components/src/main/java/com/yahoo/vespa/hosted/testrunner/TestRunner.java13
1 files changed, 11 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 8aa2cd7bc72..06f7d317b0e 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
@@ -21,6 +21,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.SortedMap;
+import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.function.Function;
import java.util.logging.Level;
@@ -112,24 +113,32 @@ public class TestRunner implements com.yahoo.vespa.testrunner.TestRunner {
return builder;
}
- public synchronized void test(Suite suite, byte[] testConfig) {
+ @Override
+ public synchronized CompletableFuture<?> 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(toProfile(suite), testConfig)).start();
+ return CompletableFuture.runAsync(() -> runTests(toProfile(suite), testConfig));
}
+ @Override
public Collection<LogRecord> getLog(long after) {
return log.tailMap(after + 1).values();
}
+ @Override
public synchronized Status getStatus() {
return status;
}
+ @Override
+ public boolean isSupported() {
+ return listFiles(artifactsPath).stream().anyMatch(file -> file.toString().endsWith("tests.jar"));
+ }
+
private void runTests(TestProfile testProfile, byte[] testConfig) {
ProcessBuilder builder = testBuilder.apply(testProfile);
{