summaryrefslogtreecommitdiffstats
path: root/vespa-osgi-testrunner
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2022-03-03 08:16:49 +0100
committerJon Marius Venstad <venstad@gmail.com>2022-03-03 08:16:49 +0100
commite5015352461dd5a67045e9e53440b85078a45a72 (patch)
treebd910fa5de1fb508c22f9d30f3d8e52b1764184a /vespa-osgi-testrunner
parent8d9f15e64665cffe87ca345eb6d972a65bdd453d (diff)
Include inconclusive count in tessts report
Diffstat (limited to 'vespa-osgi-testrunner')
-rw-r--r--vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestRunnerHandler.java1
-rw-r--r--vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java3
2 files changed, 3 insertions, 1 deletions
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 3a611e62a75..a4c4023c270 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
@@ -146,6 +146,7 @@ public class TestRunnerHandler extends ThreadedHttpRequestHandler {
summary.setLong("failed", testReport.failedCount);
summary.setLong("ignored", testReport.ignoredCount);
summary.setLong("aborted", testReport.abortedCount);
+ summary.setLong("inconclusive", testReport.inconclusiveCount);
var failureRoot = summary.setArray("failures");
testReport.failures.forEach(failure -> serializeFailure(failure, failureRoot.addObject()));
diff --git a/vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java b/vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java
index a3e50e7d5bf..cd120967bf4 100644
--- a/vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java
+++ b/vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java
@@ -47,6 +47,7 @@ class TestRunnerHandlerTest {
.withFailedCount(2)
.withIgnoredCount(3)
.withAbortedCount(4)
+ .withInconclusiveCount(5)
.withFailures(List.of(new TestReport.Failure("Foo.bar()", exception)))
.withLogs(logRecords).build();
@@ -59,7 +60,7 @@ class TestRunnerHandlerTest {
HttpResponse response = testRunnerHandler.handle(HttpRequest.createTestRequest("http://localhost:1234/tester/v1/report", GET));
ByteArrayOutputStream out = new ByteArrayOutputStream();
response.render(out);
- JsonTestHelper.assertJsonEquals(out.toString(UTF_8), "{\"summary\":{\"success\":1,\"failed\":2,\"ignored\":3,\"aborted\":4,\"failures\":[{\"testName\":\"Foo.bar()\",\"testError\":\"org.junit.ComparisonFailure: expected:<foo> but was:<bar>\",\"exception\":\"java.lang.RuntimeException: org.junit.ComparisonFailure: expected:<foo> but was:<bar>\\n\\tat Foo.bar(Foo.java:1123)\\n\"}]},\"output\":[\"Tests started\"]}");
+ JsonTestHelper.assertJsonEquals(out.toString(UTF_8), "{\"summary\":{\"success\":1,\"failed\":2,\"ignored\":3,\"aborted\":4,\"inconclusive\":5,\"failures\":[{\"testName\":\"Foo.bar()\",\"testError\":\"org.junit.ComparisonFailure: expected:<foo> but was:<bar>\",\"exception\":\"java.lang.RuntimeException: org.junit.ComparisonFailure: expected:<foo> but was:<bar>\\n\\tat Foo.bar(Foo.java:1123)\\n\"}]},\"output\":[\"Tests started\"]}");
}
@Test