Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Connor 2024-03-01 10:18:01 -06:00
parent 258d3a0780
commit dd2ae7c835
No known key found for this signature in database
GPG key ID: 455C6C81CB2BD091
38 changed files with 40986 additions and 17818 deletions

View file

@ -29,7 +29,12 @@ import {
} from '../../test-results'
class TestRun {
constructor(readonly path: string, readonly suites: TestSuite[], readonly success: boolean, readonly time: number) {}
constructor(
readonly path: string,
readonly suites: TestSuite[],
readonly success: boolean,
readonly time: number
) {}
}
class TestSuite {
@ -74,7 +79,10 @@ class TestCase {
export class DartJsonParser implements TestParser {
assumedWorkDir: string | undefined
constructor(readonly options: ParseOptions, readonly sdk: 'dart' | 'flutter') {}
constructor(
readonly options: ParseOptions,
readonly sdk: 'dart' | 'flutter'
) {}
async parse(path: string, content: string): Promise<TestRunResult> {
const tr = this.getTestRun(path, content)

View file

@ -37,7 +37,7 @@ export class JestJunitParser implements TestParser {
junit.testsuites.testsuite === undefined
? []
: junit.testsuites.testsuite.map(ts => {
const name = ts.$.name.trim()
const name = this.escapeCharacters(ts.$.name.trim())
const time = parseFloat(ts.$.time) * 1000
const sr = new TestSuiteResult(name, this.getGroups(ts), time)
return sr
@ -118,4 +118,8 @@ export class JestJunitParser implements TestParser {
(this.assumedWorkDir = getBasePath(path, this.options.trackedFiles))
)
}
private escapeCharacters(s: string): string {
return s.replace(/([<>])/g, '\\$1')
}
}

View file

@ -0,0 +1,8 @@
import {ParseOptions} from '../../test-parser'
import {JavaJunitParser} from '../java-junit/java-junit-parser'
export class SwiftXunitParser extends JavaJunitParser {
constructor(readonly options: ParseOptions) {
super(options)
}
}