summaryrefslogtreecommitdiffstats
path: root/vespa-osgi-testrunner/src/main/java/com/yahoo
diff options
context:
space:
mode:
Diffstat (limited to 'vespa-osgi-testrunner/src/main/java/com/yahoo')
-rw-r--r--vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/AggregateTestRunner.java1
-rw-r--r--vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java16
-rw-r--r--vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestReport.java14
-rw-r--r--vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestRunnerHandler.java1
4 files changed, 11 insertions, 21 deletions
diff --git a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/AggregateTestRunner.java b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/AggregateTestRunner.java
index bc4b776568a..6e3393b2761 100644
--- a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/AggregateTestRunner.java
+++ b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/AggregateTestRunner.java
@@ -84,7 +84,6 @@ public class AggregateTestRunner implements TestRunner {
.withFailedCount(first.failedCount + second.failedCount)
.withIgnoredCount(first.ignoredCount + second.ignoredCount)
.withSuccessCount(first.successCount + second.successCount)
- .withTotalCount(first.totalCount + second.totalCount)
.withFailures(merged(first.failures, second.failures))
.withLogs(merged(first.logLines, second.logLines))
.build();
diff --git a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java
index 929d01ee371..12d50ca725c 100644
--- a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java
+++ b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java
@@ -127,22 +127,22 @@ public class JunitRunner extends AbstractComponent implements TestRunner {
return logRecords.tailMap(after + 1).values();
}
- private static TestReport createReportWithFailedInitialization(Exception exception) {
+ static TestReport createReportWithFailedInitialization(Exception exception) {
TestReport.Failure failure = new TestReport.Failure("init", exception);
- return new TestReport.Builder()
- .withFailures(List.of(failure))
- .build();
+ return new TestReport.Builder().withFailures(List.of(failure))
+ .withFailedCount(1)
+ .build();
}
private Optional<Bundle> findTestBundle() {
return Stream.of(bundleContext.getBundles())
- .filter(this::isTestBundle)
- .findAny();
+ .filter(this::isTestBundle)
+ .findAny();
}
private boolean isTestBundle(Bundle bundle) {
var testBundleHeader = bundle.getHeaders().get("X-JDisc-Test-Bundle-Version");
- return testBundleHeader != null && !testBundleHeader.isBlank();
+ return testBundleHeader != null && ! testBundleHeader.isBlank();
}
private Optional<TestDescriptor> loadTestDescriptor(Bundle bundle) {
@@ -229,7 +229,7 @@ public class JunitRunner extends AbstractComponent implements TestRunner {
@Override
public TestRunner.Status getStatus() {
if (execution == null) return TestRunner.Status.NOT_STARTED;
- if (!execution.isDone()) return TestRunner.Status.RUNNING;
+ if ( ! execution.isDone()) return TestRunner.Status.RUNNING;
try {
return execution.get().status();
} catch (InterruptedException|ExecutionException e) {
diff --git a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestReport.java b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestReport.java
index 51e14f6b356..4db5405029b 100644
--- a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestReport.java
+++ b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestReport.java
@@ -16,7 +16,6 @@ import static com.yahoo.vespa.testrunner.TestRunner.Status.SUCCESS;
*/
public class TestReport {
- final long totalCount;
final long successCount;
final long failedCount;
final long inconclusiveCount;
@@ -25,8 +24,7 @@ public class TestReport {
final List<Failure> failures;
final List<LogRecord> logLines;
- private TestReport(long totalCount, long successCount, long failedCount, long inconclusiveCount, long ignoredCount, long abortedCount, List<Failure> failures, List<LogRecord> logLines) {
- this.totalCount = totalCount;
+ private TestReport(long successCount, long failedCount, long inconclusiveCount, long ignoredCount, long abortedCount, List<Failure> failures, List<LogRecord> logLines) {
this.successCount = successCount;
this.failedCount = failedCount;
this.inconclusiveCount = inconclusiveCount;
@@ -41,7 +39,7 @@ public class TestReport {
}
public TestRunner.Status status() {
- return failedCount > 0 ? FAILURE : inconclusiveCount > 0 ? INCONCLUSIVE : totalCount > 0 ? SUCCESS : NO_TESTS;
+ return failedCount > 0 ? FAILURE : inconclusiveCount > 0 ? INCONCLUSIVE : (successCount + abortedCount + ignoredCount) > 0 ? SUCCESS : NO_TESTS;
}
public static Builder builder(){
@@ -51,7 +49,6 @@ public class TestReport {
public static class Builder {
- private long totalCount;
private long successCount;
private long failedCount;
private long inconclusiveCount;
@@ -61,12 +58,7 @@ public class TestReport {
private List<LogRecord> logLines = Collections.emptyList();
public TestReport build() {
- return new TestReport(totalCount, successCount, failedCount, inconclusiveCount, ignoredCount, abortedCount, failures, logLines);
- }
-
- public Builder withTotalCount(long totalCount) {
- this.totalCount = totalCount;
- return this;
+ return new TestReport(successCount, failedCount, inconclusiveCount, ignoredCount, abortedCount, failures, logLines);
}
public Builder withSuccessCount(long successCount) {
diff --git a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestRunnerHandler.java b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestRunnerHandler.java
index e7b0fe406c7..3a611e62a75 100644
--- a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestRunnerHandler.java
+++ b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestRunnerHandler.java
@@ -142,7 +142,6 @@ public class TestRunnerHandler extends ThreadedHttpRequestHandler {
return slime;
var summary = root.setObject("summary");
- summary.setLong("total", testReport.totalCount);
summary.setLong("success", testReport.successCount);
summary.setLong("failed", testReport.failedCount);
summary.setLong("ignored", testReport.ignoredCount);