mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-02 03:15:22 -08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6969ae6af5 | ||
|
|
7c6c7df048 | ||
|
|
0ed324d155 | ||
|
|
72c193c336 | ||
|
|
e873f73dd6 | ||
|
|
f88270a385 | ||
|
|
dcaab46b46 |
11
.github/dependabot.yml
vendored
11
.github/dependabot.yml
vendored
@@ -1,11 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
# Enable version updates for npm
|
|
||||||
- package-ecosystem: 'npm'
|
|
||||||
# Look for `package.json` and `lock` files in the `root` directory
|
|
||||||
directory: '/'
|
|
||||||
# Check the npm registry for updates every day (weekdays)
|
|
||||||
schedule:
|
|
||||||
interval: 'monthly'
|
|
||||||
ignore:
|
|
||||||
- dependency-name: '@types/node'
|
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.4.3
|
||||||
|
- [Patch java-junit to handle missing time field](https://github.com/dorny/test-reporter/pull/115)
|
||||||
|
- [Fix dart-json parsing broken by print message](https://github.com/dorny/test-reporter/pull/114)
|
||||||
|
|
||||||
## v1.4.2
|
## v1.4.2
|
||||||
- [Fix dotnet-trx parsing of passed tests with non-empty error info](https://github.com/dorny/test-reporter/commit/43d89d5ee509bcef7bd0287aacc0c4a4fb9c1657)
|
- [Fix dotnet-trx parsing of passed tests with non-empty error info](https://github.com/dorny/test-reporter/commit/43d89d5ee509bcef7bd0287aacc0c4a4fb9c1657)
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
{"suite":{"id":2,"platform":"vm","path":"test\\second_test.dart"},"type":"suite","time":11}
|
{"suite":{"id":2,"platform":"vm","path":"test\\second_test.dart"},"type":"suite","time":11}
|
||||||
{"test":{"id":3,"name":"loading test\\second_test.dart","suiteID":2,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":11}
|
{"test":{"id":3,"name":"loading test\\second_test.dart","suiteID":2,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":11}
|
||||||
{"count":2,"type":"allSuites","time":11}
|
{"count":2,"type":"allSuites","time":11}
|
||||||
|
{"testID":1,"messageType":"print","message":"Hello from the test","type":"print","time":3828}
|
||||||
{"testID":3,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":3649}
|
{"testID":3,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":3649}
|
||||||
{"group":{"id":4,"suiteID":2,"parentID":null,"name":null,"metadata":{"skip":false,"skipReason":null},"testCount":2,"line":null,"column":null,"url":null},"type":"group","time":3654}
|
{"group":{"id":4,"suiteID":2,"parentID":null,"name":null,"metadata":{"skip":false,"skipReason":null},"testCount":2,"line":null,"column":null,"url":null},"type":"group","time":3654}
|
||||||
{"test":{"id":5,"name":"Timeout test","suiteID":2,"groupIDs":[4],"metadata":{"skip":false,"skipReason":null},"line":5,"column":3,"url":"file:///C:/Users/Michal/Workspace/dorny/test-check/reports/dart/test/second_test.dart"},"type":"testStart","time":3655}
|
{"test":{"id":5,"name":"Timeout test","suiteID":2,"groupIDs":[4],"metadata":{"skip":false,"skipReason":null},"line":5,"column":3,"url":"file:///C:/Users/Michal/Workspace/dorny/test-check/reports/dart/test/second_test.dart"},"type":"testStart","time":3655}
|
||||||
|
|||||||
18
dist/index.js
generated
vendored
18
dist/index.js
generated
vendored
@@ -483,13 +483,13 @@ class DartJsonParser {
|
|||||||
group.tests.push(test);
|
group.tests.push(test);
|
||||||
tests[evt.test.id] = test;
|
tests[evt.test.id] = test;
|
||||||
}
|
}
|
||||||
else if (dart_json_types_1.isTestDoneEvent(evt) && !evt.hidden) {
|
else if (dart_json_types_1.isTestDoneEvent(evt) && !evt.hidden && tests[evt.testID]) {
|
||||||
tests[evt.testID].testDone = evt;
|
tests[evt.testID].testDone = evt;
|
||||||
}
|
}
|
||||||
else if (dart_json_types_1.isErrorEvent(evt)) {
|
else if (dart_json_types_1.isErrorEvent(evt) && tests[evt.testID]) {
|
||||||
tests[evt.testID].error = evt;
|
tests[evt.testID].error = evt;
|
||||||
}
|
}
|
||||||
else if (dart_json_types_1.isMessageEvent(evt)) {
|
else if (dart_json_types_1.isMessageEvent(evt) && tests[evt.testID]) {
|
||||||
tests[evt.testID].print.push(evt);
|
tests[evt.testID].print.push(evt);
|
||||||
}
|
}
|
||||||
else if (dart_json_types_1.isDoneEvent(evt)) {
|
else if (dart_json_types_1.isDoneEvent(evt)) {
|
||||||
@@ -763,10 +763,10 @@ class DotnetTrxParser {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const error = test.error;
|
const error = test.error;
|
||||||
if (!Array.isArray(error.Message)
|
if (!Array.isArray(error.Message) ||
|
||||||
|| error.Message.length === 0
|
error.Message.length === 0 ||
|
||||||
|| !Array.isArray(error.StackTrace)
|
!Array.isArray(error.StackTrace) ||
|
||||||
|| error.StackTrace.length === 0) {
|
error.StackTrace.length === 0) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const message = test.error.Message[0];
|
const message = test.error.Message[0];
|
||||||
@@ -888,6 +888,7 @@ class JavaJunitParser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
getTestRunResult(filePath, junit) {
|
getTestRunResult(filePath, junit) {
|
||||||
|
var _a;
|
||||||
const suites = junit.testsuites.testsuite === undefined
|
const suites = junit.testsuites.testsuite === undefined
|
||||||
? []
|
? []
|
||||||
: junit.testsuites.testsuite.map(ts => {
|
: junit.testsuites.testsuite.map(ts => {
|
||||||
@@ -896,7 +897,8 @@ class JavaJunitParser {
|
|||||||
const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time);
|
const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time);
|
||||||
return sr;
|
return sr;
|
||||||
});
|
});
|
||||||
const time = parseFloat(junit.testsuites.$.time) * 1000;
|
const seconds = parseFloat((_a = junit.testsuites.$) === null || _a === void 0 ? void 0 : _a.time);
|
||||||
|
const time = isNaN(seconds) ? undefined : seconds * 1000;
|
||||||
return new test_results_1.TestRunResult(filePath, suites, time);
|
return new test_results_1.TestRunResult(filePath, suites, time);
|
||||||
}
|
}
|
||||||
getGroups(suite) {
|
getGroups(suite) {
|
||||||
|
|||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -24,4 +24,6 @@ void main() {
|
|||||||
throw Exception('Some error');
|
throw Exception('Some error');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
print('Hello from the test');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,11 +114,11 @@ export class DartJsonParser implements TestParser {
|
|||||||
const group = suite.groups[evt.test.groupIDs[evt.test.groupIDs.length - 1]]
|
const group = suite.groups[evt.test.groupIDs[evt.test.groupIDs.length - 1]]
|
||||||
group.tests.push(test)
|
group.tests.push(test)
|
||||||
tests[evt.test.id] = test
|
tests[evt.test.id] = test
|
||||||
} else if (isTestDoneEvent(evt) && !evt.hidden) {
|
} else if (isTestDoneEvent(evt) && !evt.hidden && tests[evt.testID]) {
|
||||||
tests[evt.testID].testDone = evt
|
tests[evt.testID].testDone = evt
|
||||||
} else if (isErrorEvent(evt)) {
|
} else if (isErrorEvent(evt) && tests[evt.testID]) {
|
||||||
tests[evt.testID].error = evt
|
tests[evt.testID].error = evt
|
||||||
} else if (isMessageEvent(evt)) {
|
} else if (isMessageEvent(evt) && tests[evt.testID]) {
|
||||||
tests[evt.testID].print.push(evt)
|
tests[evt.testID].print.push(evt)
|
||||||
} else if (isDoneEvent(evt)) {
|
} else if (isDoneEvent(evt)) {
|
||||||
success = evt.success
|
success = evt.success
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ export class JavaJunitParser implements TestParser {
|
|||||||
return sr
|
return sr
|
||||||
})
|
})
|
||||||
|
|
||||||
const time = parseFloat(junit.testsuites.$.time) * 1000
|
const seconds = parseFloat(junit.testsuites.$?.time)
|
||||||
|
const time = isNaN(seconds) ? undefined : seconds * 1000
|
||||||
return new TestRunResult(filePath, suites, time)
|
return new TestRunResult(filePath, suites, time)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user