Add list-suites and list-tests options to limit report size

This commit is contained in:
Michal Dorner 2021-01-25 12:53:45 +01:00
parent 0919385c06
commit 3744805866
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
20 changed files with 28593 additions and 18534 deletions

View file

@ -3,7 +3,7 @@ import {Annotation, FileContent, ParseOptions, TestResult} from '../parser-types
import {parseStringPromise} from 'xml2js'
import {JunitReport, TestCase, TestSuite} from './jest-junit-types'
import {fixEol, Icon} from '../../utils/markdown-utils'
import {fixEol} from '../../utils/markdown-utils'
import {normalizeFilePath} from '../../utils/file-utils'
import {
@ -13,7 +13,6 @@ import {
TestGroupResult,
TestCaseResult
} from '../../report/test-results'
import getReport from '../../report/get-report'
export async function parseJestJunit(files: FileContent[], options: ParseOptions): Promise<TestResult> {
const junit: JunitReport[] = []
@ -26,16 +25,9 @@ export async function parseJestJunit(files: FileContent[], options: ParseOptions
testRuns.push(tr)
}
const success = testRuns.every(tr => tr.result === 'success')
const icon = success ? Icon.success : Icon.fail
return {
success,
output: {
title: `${options.name.trim()} ${icon}`,
summary: getReport(testRuns),
annotations: options.annotations ? getAnnotations(junit, options.workDir, options.trackedFiles) : undefined
}
testRuns,
annotations: options.annotations ? getAnnotations(junit, options.workDir, options.trackedFiles) : []
}
}