Skip to content

Commit

Permalink
Add support for loading test results from artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
dorny committed Feb 15, 2021
1 parent 71f2f95 commit 3510d9a
Show file tree
Hide file tree
Showing 19 changed files with 14,632 additions and 3,305 deletions.
10 changes: 5 additions & 5 deletions __tests__/dart-json.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down
9 changes: 4 additions & 5 deletions __tests__/dotnet-trx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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)
Expand All @@ -36,8 +36,7 @@ describe('dotnet-trx tests', () => {

const opts: ParseOptions = {
trackedFiles: [],
parseErrors: true,
workDir: ''
parseErrors: true
}

const parser = new DotnetTrxParser(opts)
Expand Down
10 changes: 5 additions & 5 deletions __tests__/jest-junit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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)
Expand All @@ -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)
Expand Down
Loading

0 comments on commit 3510d9a

Please sign in to comment.