Add go-unit test

This commit is contained in:
Cristian Dumitru 2022-10-18 16:36:41 -05:00
parent 8079cf8926
commit e0f4952e74
8 changed files with 184 additions and 32158 deletions

View file

@ -50,7 +50,7 @@ export class GoJunitParser implements TestParser {
private getGroups(suite: TestSuite): TestGroupResult[] {
const groups: {describe: string; tests: TestCase[]}[] = []
const returnEmpytGroups: TestGroupResult[] = [];
if (suite.testcase.length === 0) return returnEmpytGroups;
if (!suite.testcase?.length) return returnEmpytGroups;
for (const tc of suite.testcase) {
let grp = groups.find(g => g.describe === tc.$.classname)
if (grp === undefined) {
@ -83,7 +83,8 @@ export class GoJunitParser implements TestParser {
return undefined
}
const details = tc.failure[0]
const failure = tc.failure?.[0]
const details = (typeof failure === 'object' ? failure._ : failure) || ""
let path
let line

View file

@ -29,6 +29,11 @@ export interface TestCase {
name: string
time: string
}
failure?: string[]
failure?: string[] | Failure[]
error?: string[] | Failure[]
skipped?: string[]
}
export interface Failure {
_: string
}