Add support for loading test results from artifacts

This commit is contained in:
Michal Dorner 2021-02-15 15:18:24 +01:00
parent 71f2f95ef0
commit 3510d9ac27
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
19 changed files with 11665 additions and 338 deletions

View file

@ -4,14 +4,14 @@ import * as path from 'path'
import {DartJsonParser} from '../src/parsers/dart-json/dart-json-parser'
import {ParseOptions} from '../src/test-parser'
import {getReport} from '../src/report/get-report'
import {normalizeFilePath} from '../src/utils/file-utils'
import {normalizeFilePath} from '../src/utils/path-utils'
describe('dart-json tests', () => {
it('matches report snapshot', async () => {
const opts: ParseOptions = {
parseErrors: true,
trackedFiles: ['lib/main.dart', 'test/main_test.dart', 'test/second_test.dart'],
workDir: 'C:/Users/Michal/Workspace/dorny/test-check/reports/dart/'
trackedFiles: ['lib/main.dart', 'test/main_test.dart', 'test/second_test.dart']
//workDir: 'C:/Users/Michal/Workspace/dorny/test-check/reports/dart/'
}
const fixturePath = path.join(__dirname, 'fixtures', 'dart-json.json')
@ -38,8 +38,8 @@ describe('dart-json tests', () => {
const trackedFiles = fs.readFileSync(trackedFilesPath, {encoding: 'utf8'}).split(/\n\r?/g)
const opts: ParseOptions = {
trackedFiles,
parseErrors: true,
workDir: '/__w/provider/provider/'
parseErrors: true
//workDir: '/__w/provider/provider/'
}
const parser = new DartJsonParser(opts, 'flutter')

View file

@ -4,7 +4,7 @@ import * as path from 'path'
import {DotnetTrxParser} from '../src/parsers/dotnet-trx/dotnet-trx-parser'
import {ParseOptions} from '../src/test-parser'
import {getReport} from '../src/report/get-report'
import {normalizeFilePath} from '../src/utils/file-utils'
import {normalizeFilePath} from '../src/utils/path-utils'
describe('dotnet-trx tests', () => {
it('matches report snapshot', async () => {
@ -15,8 +15,8 @@ describe('dotnet-trx tests', () => {
const opts: ParseOptions = {
parseErrors: true,
trackedFiles: ['DotnetTests.Unit/Calculator.cs', 'DotnetTests.XUnitTests/CalculatorTests.cs'],
workDir: 'C:/Users/Michal/Workspace/dorny/test-check/reports/dotnet/'
trackedFiles: ['DotnetTests.Unit/Calculator.cs', 'DotnetTests.XUnitTests/CalculatorTests.cs']
//workDir: 'C:/Users/Michal/Workspace/dorny/test-check/reports/dotnet/'
}
const parser = new DotnetTrxParser(opts)
@ -36,8 +36,7 @@ describe('dotnet-trx tests', () => {
const opts: ParseOptions = {
trackedFiles: [],
parseErrors: true,
workDir: ''
parseErrors: true
}
const parser = new DotnetTrxParser(opts)

View file

@ -4,7 +4,7 @@ import * as path from 'path'
import {JestJunitParser} from '../src/parsers/jest-junit/jest-junit-parser'
import {ParseOptions} from '../src/test-parser'
import {getReport} from '../src/report/get-report'
import {normalizeFilePath} from '../src/utils/file-utils'
import {normalizeFilePath} from '../src/utils/path-utils'
describe('jest-junit tests', () => {
it('report from ./reports/jest test results matches snapshot', async () => {
@ -15,8 +15,8 @@ describe('jest-junit tests', () => {
const opts: ParseOptions = {
parseErrors: true,
trackedFiles: ['__tests__/main.test.js', '__tests__/second.test.js', 'lib/main.js'],
workDir: 'C:/Users/Michal/Workspace/dorny/test-check/reports/jest/'
trackedFiles: ['__tests__/main.test.js', '__tests__/second.test.js', 'lib/main.js']
//workDir: 'C:/Users/Michal/Workspace/dorny/test-check/reports/jest/'
}
const parser = new JestJunitParser(opts)
@ -38,8 +38,8 @@ describe('jest-junit tests', () => {
const trackedFiles = fs.readFileSync(trackedFilesPath, {encoding: 'utf8'}).split(/\n\r?/g)
const opts: ParseOptions = {
parseErrors: true,
trackedFiles,
workDir: '/home/dorny/dorny/jest/'
trackedFiles
//workDir: '/home/dorny/dorny/jest/'
}
const parser = new JestJunitParser(opts)