Undo trx parsing changes temporarily

This commit is contained in:
Ray Xu 2024-05-29 16:58:25 -07:00
parent 775c900089
commit 574868ab61
7 changed files with 13 additions and 31 deletions

View file

@ -16,10 +16,7 @@ import {
} from '../../test-results'
class TestClass {
constructor(
readonly name: string,
readonly assemblyName: string
) {}
constructor(readonly name: string) {}
readonly tests: Test[] = []
}
@ -84,12 +81,9 @@ export class DotnetTrxParser implements TestParser {
const testClasses: {[name: string]: TestClass} = {}
for (const r of unitTestsResults) {
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]
if (tc === undefined) {
tc = new TestClass(className, assemblyName)
tc = new TestClass(className)
testClasses[tc.name] = tc
}
const error = this.getErrorInfo(r.result)
@ -123,10 +117,6 @@ export class DotnetTrxParser implements TestParser {
return new TestSuiteResult(testClass.name, [group])
})
if (testClasses.length > 0) {
return new TestRunResult(testClasses[0].assemblyName, suites, totalTime)
}
return new TestRunResult(path, suites, totalTime)
}

View file

@ -30,7 +30,6 @@ export interface UnitTest {
export interface TestMethod {
$: {
codeBase: string
className: string
name: string
}