mirror of
https://github.com/dorny/test-reporter.git
synced 2026-03-22 07:52:14 +01:00
Correct test time output
This commit is contained in:
parent
e89b2f3e47
commit
3eeb9fc888
5 changed files with 19 additions and 20 deletions
|
|
@ -34,11 +34,10 @@ export class DotnetNunitLegacyParser implements TestParser {
|
|||
|
||||
private getTestRunResult(path: string, nunit: NunitReport): TestRunResult {
|
||||
const suites: TestSuiteResult[] = []
|
||||
const time = parseFloat(nunit['test-results'].$.time)
|
||||
|
||||
this.populateTestCasesRecursive(suites, [], nunit['test-results']['test-suite'])
|
||||
|
||||
return new TestRunResult(path, suites, time)
|
||||
return new TestRunResult(path, suites)
|
||||
}
|
||||
|
||||
private populateTestCasesRecursive(
|
||||
|
|
@ -99,7 +98,7 @@ export class DotnetNunitLegacyParser implements TestParser {
|
|||
new TestCaseResult(
|
||||
testCase.$.name.startsWith(suiteName + '.') ? testCase.$.name.substring(suiteName.length + 1) : testCase.$.name,
|
||||
this.getTestExecutionResult(testCase),
|
||||
parseFloat(testCase.$.time),
|
||||
testCase.$.time ? parseFloat(testCase.$.time) * 1000 : 0,
|
||||
this.getTestCaseError(testCase)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ export interface NunitReport {
|
|||
|
||||
export interface TestResults {
|
||||
$: {
|
||||
time: string
|
||||
// there is a time attribute here, but it is the time of day the test ran, not the duration
|
||||
// time: string
|
||||
}
|
||||
'test-suite'?: TestSuite[]
|
||||
}
|
||||
|
|
@ -26,7 +27,7 @@ export interface TestCase {
|
|||
$: {
|
||||
name: string
|
||||
result: string
|
||||
time: string
|
||||
time?: string
|
||||
}
|
||||
failure?: TestFailure[]
|
||||
reason?: TestFailure[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue