mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
Undo trx parsing changes temporarily
This commit is contained in:
parent
775c900089
commit
574868ab61
7 changed files with 13 additions and 31 deletions
|
|
@ -1,8 +1,8 @@
|
||||||

|

|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|DotnetTests.XUnitTests|5:white_check_mark:|5:x:|1:warning:|1s|
|
|fixtures/dotnet-trx.trx|5:white_check_mark:|5:x:|1:warning:|1s|
|
||||||
## :x: <a id="user-content-r0" href="#r0">DotnetTests.XUnitTests</a>
|
## :x: <a id="user-content-r0" href="#r0">fixtures/dotnet-trx.trx</a>
|
||||||
**11** tests were completed in **1s** with **5** passed, **5** failed and **1** skipped.
|
**11** tests were completed in **1s** with **5** passed, **5** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|FluentValidation.Tests|803:white_check_mark:||1:warning:|4s|
|
|fixtures/external/FluentValidation.Tests.trx|803:white_check_mark:||1:warning:|4s|
|
||||||
## :white_check_mark: <a id="user-content-r0" href="#r0">FluentValidation.Tests</a>
|
## :white_check_mark: <a id="user-content-r0" href="#r0">fixtures/external/FluentValidation.Tests.trx</a>
|
||||||
**804** tests were completed in **4s** with **803** passed, **0** failed and **1** skipped.
|
**804** tests were completed in **4s** with **803** passed, **0** failed and **1** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
|Report|Passed|Failed|Skipped|Time|
|
|Report|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|VanillaCloudStorageClientTest|67:white_check_mark:||12:warning:|1s|
|
|fixtures/external/SilentNotes.trx|67:white_check_mark:||12:warning:|1s|
|
||||||
## :white_check_mark: <a id="user-content-r0" href="#r0">VanillaCloudStorageClientTest</a>
|
## :white_check_mark: <a id="user-content-r0" href="#r0">fixtures/external/SilentNotes.trx</a>
|
||||||
**79** tests were completed in **1s** with **67** passed, **0** failed and **12** skipped.
|
**79** tests were completed in **1s** with **67** passed, **0** failed and **12** skipped.
|
||||||
|Test suite|Passed|Failed|Skipped|Time|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
exports[`dotnet-trx tests matches report snapshot 1`] = `
|
exports[`dotnet-trx tests matches report snapshot 1`] = `
|
||||||
TestRunResult {
|
TestRunResult {
|
||||||
"path": "DotnetTests.XUnitTests",
|
"path": "fixtures/dotnet-trx.trx",
|
||||||
"suites": [
|
"suites": [
|
||||||
TestSuiteResult {
|
TestSuiteResult {
|
||||||
"groups": [
|
"groups": [
|
||||||
|
|
@ -131,7 +131,7 @@ Actual: False",
|
||||||
|
|
||||||
exports[`dotnet-trx tests report from FluentValidation test results matches snapshot 1`] = `
|
exports[`dotnet-trx tests report from FluentValidation test results matches snapshot 1`] = `
|
||||||
TestRunResult {
|
TestRunResult {
|
||||||
"path": "FluentValidation.Tests",
|
"path": "fixtures/external/FluentValidation.Tests.trx",
|
||||||
"suites": [
|
"suites": [
|
||||||
TestSuiteResult {
|
TestSuiteResult {
|
||||||
"groups": [
|
"groups": [
|
||||||
|
|
@ -5646,7 +5646,7 @@ TestRunResult {
|
||||||
|
|
||||||
exports[`dotnet-trx tests report from SilentNotes test results matches snapshot 1`] = `
|
exports[`dotnet-trx tests report from SilentNotes test results matches snapshot 1`] = `
|
||||||
TestRunResult {
|
TestRunResult {
|
||||||
"path": "VanillaCloudStorageClientTest",
|
"path": "fixtures/external/SilentNotes.trx",
|
||||||
"suites": [
|
"suites": [
|
||||||
TestSuiteResult {
|
TestSuiteResult {
|
||||||
"groups": [
|
"groups": [
|
||||||
|
|
|
||||||
11
dist/index.js
generated
vendored
11
dist/index.js
generated
vendored
|
|
@ -751,9 +751,8 @@ const path_utils_1 = __nccwpck_require__(4070);
|
||||||
const parse_utils_1 = __nccwpck_require__(7811);
|
const parse_utils_1 = __nccwpck_require__(7811);
|
||||||
const test_results_1 = __nccwpck_require__(2768);
|
const test_results_1 = __nccwpck_require__(2768);
|
||||||
class TestClass {
|
class TestClass {
|
||||||
constructor(name, assemblyName) {
|
constructor(name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.assemblyName = assemblyName;
|
|
||||||
this.tests = [];
|
this.tests = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -815,12 +814,9 @@ class DotnetTrxParser {
|
||||||
const testClasses = {};
|
const testClasses = {};
|
||||||
for (const r of unitTestsResults) {
|
for (const r of unitTestsResults) {
|
||||||
const className = r.test.TestMethod[0].$.className;
|
const className = r.test.TestMethod[0].$.className;
|
||||||
const codeBase = r.test.TestMethod[0].$.codeBase;
|
|
||||||
const pathSegments = codeBase.replace(/\\/g, '/').split('/');
|
|
||||||
const assemblyName = pathSegments[pathSegments.length - 1].replace('.dll', '');
|
|
||||||
let tc = testClasses[className];
|
let tc = testClasses[className];
|
||||||
if (tc === undefined) {
|
if (tc === undefined) {
|
||||||
tc = new TestClass(className, assemblyName);
|
tc = new TestClass(className);
|
||||||
testClasses[tc.name] = tc;
|
testClasses[tc.name] = tc;
|
||||||
}
|
}
|
||||||
const error = this.getErrorInfo(r.result);
|
const error = this.getErrorInfo(r.result);
|
||||||
|
|
@ -847,9 +843,6 @@ class DotnetTrxParser {
|
||||||
const group = new test_results_1.TestGroupResult(null, tests);
|
const group = new test_results_1.TestGroupResult(null, tests);
|
||||||
return new test_results_1.TestSuiteResult(testClass.name, [group]);
|
return new test_results_1.TestSuiteResult(testClass.name, [group]);
|
||||||
});
|
});
|
||||||
if (testClasses.length > 0) {
|
|
||||||
return new test_results_1.TestRunResult(testClasses[0].assemblyName, suites, totalTime);
|
|
||||||
}
|
|
||||||
return new test_results_1.TestRunResult(path, suites, totalTime);
|
return new test_results_1.TestRunResult(path, suites, totalTime);
|
||||||
}
|
}
|
||||||
getErrorInfo(testResult) {
|
getErrorInfo(testResult) {
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@ import {
|
||||||
} from '../../test-results'
|
} from '../../test-results'
|
||||||
|
|
||||||
class TestClass {
|
class TestClass {
|
||||||
constructor(
|
constructor(readonly name: string) {}
|
||||||
readonly name: string,
|
|
||||||
readonly assemblyName: string
|
|
||||||
) {}
|
|
||||||
readonly tests: Test[] = []
|
readonly tests: Test[] = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,12 +81,9 @@ export class DotnetTrxParser implements TestParser {
|
||||||
const testClasses: {[name: string]: TestClass} = {}
|
const testClasses: {[name: string]: TestClass} = {}
|
||||||
for (const r of unitTestsResults) {
|
for (const r of unitTestsResults) {
|
||||||
const className = r.test.TestMethod[0].$.className
|
const className = r.test.TestMethod[0].$.className
|
||||||
const codeBase = r.test.TestMethod[0].$.codeBase
|
|
||||||
const pathSegments = codeBase.replace(/\\/g, '/').split('/')
|
|
||||||
const assemblyName = pathSegments[pathSegments.length - 1].replace('.dll', '')
|
|
||||||
let tc = testClasses[className]
|
let tc = testClasses[className]
|
||||||
if (tc === undefined) {
|
if (tc === undefined) {
|
||||||
tc = new TestClass(className, assemblyName)
|
tc = new TestClass(className)
|
||||||
testClasses[tc.name] = tc
|
testClasses[tc.name] = tc
|
||||||
}
|
}
|
||||||
const error = this.getErrorInfo(r.result)
|
const error = this.getErrorInfo(r.result)
|
||||||
|
|
@ -123,10 +117,6 @@ export class DotnetTrxParser implements TestParser {
|
||||||
return new TestSuiteResult(testClass.name, [group])
|
return new TestSuiteResult(testClass.name, [group])
|
||||||
})
|
})
|
||||||
|
|
||||||
if (testClasses.length > 0) {
|
|
||||||
return new TestRunResult(testClasses[0].assemblyName, suites, totalTime)
|
|
||||||
}
|
|
||||||
|
|
||||||
return new TestRunResult(path, suites, totalTime)
|
return new TestRunResult(path, suites, totalTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ export interface UnitTest {
|
||||||
|
|
||||||
export interface TestMethod {
|
export interface TestMethod {
|
||||||
$: {
|
$: {
|
||||||
codeBase: string
|
|
||||||
className: string
|
className: string
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue