diff options
author | jonmv <venstad@gmail.com> | 2022-06-06 19:13:18 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-06-06 19:13:18 +0200 |
commit | b610a317d9fd1e1dcad6bc639efb9e22dd4cbf26 (patch) | |
tree | dba0846ce91beea3964fa48556211f14b1395921 /vespa-osgi-testrunner/src/test/resources | |
parent | 972d7ac82e62bb51c4e16d5b740eaa5ce45cdfa8 (diff) |
Reimplement JUnit integratino, with unit tests, and structured report
Diffstat (limited to 'vespa-osgi-testrunner/src/test/resources')
-rw-r--r-- | vespa-osgi-testrunner/src/test/resources/output.json | 82 | ||||
-rw-r--r-- | vespa-osgi-testrunner/src/test/resources/report.json | 312 |
2 files changed, 394 insertions, 0 deletions
diff --git a/vespa-osgi-testrunner/src/test/resources/output.json b/vespa-osgi-testrunner/src/test/resources/output.json new file mode 100644 index 00000000000..04682fa9f31 --- /dev/null +++ b/vespa-osgi-testrunner/src/test/resources/output.json @@ -0,0 +1,82 @@ +{ + "logRecords": [ + { + "id": 3, + "at": 0, + "type": "info", + "message": "spam" + }, + { + "id": 6, + "at": 0, + "type": "info", + "message": "spam" + }, + { + "id": 9, + "at": 0, + "type": "info", + "message": "spam" + }, + { + "id": 10, + "at": 0, + "type": "info", + "message": "I have a bad feeling about this" + }, + { + "id": 14, + "at": 0, + "type": "info", + "message": "spam" + }, + { + "id": 15, + "at": 0, + "type": "info", + "message": "I'm here with Erwin today; Erwin, what can you tell us about your cat?" + }, + { + "id": 18, + "at": 0, + "type": "info", + "message": "spam" + }, + { + "id": 19, + "at": 0, + "type": "info", + "message": "<body />" + }, + { + "id": 20, + "at": 0, + "type": "info", + "message": "Very informative" + }, + { + "id": 21, + "at": 0, + "type": "warning", + "message": "Oh no\njava.lang.IllegalArgumentException: error\n\tat com.yahoo.vespa.test.samples.SampleTest.successful(SampleTest.java:75)\nCaused by: java.lang.RuntimeException: wrapped\n\t... 1 more\n" + }, + { + "id": 25, + "at": 0, + "type": "info", + "message": "spam" + }, + { + "id": 28, + "at": 0, + "type": "info", + "message": "Catch me if you can!" + }, + { + "id": 35, + "at": 0, + "type": "info", + "message": "spam" + } + ] +} diff --git a/vespa-osgi-testrunner/src/test/resources/report.json b/vespa-osgi-testrunner/src/test/resources/report.json new file mode 100644 index 00000000000..578ece9cc39 --- /dev/null +++ b/vespa-osgi-testrunner/src/test/resources/report.json @@ -0,0 +1,312 @@ +{ + "report": { + "type": "container", + "name": "System test", + "status": "error", + "start": 0, + "end": 0, + "children": [ + { + "type": "container", + "name": "junit-jupiter", + "status": "error", + "start": 0, + "end": 0, + "children": [ + { + "type": "container", + "name": "com.yahoo.vespa.test.samples.SampleTest", + "status": "error", + "start": 0, + "end": 0, + "children": [ + { + "type": "test", + "name": "aborted()", + "status": "aborted", + "start": 0, + "end": 0, + "children": [ + { + "type": "output", + "children": [ + { + "message": "spam", + "at": 0, + "level": "info" + } + ] + } + ] + }, + { + "type": "test", + "name": "error()", + "status": "error", + "start": 0, + "end": 0, + "children": [ + { + "type": "output", + "children": [ + { + "message": "spam", + "at": 0, + "level": "info" + } + ] + }, + { + "type": "failure", + "status": "error", + "trace": "java.lang.NoClassDefFoundError\n\tat com.yahoo.vespa.test.samples.SampleTest.error(SampleTest.java:87)\n" + } + ] + }, + { + "type": "test", + "name": "failing()", + "status": "failed", + "start": 0, + "end": 0, + "children": [ + { + "type": "output", + "children": [ + { + "message": "spam", + "at": 0, + "level": "info" + }, + { + "message": "com.yahoo.vespa.test.samples.SampleTest: I have a bad feeling about this", + "at": 0, + "level": "info" + } + ] + }, + { + "type": "failure", + "status": "failed", + "trace": "org.opentest4j.AssertionFailedError: baz ==> expected: <foo> but was: <bar>\n\tat org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)\n\tat org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)\n\tat org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)\n\tat org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1152)\n\tat com.yahoo.vespa.test.samples.SampleTest.failing(SampleTest.java:81)\n" + } + ] + }, + { + "type": "test", + "name": "ignored()", + "status": "skipped", + "start": 0, + "end": 0 + }, + { + "type": "test", + "name": "inconclusive(org.junit.jupiter.api.TestReporter)", + "status": "error", + "start": 0, + "end": 0, + "children": [ + { + "type": "output", + "children": [ + { + "message": "spam", + "at": 0, + "level": "info" + }, + { + "message": "I'm here with Erwin today; Erwin, what can you tell us about your cat?", + "at": 0, + "level": "info" + } + ] + }, + { + "type": "failure", + "status": "error", + "trace": "ai.vespa.hosted.cd.InconclusiveTestException: the cat is both dead _and_ alive\n\tat com.yahoo.vespa.test.samples.SampleTest.inconclusive(SampleTest.java:93)\n" + } + ] + }, + { + "type": "test", + "name": "successful()", + "status": "successful", + "start": 0, + "end": 0, + "children": [ + { + "type": "output", + "children": [ + { + "message": "spam", + "at": 0, + "level": "info" + }, + { + "message": "com.yahoo.vespa.test.samples.SampleTest: <body />", + "at": 0, + "level": "info" + }, + { + "message": "com.yahoo.vespa.test.samples.SampleTest: Very informative", + "at": 0, + "level": "info" + }, + { + "message": "com.yahoo.vespa.test.samples.SampleTest: Oh no", + "at": 0, + "level": "warning", + "trace": "java.lang.IllegalArgumentException: error\n\tat com.yahoo.vespa.test.samples.SampleTest.successful(SampleTest.java:75)\nCaused by: java.lang.RuntimeException: wrapped\n\t... 1 more\n" + } + ] + } + ] + }, + { + "type": "container", + "name": "Inner", + "status": "failed", + "start": 0, + "end": 0, + "children": [ + { + "type": "container", + "name": "others()", + "status": "failed", + "start": 0, + "end": 0, + "children": [ + { + "type": "output", + "children": [ + { + "message": "spam", + "at": 0, + "level": "info" + } + ] + }, + { + "type": "test", + "name": "#1", + "status": "successful", + "start": 0, + "end": 0, + "children": [ + { + "type": "output", + "children": [ + { + "message": "Catch me if you can!", + "at": 0, + "level": "info" + } + ] + } + ] + }, + { + "type": "test", + "name": "#2", + "status": "failed", + "start": 0, + "end": 0, + "children": [ + { + "type": "failure", + "status": "failed", + "trace": "org.opentest4j.AssertionFailedError: no charm\n\tat org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:39)\n\tat org.junit.jupiter.api.Assertions.fail(Assertions.java:134)\n\tat com.yahoo.vespa.test.samples.SampleTest$Inner.lambda$others$1(SampleTest.java:105)\n" + } + ] + } + ] + }, + { + "type": "test", + "name": "first()", + "status": "successful", + "start": 0, + "end": 0, + "children": [ + { + "type": "output", + "children": [ + { + "message": "spam", + "at": 0, + "level": "info" + } + ] + } + ] + } + ] + }, + { + "type": "container", + "name": "Skipped", + "status": "skipped", + "start": 0, + "end": 0, + "children": [ + { + "type": "test", + "name": "disabled()", + "status": "skipped", + "start": 0, + "end": 0 + } + ] + } + ] + } + ] + } + ] + }, + "summary": { + "success": 3, + "failed": 4, + "ignored": 2, + "aborted": 1, + "inconclusive": 0, + "failures": [ + { + "testName": "error()", + "testError": null, + "exception": "java.lang.NoClassDefFoundError\n\tat com.yahoo.vespa.test.samples.SampleTest.error(SampleTest.java:87)\n" + }, + { + "testName": "failing()", + "testError": "baz ==> expected: <foo> but was: <bar>", + "exception": "org.opentest4j.AssertionFailedError: baz ==> expected: <foo> but was: <bar>\n\tat org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)\n\tat org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)\n\tat org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)\n\tat org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1152)\n\tat com.yahoo.vespa.test.samples.SampleTest.failing(SampleTest.java:81)\n" + }, + { + "testName": "inconclusive(org.junit.jupiter.api.TestReporter)", + "testError": "the cat is both dead _and_ alive", + "exception": "ai.vespa.hosted.cd.InconclusiveTestException: the cat is both dead _and_ alive\n\tat com.yahoo.vespa.test.samples.SampleTest.inconclusive(SampleTest.java:93)\n" + }, + { + "testName": "#2", + "testError": "no charm", + "exception": "org.opentest4j.AssertionFailedError: no charm\n\tat org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:39)\n\tat org.junit.jupiter.api.Assertions.fail(Assertions.java:134)\n\tat com.yahoo.vespa.test.samples.SampleTest$Inner.lambda$others$1(SampleTest.java:105)\n" + } + ] + }, + "output": [ + "00:00:00.000 spam", + "00:00:00.000 spam", + "00:00:00.000 spam", + "00:00:00.000 I have a bad feeling about this", + "00:00:00.000 spam", + "00:00:00.000 I'm here with Erwin today; Erwin, what can you tell us about your cat?", + "00:00:00.000 spam", + "00:00:00.000 <body />", + "00:00:00.000 Very informative", + "00:00:00.000 Oh no", + "00:00:00.000 spam", + "00:00:00.000 Catch me if you can!", + "00:00:00.000 spam" + ] +} |