Support parsing multiple reports

This commit is contained in:
Michal Dorner 2021-01-16 22:53:14 +01:00
parent 659bb4fff3
commit c48c07640f
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
15 changed files with 219 additions and 74 deletions

1
.gitignore vendored
View file

@ -99,5 +99,4 @@ __tests__/runner/*
lib/**/* lib/**/*
# Project specific # Project specific
__tests__/__outputs__
__tests__/__results__ __tests__/__results__

View file

@ -0,0 +1,38 @@
### fixtures\dart-json.json
**6** tests were completed in **3.760s** with **1** passed, **1** skipped and **4** failed.
| Result | Suite | Tests | Time | Passed ✔️ | Skipped ✖️ | Failed ❌ |
| :---: | :--- | ---: | ---: | ---: | ---: | ---: |
| ❌ | [test\main_test.dart](#ts-0-test-maintest-dart) | 4 | 74ms | 1 | 0 | 3 |
| ❌ | [test\second_test.dart](#ts-1-test-secondtest-dart) | 2 | 51ms | 0 | 1 | 1 |
# Test Suites
## <a id="user-content-ts-0-test-maintest-dart" href="#ts-0-test-maintest-dart">test\main_test.dart</a>
### Test 1
| Result | Test | Time |
| :---: | :--- | ---: |
| ✔️ | Test 1 Passing test | 36ms |
### Test 1 Test 1.1
| Result | Test | Time |
| :---: | :--- | ---: |
| ❌ | Test 1 Test 1.1 Failing test | 20ms |
| ❌ | Test 1 Test 1.1 Exception in target unit | 6ms |
### Test 2
| Result | Test | Time |
| :---: | :--- | ---: |
| ❌ | Test 2 Exception in test | 12ms |
## <a id="user-content-ts-1-test-secondtest-dart" href="#ts-1-test-secondtest-dart">test\second_test.dart</a>
| Result | Test | Time |
| :---: | :--- | ---: |
| ❌ | Timeout test | 37ms |
| ✖️ | Skipped test | 14ms |

View file

@ -0,0 +1,21 @@
### fixtures\dotnet-trx.trx
**7** tests were completed in **1.061s** with **3** passed, **1** skipped and **3** failed.
| Result | Suite | Tests | Time | Passed ✔️ | Skipped ✖️ | Failed ❌ |
| :---: | :--- | ---: | ---: | ---: | ---: | ---: |
| ❌ | [DotnetTests.XUnitTests.CalculatorTests](#ts-0-DotnetTests-XUnitTests-CalculatorTests) | 7 | 109.5761ms | 3 | 1 | 3 |
# Test Suites
## <a id="user-content-ts-0-DotnetTests-XUnitTests-CalculatorTests" href="#ts-0-DotnetTests-XUnitTests-CalculatorTests">DotnetTests.XUnitTests.CalculatorTests</a>
| Result | Test | Time |
| :---: | :--- | ---: |
| ❌ | Exception_In_TargetTest | 0.4975ms |
| ❌ | Exception_In_Test | 2.2728ms |
| ❌ | Failing_Test | 3.2953ms |
| ✔️ | Passing_Test | 0.1254ms |
| ✔️ | Passing_Test_With_Name | 0.103ms |
| ✖️ | Skipped_Test | 1ms |
| ✔️ | Timeout_Test | 102.2821ms |

View file

@ -0,0 +1,38 @@
### fixtures\jest-junit.xml
**6** tests were completed in **1.360s** with **1** passed, **1** skipped and **4** failed.
| Result | Suite | Tests | Time | Passed ✔️ | Skipped ✖️ | Failed ❌ |
| :---: | :--- | ---: | ---: | ---: | ---: | ---: |
| ❌ | [__tests__\main.test.js](#ts-0-tests-main-test-js) | 4 | 486ms | 1 | 0 | 3 |
| ❌ | [__tests__\second.test.js](#ts-1-tests-second-test-js) | 2 | 82ms | 0 | 1 | 1 |
# Test Suites
## <a id="user-content-ts-0-tests-main-test-js" href="#ts-0-tests-main-test-js">__tests__\main.test.js</a>
### Test 1
| Result | Test | Time |
| :---: | :--- | ---: |
| ✔️ | Passing test | 1ms |
### Test 1 Test 1.1
| Result | Test | Time |
| :---: | :--- | ---: |
| ❌ | Failing test | 2ms |
| ❌ | Exception in target unit | 0ms |
### Test 2
| Result | Test | Time |
| :---: | :--- | ---: |
| ❌ | Exception in test | 0ms |
## <a id="user-content-ts-1-tests-second-test-js" href="#ts-1-tests-second-test-js">__tests__\second.test.js</a>
| Result | Test | Time |
| :---: | :--- | ---: |
| ❌ | Timeout test | 4ms |
| ✖️ | Skipped test | 0ms |

View file

@ -52,11 +52,15 @@ dart:isolate _RawReceivePortImpl._handleMessage
"title": "[test\\\\second_test.dart] Timeout test", "title": "[test\\\\second_test.dart] Timeout test",
}, },
], ],
"summary": "**6** tests were completed in **3.760s** with **1** passed, **1** skipped and **4** failed. "summary": "### fixtures\\\\dart-json.json
| Result | Suite | Tests | Time | Passed ✔️ | Failed ❌ | Skipped ✖️ |
**6** tests were completed in **3.760s** with **1** passed, **1** skipped and **4** failed.
| Result | Suite | Tests | Time | Passed ✔️ | Skipped ✖️ | Failed ❌ |
| :---: | :--- | ---: | ---: | ---: | ---: | ---: | | :---: | :--- | ---: | ---: | ---: | ---: | ---: |
| ❌ | [test\\\\main_test.dart](#ts-0-test-maintest-dart) | 4 | 74ms | 1 | 3 | 0 | | ❌ | [test\\\\main_test.dart](#ts-0-test-maintest-dart) | 4 | 74ms | 1 | 0 | 3 |
| ❌ | [test\\\\second_test.dart](#ts-1-test-secondtest-dart) | 2 | 51ms | 0 | 1 | 1 | | ❌ | [test\\\\second_test.dart](#ts-1-test-secondtest-dart) | 2 | 51ms | 0 | 1 | 1 |
# Test Suites # Test Suites
## <a id=\\"user-content-ts-0-test-maintest-dart\\" href=\\"#ts-0-test-maintest-dart\\">test\\\\main_test.dart</a> ❌ ## <a id=\\"user-content-ts-0-test-maintest-dart\\" href=\\"#ts-0-test-maintest-dart\\">test\\\\main_test.dart</a> ❌

View file

@ -30,10 +30,14 @@ Actual: 2",
"title": "[DotnetTests.XUnitTests.CalculatorTests] Failing_Test", "title": "[DotnetTests.XUnitTests.CalculatorTests] Failing_Test",
}, },
], ],
"summary": "**7** tests were completed in **1.061s** with **3** passed, **1** skipped and **3** failed. "summary": "### fixtures\\\\dotnet-trx.trx
| Result | Suite | Tests | Time | Passed ✔️ | Failed ❌ | Skipped ✖️ |
**7** tests were completed in **1.061s** with **3** passed, **1** skipped and **3** failed.
| Result | Suite | Tests | Time | Passed ✔️ | Skipped ✖️ | Failed ❌ |
| :---: | :--- | ---: | ---: | ---: | ---: | ---: | | :---: | :--- | ---: | ---: | ---: | ---: | ---: |
| ❌ | [DotnetTests.XUnitTests.CalculatorTests](#ts-0-DotnetTests-XUnitTests-CalculatorTests) | 7 | 109.5761ms | 3 | 3 | 1 | | ❌ | [DotnetTests.XUnitTests.CalculatorTests](#ts-0-DotnetTests-XUnitTests-CalculatorTests) | 7 | 109.5761ms | 3 | 1 | 3 |
# Test Suites # Test Suites
## <a id=\\"user-content-ts-0-DotnetTests-XUnitTests-CalculatorTests\\" href=\\"#ts-0-DotnetTests-XUnitTests-CalculatorTests\\">DotnetTests.XUnitTests.CalculatorTests</a> ❌ ## <a id=\\"user-content-ts-0-DotnetTests-XUnitTests-CalculatorTests\\" href=\\"#ts-0-DotnetTests-XUnitTests-CalculatorTests\\">DotnetTests.XUnitTests.CalculatorTests</a> ❌

View file

@ -73,11 +73,15 @@ Received: false
"title": "[__tests__\\\\second.test.js] Timeout test", "title": "[__tests__\\\\second.test.js] Timeout test",
}, },
], ],
"summary": "**6** tests were completed in **1.360s** with **1** passed, **1** skipped and **4** failed. "summary": "### fixtures\\\\jest-junit.xml
| Result | Suite | Tests | Time | Passed ✔️ | Failed ❌ | Skipped ✖️ |
**6** tests were completed in **1.360s** with **1** passed, **1** skipped and **4** failed.
| Result | Suite | Tests | Time | Passed ✔️ | Skipped ✖️ | Failed ❌ |
| :---: | :--- | ---: | ---: | ---: | ---: | ---: | | :---: | :--- | ---: | ---: | ---: | ---: | ---: |
| ❌ | [__tests__\\\\main.test.js](#ts-0-tests-main-test-js) | 4 | 486ms | 1 | 3 | 0 | | ❌ | [__tests__\\\\main.test.js](#ts-0-tests-main-test-js) | 4 | 486ms | 1 | 0 | 3 |
| ❌ | [__tests__\\\\second.test.js](#ts-1-tests-second-test-js) | 2 | 82ms | 0 | 1 | 1 | | ❌ | [__tests__\\\\second.test.js](#ts-1-tests-second-test-js) | 2 | 82ms | 0 | 1 | 1 |
# Test Suites # Test Suites
## <a id=\\"user-content-ts-0-tests-main-test-js\\" href=\\"#ts-0-tests-main-test-js\\">__tests__\\\\main.test.js</a> ❌ ## <a id=\\"user-content-ts-0-tests-main-test-js\\" href=\\"#ts-0-tests-main-test-js\\">__tests__\\\\main.test.js</a> ❌

View file

@ -7,7 +7,7 @@ import {ParseOptions} from '../src/parsers/parser-types'
const fixturePath = path.join(__dirname, 'fixtures', 'dart-json.json') const fixturePath = path.join(__dirname, 'fixtures', 'dart-json.json')
const outputPath = path.join(__dirname, '__outputs__', 'dart-json.md') const outputPath = path.join(__dirname, '__outputs__', 'dart-json.md')
const xmlFixture = { const xmlFixture = {
path: fixturePath, path: path.relative(__dirname, fixturePath),
content: fs.readFileSync(fixturePath, {encoding: 'utf8'}) content: fs.readFileSync(fixturePath, {encoding: 'utf8'})
} }

View file

@ -7,7 +7,7 @@ import {ParseOptions} from '../src/parsers/parser-types'
const fixturePath = path.join(__dirname, 'fixtures', 'dotnet-trx.trx') const fixturePath = path.join(__dirname, 'fixtures', 'dotnet-trx.trx')
const outputPath = path.join(__dirname, '__outputs__', 'dotnet-trx.md') const outputPath = path.join(__dirname, '__outputs__', 'dotnet-trx.md')
const xmlFixture = { const xmlFixture = {
path: fixturePath, path: path.relative(__dirname, fixturePath),
content: fs.readFileSync(fixturePath, {encoding: 'utf8'}) content: fs.readFileSync(fixturePath, {encoding: 'utf8'})
} }

View file

@ -7,7 +7,7 @@ import {ParseOptions} from '../src/parsers/parser-types'
const fixturePath = path.join(__dirname, 'fixtures', 'jest-junit.xml') const fixturePath = path.join(__dirname, 'fixtures', 'jest-junit.xml')
const outputPath = path.join(__dirname, '__outputs__', 'jest-junit.md') const outputPath = path.join(__dirname, '__outputs__', 'jest-junit.md')
const xmlFixture = { const xmlFixture = {
path: fixturePath, path: path.relative(__dirname, fixturePath),
content: fs.readFileSync(fixturePath, {encoding: 'utf8'}) content: fs.readFileSync(fixturePath, {encoding: 'utf8'})
} }

View file

@ -28,7 +28,7 @@ import {
} from '../../report/test-results' } from '../../report/test-results'
class TestRun { class TestRun {
constructor(readonly suites: TestSuite[], readonly success: boolean, readonly time: number) {} constructor(readonly path: string, readonly suites: TestSuite[], readonly success: boolean, readonly time: number) {}
} }
class TestSuite { class TestSuite {
@ -69,20 +69,22 @@ class TestCase {
} }
export async function parseDartJson(files: FileContent[], options: ParseOptions): Promise<TestResult> { export async function parseDartJson(files: FileContent[], options: ParseOptions): Promise<TestResult> {
const testRun = getTestRun(files[0].content) const testRuns = files.map(f => getTestRun(f.path, f.content))
const icon = testRun.success ? Icon.success : Icon.fail const testRunsResults = testRuns.map(getTestRunResult)
const success = testRuns.every(tr => tr.success)
const icon = success ? Icon.success : Icon.fail
return { return {
success: testRun.success, success,
output: { output: {
title: `${options.name.trim()} ${icon}`, title: `${options.name.trim()} ${icon}`,
summary: getReport(getTestRunResult(testRun)), summary: getReport(testRunsResults),
annotations: options.annotations ? getAnnotations(testRun, options.workDir, options.trackedFiles) : undefined annotations: options.annotations ? getAnnotations(testRuns, options.workDir, options.trackedFiles) : undefined
} }
} }
} }
function getTestRun(content: string): TestRun { function getTestRun(path: string, content: string): TestRun {
const lines = content.split(/\n\r?/g).filter(line => line !== '') const lines = content.split(/\n\r?/g).filter(line => line !== '')
const events = lines.map(str => JSON.parse(str)) as ReportEvent[] const events = lines.map(str => JSON.parse(str)) as ReportEvent[]
@ -112,7 +114,7 @@ function getTestRun(content: string): TestRun {
} }
} }
return new TestRun(Object.values(suites), success, totalTime) return new TestRun(path, Object.values(suites), success, totalTime)
} }
function getTestRunResult(tr: TestRun): TestRunResult { function getTestRunResult(tr: TestRun): TestRunResult {
@ -120,7 +122,7 @@ function getTestRunResult(tr: TestRun): TestRunResult {
return new TestSuiteResult(s.suite.path, getGroups(s)) return new TestSuiteResult(s.suite.path, getGroups(s))
}) })
return new TestRunResult(suites, tr.time) return new TestRunResult(tr.path, suites, tr.time)
} }
function getGroups(suite: TestSuite): TestGroupResult[] { function getGroups(suite: TestSuite): TestGroupResult[] {
@ -134,15 +136,17 @@ function getGroups(suite: TestSuite): TestGroupResult[] {
}) })
} }
function getAnnotations(tr: TestRun, workDir: string, trackedFiles: string[]): Annotation[] { function getAnnotations(testRuns: TestRun[], workDir: string, trackedFiles: string[]): Annotation[] {
const annotations: Annotation[] = [] const annotations: Annotation[] = []
for (const suite of tr.suites) { for (const tr of testRuns) {
for (const group of Object.values(suite.groups)) { for (const suite of tr.suites) {
for (const test of group.tests) { for (const group of Object.values(suite.groups)) {
if (test.error) { for (const test of group.tests) {
const err = getAnnotation(test, suite, workDir, trackedFiles) if (test.error) {
if (err !== null) { const err = getAnnotation(test, suite, workDir, trackedFiles)
annotations.push(err) if (err !== null) {
annotations.push(err)
}
} }
} }
} }

View file

@ -42,26 +42,37 @@ class Test {
} }
export async function parseDotnetTrx(files: FileContent[], options: ParseOptions): Promise<TestResult> { export async function parseDotnetTrx(files: FileContent[], options: ParseOptions): Promise<TestResult> {
const trx = (await parseStringPromise(files[0].content, { const testRuns: TestRunResult[] = []
attrValueProcessors: [parseAttribute] const testClasses: TestClass[] = []
})) as TrxReport
const testClasses = getTestClasses(trx) for (const file of files) {
const testRun = getTestRunResult(trx, testClasses) const trx = await getTrxReport(file.content)
const success = testRun.result === 'success' const tc = getTestClasses(trx)
const tr = getTestRunResult(file.path, trx, tc)
testRuns.push(tr)
testClasses.push(...tc)
}
const success = testRuns.every(tr => tr.result === 'success')
const icon = success ? Icon.success : Icon.fail const icon = success ? Icon.success : Icon.fail
return { return {
success, success,
output: { output: {
title: `${options.name.trim()} ${icon}`, title: `${options.name.trim()} ${icon}`,
summary: getReport(testRun), summary: getReport(testRuns),
annotations: options.annotations ? getAnnotations(testClasses, options.workDir, options.trackedFiles) : undefined annotations: options.annotations ? getAnnotations(testClasses, options.workDir, options.trackedFiles) : undefined
} }
} }
} }
function getTestRunResult(trx: TrxReport, testClasses: TestClass[]): TestRunResult { async function getTrxReport(content: string): Promise<TrxReport> {
return (await parseStringPromise(content, {
attrValueProcessors: [parseAttribute]
})) as TrxReport
}
function getTestRunResult(path: string, trx: TrxReport, testClasses: TestClass[]): TestRunResult {
const times = trx.TestRun.Times[0].$ const times = trx.TestRun.Times[0].$
const totalTime = times.finish.getTime() - times.start.getTime() const totalTime = times.finish.getTime() - times.start.getTime()
@ -71,7 +82,7 @@ function getTestRunResult(trx: TrxReport, testClasses: TestClass[]): TestRunResu
return new TestSuiteResult(tc.name, [group]) return new TestSuiteResult(tc.name, [group])
}) })
return new TestRunResult(suites, totalTime) return new TestRunResult(path, suites, totalTime)
} }
function getTestClasses(trx: TrxReport): TestClass[] { function getTestClasses(trx: TrxReport): TestClass[] {

View file

@ -16,24 +16,36 @@ import {
import getReport from '../../report/get-report' import getReport from '../../report/get-report'
export async function parseJestJunit(files: FileContent[], options: ParseOptions): Promise<TestResult> { export async function parseJestJunit(files: FileContent[], options: ParseOptions): Promise<TestResult> {
const junit = (await parseStringPromise(files[0].content, { const junit: JunitReport[] = []
attrValueProcessors: [parseAttribute] const testRuns: TestRunResult[] = []
})) as JunitReport
const testsuites = junit.testsuites for (const file of files) {
const success = !(testsuites.$?.failures > 0 || testsuites.$?.errors > 0) const ju = await getJunitReport(file.content)
const tr = getTestRunResult(file.path, ju)
junit.push(ju)
testRuns.push(tr)
}
const success = testRuns.every(tr => tr.result === 'success')
const icon = success ? Icon.success : Icon.fail const icon = success ? Icon.success : Icon.fail
return { return {
success, success,
output: { output: {
title: `${options.name.trim()} ${icon}`, title: `${options.name.trim()} ${icon}`,
summary: getSummary(junit), summary: getReport(testRuns),
annotations: options.annotations ? getAnnotations(junit, options.workDir, options.trackedFiles) : undefined annotations: options.annotations ? getAnnotations(junit, options.workDir, options.trackedFiles) : undefined
} }
} }
} }
function getSummary(junit: JunitReport): string { async function getJunitReport(content: string): Promise<JunitReport> {
return (await parseStringPromise(content, {
attrValueProcessors: [parseAttribute]
})) as JunitReport
}
function getTestRunResult(path: string, junit: JunitReport): TestRunResult {
const suites = junit.testsuites.testsuite.map(ts => { const suites = junit.testsuites.testsuite.map(ts => {
const name = ts.$.name.trim() const name = ts.$.name.trim()
const time = ts.$.time * 1000 const time = ts.$.time * 1000
@ -42,8 +54,7 @@ function getSummary(junit: JunitReport): string {
}) })
const time = junit.testsuites.$.time * 1000 const time = junit.testsuites.$.time * 1000
const tr = new TestRunResult(suites, time) return new TestRunResult(path, suites, time)
return getReport(tr)
} }
function getGroups(suite: TestSuite): TestGroupResult[] { function getGroups(suite: TestSuite): TestGroupResult[] {
@ -74,26 +85,28 @@ function getTestCaseResult(test: TestCase): TestExecutionResult {
return 'success' return 'success'
} }
function getAnnotations(junit: JunitReport, workDir: string, trackedFiles: string[]): Annotation[] { function getAnnotations(junitReports: JunitReport[], workDir: string, trackedFiles: string[]): Annotation[] {
const annotations: Annotation[] = [] const annotations: Annotation[] = []
for (const suite of junit.testsuites.testsuite) { for (const junit of junitReports) {
for (const tc of suite.testcase) { for (const suite of junit.testsuites.testsuite) {
if (!tc.failure) { for (const tc of suite.testcase) {
continue if (!tc.failure) {
}
for (const ex of tc.failure) {
const src = exceptionThrowSource(ex, workDir, trackedFiles)
if (src === null) {
continue continue
} }
annotations.push({ for (const ex of tc.failure) {
annotation_level: 'failure', const src = exceptionThrowSource(ex, workDir, trackedFiles)
start_line: src.line, if (src === null) {
end_line: src.line, continue
path: src.file, }
message: fixEol(ex), annotations.push({
title: `[${suite.$.name}] ${tc.$.name.trim()}` annotation_level: 'failure',
}) start_line: src.line,
end_line: src.line,
path: src.file,
message: fixEol(ex),
title: `[${suite.$.name}] ${tc.$.name.trim()}`
})
}
} }
} }
} }

View file

@ -2,9 +2,21 @@ import {TestExecutionResult, TestRunResult, TestSuiteResult} from './test-result
import {Align, Icon, link, table} from '../utils/markdown-utils' import {Align, Icon, link, table} from '../utils/markdown-utils'
import {slug} from '../utils/slugger' import {slug} from '../utils/slugger'
export default function getReport(tr: TestRunResult): string { export default function getReport(results: TestRunResult[]): string {
const runsSummary = results.map(getRunSummary).join('\n\n')
const suites = results
.flatMap(tr => tr.suites)
.map((ts, i) => getSuiteSummary(ts, i))
.join('\n')
const suitesSection = `# Test Suites\n\n${suites}`
return [runsSummary, suitesSection].join('\n\n')
}
function getRunSummary(tr: TestRunResult): string {
const time = `${(tr.time / 1000).toFixed(3)}s` const time = `${(tr.time / 1000).toFixed(3)}s`
const headingLine = `**${tr.tests}** tests were completed in **${time}** with **${tr.passed}** passed, **${tr.skipped}** skipped and **${tr.failed}** failed.` const headingLine1 = `### ${tr.path}`
const headingLine2 = `**${tr.tests}** tests were completed in **${time}** with **${tr.passed}** passed, **${tr.skipped}** skipped and **${tr.failed}** failed.`
const suitesSummary = tr.suites.map((s, i) => { const suitesSummary = tr.suites.map((s, i) => {
const icon = getResultIcon(s.result) const icon = getResultIcon(s.result)
@ -12,19 +24,16 @@ export default function getReport(tr: TestRunResult): string {
const tsName = s.name const tsName = s.name
const tsAddr = makeSuiteSlug(i, tsName).link const tsAddr = makeSuiteSlug(i, tsName).link
const tsNameLink = link(tsName, tsAddr) const tsNameLink = link(tsName, tsAddr)
return [icon, tsNameLink, s.tests, tsTime, s.passed, s.failed, s.skipped] return [icon, tsNameLink, s.tests, tsTime, s.passed, s.skipped, s.failed]
}) })
const summary = table( const summary = table(
['Result', 'Suite', 'Tests', 'Time', `Passed ${Icon.success}`, `Failed ${Icon.fail}`, `Skipped ${Icon.skip}`], ['Result', 'Suite', 'Tests', 'Time', `Passed ${Icon.success}`, `Skipped ${Icon.skip}`, `Failed ${Icon.fail}`],
[Align.Center, Align.Left, Align.Right, Align.Right, Align.Right, Align.Right, Align.Right], [Align.Center, Align.Left, Align.Right, Align.Right, Align.Right, Align.Right, Align.Right],
...suitesSummary ...suitesSummary
) )
const suites = tr.suites.map((ts, i) => getSuiteSummary(ts, i)).join('\n') return [headingLine1, headingLine2, summary].join('\n\n')
const suitesSection = `# Test Suites\n\n${suites}`
return `${headingLine}\n${summary}\n${suitesSection}`
} }
function getSuiteSummary(ts: TestSuiteResult, index: number): string { function getSuiteSummary(ts: TestSuiteResult, index: number): string {

View file

@ -1,5 +1,5 @@
export class TestRunResult { export class TestRunResult {
constructor(readonly suites: TestSuiteResult[], private totalTime?: number) {} constructor(readonly path: string, readonly suites: TestSuiteResult[], private totalTime?: number) {}
get tests(): number { get tests(): number {
return this.suites.reduce((sum, g) => sum + g.tests, 0) return this.suites.reduce((sum, g) => sum + g.tests, 0)