From 273edff338f7d97dae692c150844d0a43c9d73b8 Mon Sep 17 00:00:00 2001 From: agracio Date: Wed, 13 Nov 2024 17:29:39 +0000 Subject: [PATCH] updating code --- README.md | 12 +- src/junit.js | 81 +++- src/nunit-junit.xslt | 8 +- src/trx-junit.xslt | 10 +- src/xslt.js | 2 +- src/xunit-junit.xslt | 4 +- tests/converter.junit.test.js | 54 +-- tests/converter.trx.test.js | 90 ++-- tests/converter.xunit.test.js | 50 +-- .../result/junit-jenkins-mochawesome.json | 24 +- .../trx-mstest-datadriven-mochawesome.json | 38 +- .../result/trx-mstest-ignore-mochawesome.json | 135 ++++++ tests/data/result/trx-mstest-mochawesome.json | 253 +++++++++++ .../trx-nunit-datadriven-mochawesome.json | 38 +- .../result/trx-nunit-ignore-mochawesome.json | 153 +++++++ tests/data/result/trx-nunit-mochawesome.json | 407 ++++++++++++++++++ .../trx-xunit-datadriven-mochawesome.json | 38 +- .../result/trx-xunit-ignore-mochawesome.json | 135 ++++++ tests/data/result/trx-xunit-mochawesome.json | 371 ++++++++++++++++ tests/data/source/junit-mocha-xunit.xml | 28 +- tests/data/source/trx-mstest-ignore.trx | 61 +++ tests/data/source/trx-mstest.trx | 114 +++++ tests/data/source/trx-nunit-ignore.trx | 75 ++++ tests/data/source/trx-nunit.trx | 220 ++++++++++ tests/data/source/trx-xunit-ignore.trx | 68 +++ tests/data/source/trx-xunit.trx | 220 ++++++++++ tests/setup.js | 45 ++ 27 files changed, 2502 insertions(+), 232 deletions(-) create mode 100644 tests/data/result/trx-mstest-ignore-mochawesome.json create mode 100644 tests/data/result/trx-mstest-mochawesome.json create mode 100644 tests/data/result/trx-nunit-ignore-mochawesome.json create mode 100644 tests/data/result/trx-nunit-mochawesome.json create mode 100644 tests/data/result/trx-xunit-ignore-mochawesome.json create mode 100644 tests/data/result/trx-xunit-mochawesome.json create mode 100644 tests/data/source/trx-mstest-ignore.trx create mode 100644 tests/data/source/trx-mstest.trx create mode 100644 tests/data/source/trx-nunit-ignore.trx create mode 100644 tests/data/source/trx-nunit.trx create mode 100644 tests/data/source/trx-xunit-ignore.trx create mode 100644 tests/data/source/trx-xunit.trx create mode 100644 tests/setup.js diff --git a/README.md b/README.md index b11c872..8889a83 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ https://github.com/adamgruber/mochawesome - Converts <skipped> test messages to Mochawesome test context values. - Converts <failure> and <error> elements to Mochawesome error stack. - Test suites are displayed in alphabetical order by `file` and `classname` attributes. -- Tests suites without any tests are not displayed. -- Attachments currently not supported. +- Tests suites without any tests are excluded from Mochawesome and JUnit. +- Attachments are not supported. ### JUnit @@ -70,10 +70,10 @@ https://github.com/adamgruber/mochawesome ### Visual Studio TRX -- Converts **<Output><ErrorInfo><Message>** to JUnit **<failure>** message. -- Converts **<Output><ErrorInfo><StackTrace>** to JUnit **<failure>** stack trace. -- Converts **<Output><StdErr>** to JUnit **<system-err>**. -- Converts **<Output><StdOut>** to JUnit **<system-out>**. +- Converts `Output/ErrorInfo/Message` to JUnit **<failure>** message. +- Converts `Output/ErrorInfo/StackTrace` to JUnit **<failure>** stack trace. +- Converts `Output/StdErr` to JUnit **<system-err>**. +- Converts `Output/StdOut` to JUnit **<system-out>**. - Tests are ordered by name in Mochawesome. - Does not resolve test suite times in JUnit output. diff --git a/src/junit.js b/src/junit.js index dacea4e..624c5a2 100644 --- a/src/junit.js +++ b/src/junit.js @@ -3,12 +3,17 @@ const path = require('path'); const parser = require('p3x-xml2json'); const crypto = require("crypto"); const marge = require('mochawesome-report-generator'); +const xmlFormat = require('xml-formatter'); const _ = require('lodash'); let skippedTests = 0; let failedTests = 0; let suites = []; +function parseTrx(){ + +} + /** * @param {ConverterOptions} options * @param {string|Buffer} xml @@ -20,6 +25,7 @@ function parseXml(options, xml){ object: true, arrayNotation: true, sanitize: false, + reversible: true, } let json; @@ -31,7 +37,6 @@ function parseXml(options, xml){ throw `\nCould not read JSON from converted input ${options.testFile}.\n ${e.message}`; } - if(!json || !json.testsuites || !json.testsuites.length){ if(json && json.testsuite){ json.testsuites = [{testsuite: json.testsuite}]; @@ -44,9 +49,18 @@ function parseXml(options, xml){ if(options.saveIntermediateFiles){ let fileName = `${path.parse(options.testFile).name}-converted.json`; - fs.writeFileSync(path.join(options.reportDir, fileName), JSON.stringify(json, null, 2), 'utf8') + fs.writeFileSync(path.join(options.reportDir, fileName), JSON.stringify(json, null, 2), 'utf8'); } + // if(options.saveIntermediateFiles){ + // let jsonString = JSON.stringify(json, null, 2).replaceAll(' ', '').replaceAll(' ', ''); + // + // json = JSON.parse(jsonString); + // let fileName = `${path.parse(options.testFile).name}-converted.xml`; + // fs.writeFileSync(path.join(options.reportDir, fileName), xmlFormat(parser.toXml(json), {forceSelfClosingEmptyTag: true}), 'utf8'); + // + // } + if(!json.testsuites[0].testsuite){ throw `\nNo elements in element in converted ${options.testFile}`; } @@ -59,12 +73,58 @@ function parseXml(options, xml){ json.testsuites[0].testsuite = _.sortBy(json.testsuites[0].testsuite, ['classname']) } else{ - json.testsuites[0].testsuite.sort((a,b) => a.name - b.name); + //json.testsuites[0].testsuite.sort((a,b) => a.name - b.name); //json.testsuites[0].testsuite = _.sortBy(json.testsuites[0].testsuite, ['name']) } if(options.testType === 'trx' && json.testsuites[0].testsuite[0].testcase.length !== 0){ + json.testsuites[0].testsuite[0].testcase = _.sortBy(json.testsuites[0].testsuite[0].testcase, ['name']); + + let classnames = _.map(json.testsuites[0].testsuite[0].testcase, 'classname') + .filter((value, index, array) => array.indexOf(value) === index); + + classnames = _.sortBy(classnames, [function(o) { return o; }]); + + let time = _.sumBy(json.testsuites[0].testsuite, suite => _.sumBy(suite.testcase, function(testCase) { return Number(testCase.time); })); + + json.testsuites[0].time = time; + json.testsuites[0].testsuite[0].time = time; + + if(classnames.length > 1){ + + let testSuites = []; + classnames.forEach((classname) => { + + let testcases = _.filter(json.testsuites[0].testsuite[0].testcase, { 'classname': classname}); + let time = _.sumBy(testcases, function(testCase) { return Number(testCase.time); }); + const failures = testcases.filter((testCase) => testCase.status === 'Failed').length; + const skipped = testcases.filter((testCase) => testCase.status === 'Skipped').length; + + testSuites.push( + { + name: classname, + tests: `${testcases.length}`, + failures: `${failures}`, + skipped: `${skipped}`, + time: `${time}`, + testcase: testcases, + } + ); + }); + + json.testsuites[0].testsuite = testSuites; + } + + else{ + json.testsuites[0].testsuite[0].time = time; + json.testsuites[0].testsuite[0].name = json.testsuites[0].testsuite[0].testcase[0].classname; + + } + + if(options.junit){ + fs.writeFileSync(path.join(options.reportDir, options.junitReportFilename), xmlFormat(parser.toXml(json), {forceSelfClosingEmptyTag: true}), 'utf8'); + } } return json.testsuites[0]; @@ -84,9 +144,12 @@ function getError(testcase){ let failure = testcase.failure ? testcase.failure : testcase.error let fail = failure[0]; let prefix = fail.type ? `${fail.type}: ` : '' - let diff = !fail.type || fail.type === 'Error' ? null : `${fail.message}`; - if(fail.message || fail.$t){ + let diff = null; + // diff = !fail.type || fail.type === 'Error' ? null : `${fail.message}`; + if(fail.message){ message = `${prefix}${fail.message.replaceAll(' ', '').replaceAll(' ', '')}`; + } + if(fail.$t){ estack = fail.$t.replaceAll(' ', '\n'); } else if(typeof fail === 'string'){ @@ -134,11 +197,15 @@ function getContext(testcase){ } if(testcase["system-out"] && testcase["system-out"].length !== 0){ - if(testcase["system-out"][0] !== skipped){ + let systemout = testcase["system-out"][0]; + if(systemout.$t){ + systemout = systemout.$t; + } + if(systemout !== skipped){ context.push( { title: 'system-out', - value: testcase["system-out"][0] + value: systemout } ); } diff --git a/src/nunit-junit.xslt b/src/nunit-junit.xslt index f7f19be..a99d57b 100644 --- a/src/nunit-junit.xslt +++ b/src/nunit-junit.xslt @@ -12,11 +12,14 @@ + + + - + @@ -37,7 +40,8 @@ - + + diff --git a/src/trx-junit.xslt b/src/trx-junit.xslt index fd631f6..e182e74 100644 --- a/src/trx-junit.xslt +++ b/src/trx-junit.xslt @@ -94,7 +94,15 @@ - + + + + + + + + + diff --git a/src/xslt.js b/src/xslt.js index 59887f2..8d0360b 100644 --- a/src/xslt.js +++ b/src/xslt.js @@ -24,7 +24,7 @@ async function processXml(options, xmlString){ throw `\nXML parsed from ${options.testFile} is invalid \n${e.message}`; } - if(options.junit){ + if(options.junit && options.testType !== 'trx'){ fs.writeFileSync(path.join(options.reportDir, options.junitReportFilename), parsedXml, 'utf8'); } diff --git a/src/xunit-junit.xslt b/src/xunit-junit.xslt index 081c7aa..9c498b7 100644 --- a/src/xunit-junit.xslt +++ b/src/xunit-junit.xslt @@ -27,11 +27,13 @@ + + - + diff --git a/tests/converter.junit.test.js b/tests/converter.junit.test.js index ecc2d11..8949968 100644 --- a/tests/converter.junit.test.js +++ b/tests/converter.junit.test.js @@ -1,13 +1,12 @@ -const path = require('path'); const fs = require("fs"); -const expect = require('@jest/globals').expect; const test = require('@jest/globals').test; const beforeAll = require('@jest/globals').beforeAll; const afterAll = require('@jest/globals').afterAll; const describe = require('@jest/globals').describe; const converter = require('../src/converter'); +const setup = require("./setup"); describe("JUnit converter tests", () => { @@ -15,70 +14,39 @@ describe("JUnit converter tests", () => { const reportDir= './tests/data/result'; beforeAll(() => { - if(fs.existsSync(outDir)){ - fs.rmSync(outDir, { recursive: true, force: true }); - } + setup.removeTempDir(); }); // afterAll(() => { - // if(fs.existsSync(outDir)){ - // fs.rmSync(outDir, { recursive: true, force: true }); - // } + // setup.removeTempDir(); // }); - function getFilename(file){ - return `${path.parse(file).name}-mochawesome.json` - } - - /** - * @returns {TestReportConverterOptions} - */ - function createOptions(file, type){ - return { - testFile: path.join(__dirname, `data/source/${file}`), - testType: type, - reportDir: outDir, - reportFilename: getFilename(file), - } - } - - /** - * @param {TestReportConverterOptions} options - * @param {string?} reportFilename - */ - function compare(options, reportFilename){ - let createdReport = fs.readFileSync(path.join(outDir, options.reportFilename), 'utf8'); - let report = fs.readFileSync(path.join(reportDir, reportFilename ?? options.reportFilename), 'utf8'); - - expect(createdReport.replaceAll(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,'')).toBe(report.replaceAll(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,'')); - } - test('convert junit-jenkins.xml', async() => { - let options = createOptions('junit-jenkins.xml', 'junit'); + let options = setup.createOptions('junit-jenkins.xml', 'junit'); await converter(options); - compare(options); + setup.compare(options); }); test('convert junit-notestsuites.xml', async() => { - let options = createOptions('junit-notestsuites.xml', 'junit'); + let options = setup.createOptions('junit-notestsuites.xml', 'junit'); await converter(options); - compare(options, 'junit-jenkins-mochawesome.json'); + setup.compare(options, 'junit-jenkins-mochawesome.json'); }); test('convert junit-testsuites-noattributes.xml', async() => { - let options = createOptions('junit-testsuites-noattributes.xml', 'junit'); + let options = setup.createOptions('junit-testsuites-noattributes.xml', 'junit'); await converter(options); - compare(options, 'junit-jenkins-mochawesome.json'); + setup.compare(options, 'junit-jenkins-mochawesome.json'); }); test('convert junit-mocha-xunit.xml', async() => { - let options = createOptions('junit-mocha-xunit.xml', 'junit') + let options = setup.createOptions('junit-mocha-xunit.xml', 'junit') await converter(options); - compare(options); + setup.compare(options); }); }); \ No newline at end of file diff --git a/tests/converter.trx.test.js b/tests/converter.trx.test.js index b98ed8e..14b5039 100644 --- a/tests/converter.trx.test.js +++ b/tests/converter.trx.test.js @@ -1,75 +1,75 @@ -const path = require('path'); const fs = require("fs"); -const expect = require('@jest/globals').expect; const test = require('@jest/globals').test; const beforeAll = require('@jest/globals').beforeAll; const afterAll = require('@jest/globals').afterAll; const describe = require('@jest/globals').describe; +const setup = require('./setup'); const converter = require('../src/converter'); -const config = require('../src/config'); -describe("TRX converter tests", () => { - - const outDir= './tests/data/tmp'; - const reportDir= './tests/data/result'; +describe.only("TRX converter tests", () => { beforeAll(() => { - if(fs.existsSync(outDir)){ - fs.rmSync(outDir, { recursive: true, force: true }); - } + setup.removeTempDir(); }); // afterAll(() => { - // if(fs.existsSync(outDir)){ - // fs.rmSync(outDir, { recursive: true, force: true }); - // } + // setup.removeTempDir(); // }); - function getFilename(file){ - return `${path.parse(file).name}-mochawesome.json` - } + test('convert trx-mstest-datadriven.trx', async() => { + let options = setup.createOptions('trx-mstest-datadriven.trx', 'trx') + await converter(options); + setup.compare(options); + }); - /** - * @returns {TestReportConverterOptions} options - */ - function createOptions(file, type){ - return { - testFile: path.join(__dirname, `data/source/${file}`), - testType: type, - reportDir: outDir, - reportFilename: getFilename(file), - junit: true - } - } + test('convert trx-nunit-datadriven.trx', async() => { + let options = setup.createOptions('trx-nunit-datadriven.trx', 'trx') + await converter(options); + setup.compare(options); + }); - /** - * @param {TestReportConverterOptions} options - */ - async function compare(options){ - let createdReport = fs.readFileSync(path.join(outDir, options.reportFilename), 'utf8'); - let report = fs.readFileSync(path.join(reportDir, options.reportFilename), 'utf8'); + test('convert trx-xunit-datadriven.trx', async() => { + let options = setup.createOptions('trx-xunit-datadriven.trx', 'trx') + await converter(options); + setup.compare(options); + }); - await expect(createdReport.replaceAll(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,'')).toBe(report.replaceAll(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,'')); - } + test('convert trx-mstest-ignore.trx', async() => { + let options = setup.createOptions('trx-mstest-ignore.trx', 'trx') + await converter(options); + setup.compare(options); + }); - test('convert trx-mstest-datadriven.trx', async() => { - let options = createOptions('trx-mstest-datadriven.trx', 'trx') + test('convert trx-nunit-ignore.trx', async() => { + let options = setup.createOptions('trx-nunit-ignore.trx', 'trx') await converter(options); - await compare(options); + setup.compare(options); }); - test('convert trx-nunit-datadriven.trx', async() => { - let options = createOptions('trx-nunit-datadriven.trx', 'trx') + test('convert trx-xunit-ignore.trx', async() => { + let options = setup.createOptions('trx-xunit-ignore.trx', 'trx') await converter(options); - await compare(options); + setup.compare(options); }); - test('convert trx-xunit-datadriven.trx', async() => { - let options = createOptions('trx-xunit-datadriven.trx', 'trx') + test('convert trx-mstest.trx', async() => { + let options = setup.createOptions('trx-mstest.trx', 'trx') + await converter(options); + setup.compare(options); + }); + + test('convert trx-nunit.trx', async() => { + let options = setup.createOptions('trx-nunit.trx', 'trx') + await converter(options); + setup.compare(options); + }); + + test('convert trx-xunit.trx', async() => { + let options = setup.createOptions('trx-xunit.trx', 'trx') await converter(options); - await compare(options); + setup.compare(options); }); }); \ No newline at end of file diff --git a/tests/converter.xunit.test.js b/tests/converter.xunit.test.js index 78baaf7..bd10f9b 100644 --- a/tests/converter.xunit.test.js +++ b/tests/converter.xunit.test.js @@ -1,69 +1,33 @@ -const path = require('path'); const fs = require("fs"); -const expect = require('@jest/globals').expect; const test = require('@jest/globals').test; const beforeAll = require('@jest/globals').beforeAll; const afterAll = require('@jest/globals').afterAll; const describe = require('@jest/globals').describe; const converter = require('../src/converter'); -const config = require('../src/config'); +const setup = require('./setup'); describe("xUnit.net converter tests", () => { - const outDir= './tests/data/tmp'; - const reportDir= './tests/data/result'; - beforeAll(() => { - if(fs.existsSync(outDir)){ - fs.rmSync(outDir, { recursive: true, force: true }); - } + setup.removeTempDir(); }); // afterAll(() => { - // if(fs.existsSync(outDir)){ - // fs.rmSync(outDir, { recursive: true, force: true }); - // } + // setup.removeTempDir(); // }); - function getFilename(file){ - return `${path.parse(file).name}-mochawesome.json` - } - - /** - * @returns {TestReportConverterOptions} options - */ - function createOptions(file, type){ - return { - testFile: path.join(__dirname, `data/source/${file}`), - testType: type, - reportDir: outDir, - reportFilename: getFilename(file), - junit: true - } - } - - /** - * @param {TestReportConverterOptions} options - */ - async function compare(options){ - let createdReport = fs.readFileSync(path.join(outDir, options.reportFilename), 'utf8'); - let report = fs.readFileSync(path.join(reportDir, options.reportFilename), 'utf8'); - - await expect(createdReport.replaceAll(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,'')).toBe(report.replaceAll(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,'')); - } - test('convert xunit-sample.xml', async() => { - let options = createOptions('xunit-sample.xml', 'xunit') + let options = setup.createOptions('xunit-sample.xml', 'xunit') await converter(options); - await compare(options); + setup.compare(options); }); test('convert xunit-qlnet.xml', async() => { - let options = createOptions('xunit-qlnet.xml', 'xunit') + let options = setup.createOptions('xunit-qlnet.xml', 'xunit') await converter(options); - await compare(options); + setup.compare(options); }); }); \ No newline at end of file diff --git a/tests/data/result/junit-jenkins-mochawesome.json b/tests/data/result/junit-jenkins-mochawesome.json index 503ca3b..f46d8c2 100644 --- a/tests/data/result/junit-jenkins-mochawesome.json +++ b/tests/data/result/junit-jenkins-mochawesome.json @@ -16,7 +16,7 @@ }, "results": [ { - "uuid": "fb7d8707-a801-47bc-b1a6-9ef17737d540", + "uuid": "f0a8889a-a3a3-44ca-a98b-c56b44a2820c", "title": "", "fullFile": "", "file": "", @@ -25,7 +25,7 @@ "tests": [], "suites": [ { - "uuid": "6e750215-897a-4c32-90a7-e54c5485f5fd", + "uuid": "4e9d6c4e-e0d0-4edf-8641-e659b8521ea3", "title": "PatientRegistration.Patient Registration (Example)", "file": "", "beforeHooks": [], @@ -43,8 +43,8 @@ "context": "[{\"title\":\"system-out\",\"value\":\"@scenario.begin\\n\\n @tc:62\\n Scenario: Create patient\\n When I create a patient with name \\\"John Doe\\\" on the host ... passed in 0.005s\\n Then the patient \\\"John Doe\\\" should also be created in the application. ... passed in 0.011s\\n\\n@scenario.end\\n--------------------------------------------------------------------------------\"}]", "code": null, "err": {}, - "uuid": "475d5a7e-6af8-45cb-a91a-5eb3318fd798", - "parentUUID": "6e750215-897a-4c32-90a7-e54c5485f5fd", + "uuid": "f1cfcfd4-7a47-4eb7-8980-100f94f85ce6", + "parentUUID": "4e9d6c4e-e0d0-4edf-8641-e659b8521ea3", "isHook": false, "skipped": false }, @@ -60,8 +60,8 @@ "context": "[{\"title\":\"system-out\",\"value\":\"@scenario.begin\\n\\n @tc:63\\n Scenario: Close patient\\n Given a patient is opened in the application ... passed in 0.005s\\n When I close the patient on the host ... passed in 0.005s\\n Then the patient should also be closed in the application. ... passed in 0.005s\\n\\n@scenario.end\\n--------------------------------------------------------------------------------\"}]", "code": null, "err": {}, - "uuid": "4531d410-f408-46c1-b7d9-4efe641108dd", - "parentUUID": "6e750215-897a-4c32-90a7-e54c5485f5fd", + "uuid": "b6496130-9548-44ff-b7de-954ed06af71d", + "parentUUID": "4e9d6c4e-e0d0-4edf-8641-e659b8521ea3", "isHook": false, "skipped": false }, @@ -79,21 +79,21 @@ "err": { "message": "TypeError: edit() missing 2 required positional arguments: 'birth_date' and 'sex'", "estack": "Failing step: When I change the patient name to \"John Doe\" on the host ... failed in 0.001s\nLocation: tests/features/PatientRegistration.feature:20\nTraceback (most recent call last):\n File \"D:\\dev\\bdd_demo_behave\\.venv\\lib\\site-packages\\behave\\model.py\", line 1329, in run\n match.run(runner.context)\n File \"D:\\dev\\bdd_demo_behave\\.venv\\lib\\site-packages\\behave\\matchers.py\", line 98, in run\n self.func(context, *args, **kwargs)\n File \"tests\\features\\steps\\step_patient_registration.py\", line 33, in step_impl\n context.patient.edit(first_name=\"John\", last_name=\"Doe\")\nTypeError: edit() missing 2 required positional arguments: 'birth_date' and 'sex'", - "diff": "edit() missing 2 required positional arguments: 'birth_date' and 'sex'" + "diff": null }, - "uuid": "e70ba736-1f3e-4a5f-9ff3-b627ed45c28a", - "parentUUID": "6e750215-897a-4c32-90a7-e54c5485f5fd", + "uuid": "0571e92b-63e8-4b1d-a573-4af8b0c50365", + "parentUUID": "4e9d6c4e-e0d0-4edf-8641-e659b8521ea3", "isHook": false, "skipped": false } ], "suites": [], "passes": [ - "475d5a7e-6af8-45cb-a91a-5eb3318fd798", - "4531d410-f408-46c1-b7d9-4efe641108dd" + "f1cfcfd4-7a47-4eb7-8980-100f94f85ce6", + "b6496130-9548-44ff-b7de-954ed06af71d" ], "failures": [ - "e70ba736-1f3e-4a5f-9ff3-b627ed45c28a" + "0571e92b-63e8-4b1d-a573-4af8b0c50365" ], "pending": [], "skipped": [], diff --git a/tests/data/result/trx-mstest-datadriven-mochawesome.json b/tests/data/result/trx-mstest-datadriven-mochawesome.json index 13aaec0..ab729f9 100644 --- a/tests/data/result/trx-mstest-datadriven-mochawesome.json +++ b/tests/data/result/trx-mstest-datadriven-mochawesome.json @@ -16,7 +16,7 @@ }, "results": [ { - "uuid": "8df1ebfb-24f1-40d4-b07f-b093244dbf8d", + "uuid": "ca4e8d53-07a4-4095-9467-f3fe651b7647", "title": "", "fullFile": "", "file": "", @@ -25,8 +25,8 @@ "tests": [], "suites": [ { - "uuid": "78f30052-7c14-459d-8bb2-279fba17290b", - "title": "MSTestSuite", + "uuid": "933cb7c7-61ec-45c3-9498-876edcdf2f3f", + "title": "MsTestSample.DataDriven", "file": "", "beforeHooks": [], "afterHooks": [], @@ -47,8 +47,8 @@ "estack": "at MsTestSample.DataDriven.Failing_test() in D:\\Work-Git\\github\\Mini\\trx2junit\\samples\\MsTestSample\\DataDriven.cs:line 25\n", "diff": null }, - "uuid": "ae79fd6a-4a64-4540-9266-071d0287eda3", - "parentUUID": "78f30052-7c14-459d-8bb2-279fba17290b", + "uuid": "bdbafc09-acba-42dc-87ad-b6b3a1cac70c", + "parentUUID": "933cb7c7-61ec-45c3-9498-876edcdf2f3f", "isHook": false, "skipped": false }, @@ -64,8 +64,8 @@ "context": null, "code": null, "err": {}, - "uuid": "ed0b688b-a43a-4b4b-9b9e-efe7fb394b26", - "parentUUID": "78f30052-7c14-459d-8bb2-279fba17290b", + "uuid": "fce746fd-7f78-4efb-967b-27ba7e7256c0", + "parentUUID": "933cb7c7-61ec-45c3-9498-876edcdf2f3f", "isHook": false, "skipped": false }, @@ -81,8 +81,8 @@ "context": null, "code": null, "err": {}, - "uuid": "504e0602-0a51-4707-a331-a5e989bb26f7", - "parentUUID": "78f30052-7c14-459d-8bb2-279fba17290b", + "uuid": "a126d245-fcd5-491f-b6d5-d3c709f95105", + "parentUUID": "933cb7c7-61ec-45c3-9498-876edcdf2f3f", "isHook": false, "skipped": false }, @@ -102,8 +102,8 @@ "estack": "at MsTestSample.DataDriven.Two_pass_one_fails(Int32 arg) in D:\\Work-Git\\github\\Mini\\trx2junit\\samples\\MsTestSample\\DataDriven.cs:line 16\n", "diff": null }, - "uuid": "12b53913-bf42-4108-b8dc-9bb7969ac7f4", - "parentUUID": "78f30052-7c14-459d-8bb2-279fba17290b", + "uuid": "478a767f-f510-47d3-a2bb-7c77bbf0e3fc", + "parentUUID": "933cb7c7-61ec-45c3-9498-876edcdf2f3f", "isHook": false, "skipped": false }, @@ -119,25 +119,25 @@ "context": null, "code": null, "err": {}, - "uuid": "15330716-d804-47d5-bd1f-7db8a3f55f9e", - "parentUUID": "78f30052-7c14-459d-8bb2-279fba17290b", + "uuid": "c3949b19-32b3-4092-89fd-18e4e5ac9254", + "parentUUID": "933cb7c7-61ec-45c3-9498-876edcdf2f3f", "isHook": false, "skipped": false } ], "suites": [], "passes": [ - "ed0b688b-a43a-4b4b-9b9e-efe7fb394b26", - "504e0602-0a51-4707-a331-a5e989bb26f7", - "15330716-d804-47d5-bd1f-7db8a3f55f9e" + "fce746fd-7f78-4efb-967b-27ba7e7256c0", + "a126d245-fcd5-491f-b6d5-d3c709f95105", + "c3949b19-32b3-4092-89fd-18e4e5ac9254" ], "failures": [ - "ae79fd6a-4a64-4540-9266-071d0287eda3", - "12b53913-bf42-4108-b8dc-9bb7969ac7f4" + "bdbafc09-acba-42dc-87ad-b6b3a1cac70c", + "478a767f-f510-47d3-a2bb-7c77bbf0e3fc" ], "pending": [], "skipped": [], - "duration": 0, + "duration": 1035, "root": false, "rootEmpty": false, "_timeout": 10000 diff --git a/tests/data/result/trx-mstest-ignore-mochawesome.json b/tests/data/result/trx-mstest-ignore-mochawesome.json new file mode 100644 index 0000000..20a598e --- /dev/null +++ b/tests/data/result/trx-mstest-ignore-mochawesome.json @@ -0,0 +1,135 @@ +{ + "stats": { + "suites": 1, + "tests": 4, + "passes": 2, + "pending": 1, + "failures": 1, + "testsRegistered": 4, + "passPercent": 50, + "pendingPercent": 25, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false, + "duration": 1038 + }, + "results": [ + { + "uuid": "5bfacde0-6678-4e02-be65-cb8b3e101a63", + "title": "", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "8325ba23-0a67-444d-a926-cb4d40cf94ae", + "title": "MsTestSample.SimpleTests", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "MsTestSample.SimpleTests", + "duration": 31, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Assert.Fail failed. Failing for demo purposes", + "estack": "at MsTestSample.SimpleTests.Failing_test() in D:\\Work-Git\\github\\Mini\\trx2junit\\samples\\MsTestSample\\SimpleTests.cs:line 20\n", + "diff": null + }, + "uuid": "ebbb254d-c704-4523-8941-d874b5b09f34", + "parentUUID": "8325ba23-0a67-444d-a926-cb4d40cf94ae", + "isHook": false, + "skipped": false + }, + { + "title": "Ignored_test", + "fullTitle": "MsTestSample.SimpleTests", + "duration": 0, + "state": "pending", + "speed": "fast", + "pass": false, + "fail": false, + "pending": true, + "context": "[\"skipped: Ignoring for testing ;-)\"]", + "code": null, + "err": {}, + "uuid": "46214756-ce84-426a-a7ca-dd743c179cc9", + "parentUUID": "8325ba23-0a67-444d-a926-cb4d40cf94ae", + "isHook": false, + "skipped": false + }, + { + "title": "Passing_test", + "fullTitle": "MsTestSample.SimpleTests", + "duration": 6, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "c9989c6b-bd33-4983-8098-6cd452e9437c", + "parentUUID": "8325ba23-0a67-444d-a926-cb4d40cf94ae", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "MsTestSample.SimpleTests", + "duration": 1002, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "49ccd87d-09b4-49cf-ae9d-d6ec0344f029", + "parentUUID": "8325ba23-0a67-444d-a926-cb4d40cf94ae", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "c9989c6b-bd33-4983-8098-6cd452e9437c", + "49ccd87d-09b4-49cf-ae9d-d6ec0344f029" + ], + "failures": [ + "ebbb254d-c704-4523-8941-d874b5b09f34" + ], + "pending": [ + "46214756-ce84-426a-a7ca-dd743c179cc9" + ], + "skipped": [], + "duration": 1038, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 10000 + } + ] +} \ No newline at end of file diff --git a/tests/data/result/trx-mstest-mochawesome.json b/tests/data/result/trx-mstest-mochawesome.json new file mode 100644 index 0000000..989e5d0 --- /dev/null +++ b/tests/data/result/trx-mstest-mochawesome.json @@ -0,0 +1,253 @@ +{ + "stats": { + "suites": 2, + "tests": 9, + "passes": 5, + "pending": 1, + "failures": 3, + "testsRegistered": 9, + "passPercent": 55.55555555555556, + "pendingPercent": 11.11111111111111, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false, + "duration": 2039 + }, + "results": [ + { + "uuid": "43c2db80-5a5d-44ef-af7e-544e0284014f", + "title": "", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "7a5dffe6-3874-43cb-b791-d7edcc10c793", + "title": "MsTestSample.DataDriven", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "MsTestSample.DataDriven", + "duration": 1, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Assert.Fail failed. Failing for demo purposes", + "estack": "at MsTestSample.DataDriven.Failing_test() in C:\\projects\\trx2junit\\samples\\MsTestSample\\DataDriven.cs:line 25\n\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)\n\n at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)\n", + "diff": null + }, + "uuid": "cadf2d76-c740-4bc1-aa4c-5e4823d53704", + "parentUUID": "7a5dffe6-3874-43cb-b791-d7edcc10c793", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "MsTestSample.DataDriven", + "duration": 1009, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "264d14b7-e130-480f-925b-1fec730d2056", + "parentUUID": "7a5dffe6-3874-43cb-b791-d7edcc10c793", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails (0)", + "fullTitle": "MsTestSample.DataDriven", + "duration": 2, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "d903755c-ce27-4ef9-b319-b92f0217f290", + "parentUUID": "7a5dffe6-3874-43cb-b791-d7edcc10c793", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails (1)", + "fullTitle": "MsTestSample.DataDriven", + "duration": 16, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Assert.Fail failed. Failing for demo purposes", + "estack": "at MsTestSample.DataDriven.Two_pass_one_fails(Int32 arg) in C:\\projects\\trx2junit\\samples\\MsTestSample\\DataDriven.cs:line 16\n\n at InvokeStub_DataDriven.Two_pass_one_fails(Object, Span`1)\n\n at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\n", + "diff": null + }, + "uuid": "133a378c-dc11-436c-8cc8-115601b31ea5", + "parentUUID": "7a5dffe6-3874-43cb-b791-d7edcc10c793", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails (2)", + "fullTitle": "MsTestSample.DataDriven", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "25b127dc-8354-4b96-90a0-ccc95dede296", + "parentUUID": "7a5dffe6-3874-43cb-b791-d7edcc10c793", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "264d14b7-e130-480f-925b-1fec730d2056", + "d903755c-ce27-4ef9-b319-b92f0217f290", + "25b127dc-8354-4b96-90a0-ccc95dede296" + ], + "failures": [ + "cadf2d76-c740-4bc1-aa4c-5e4823d53704", + "133a378c-dc11-436c-8cc8-115601b31ea5" + ], + "pending": [], + "skipped": [], + "duration": 1026, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + }, + { + "uuid": "5acb9fda-7db2-4a7b-a887-929884117ad6", + "title": "MsTestSample.SimpleTests", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "MsTestSample.SimpleTests", + "duration": 1, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Assert.Fail failed. Failing for demo purposes", + "estack": "at MsTestSample.SimpleTests.Failing_test() in C:\\projects\\trx2junit\\samples\\MsTestSample\\SimpleTests.cs:line 20\n\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)\n\n at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)\n", + "diff": null + }, + "uuid": "3d3f5a62-1856-4154-890c-332ebee2fba7", + "parentUUID": "5acb9fda-7db2-4a7b-a887-929884117ad6", + "isHook": false, + "skipped": false + }, + { + "title": "Ignored_test", + "fullTitle": "MsTestSample.SimpleTests", + "duration": 0, + "state": "pending", + "speed": "fast", + "pass": false, + "fail": false, + "pending": true, + "context": "[\"skipped: Ignoring for testing ;-)\"]", + "code": null, + "err": {}, + "uuid": "b5394269-55a4-4e19-9095-fcb991be0d29", + "parentUUID": "5acb9fda-7db2-4a7b-a887-929884117ad6", + "isHook": false, + "skipped": false + }, + { + "title": "Passing_test", + "fullTitle": "MsTestSample.SimpleTests", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "0a9975cd-35c5-4c92-a23a-015272ebed72", + "parentUUID": "5acb9fda-7db2-4a7b-a887-929884117ad6", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "MsTestSample.SimpleTests", + "duration": 1013, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "89f783cc-e982-42d2-b4d3-4a06a133d8cf", + "parentUUID": "5acb9fda-7db2-4a7b-a887-929884117ad6", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "0a9975cd-35c5-4c92-a23a-015272ebed72", + "89f783cc-e982-42d2-b4d3-4a06a133d8cf" + ], + "failures": [ + "3d3f5a62-1856-4154-890c-332ebee2fba7" + ], + "pending": [ + "b5394269-55a4-4e19-9095-fcb991be0d29" + ], + "skipped": [], + "duration": 1014, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 10000 + } + ] +} \ No newline at end of file diff --git a/tests/data/result/trx-nunit-datadriven-mochawesome.json b/tests/data/result/trx-nunit-datadriven-mochawesome.json index a4603e8..f1937a7 100644 --- a/tests/data/result/trx-nunit-datadriven-mochawesome.json +++ b/tests/data/result/trx-nunit-datadriven-mochawesome.json @@ -16,7 +16,7 @@ }, "results": [ { - "uuid": "91fa7be0-4873-4d99-b577-76d397a0d420", + "uuid": "751523db-34cd-406f-91ff-b32dc3030a13", "title": "", "fullFile": "", "file": "", @@ -25,8 +25,8 @@ "tests": [], "suites": [ { - "uuid": "bdd2dbaa-ce8b-4a01-b22f-32f7b6ae90f3", - "title": "MSTestSuite", + "uuid": "43ad1a56-368b-4402-9424-e3dd2a3e2a9b", + "title": "NUnitSample.DataDriven", "file": "", "beforeHooks": [], "afterHooks": [], @@ -47,8 +47,8 @@ "estack": "at NUnitSample.DataDriven.Failing_test() in D:\\Work-Git\\github\\Mini\\trx2junit\\samples\\NUnitSample\\DataDriven.cs:line 27\n", "diff": null }, - "uuid": "88afb63e-2581-4a3e-adf9-4fcdd612a147", - "parentUUID": "bdd2dbaa-ce8b-4a01-b22f-32f7b6ae90f3", + "uuid": "9056a5ce-8fb8-4683-b051-c9d09d00c3e6", + "parentUUID": "43ad1a56-368b-4402-9424-e3dd2a3e2a9b", "isHook": false, "skipped": false }, @@ -64,8 +64,8 @@ "context": null, "code": null, "err": {}, - "uuid": "8240857f-c233-49a8-a8c7-ace0326d31df", - "parentUUID": "bdd2dbaa-ce8b-4a01-b22f-32f7b6ae90f3", + "uuid": "8db56492-8387-4bb3-86d0-49e28651d121", + "parentUUID": "43ad1a56-368b-4402-9424-e3dd2a3e2a9b", "isHook": false, "skipped": false }, @@ -81,8 +81,8 @@ "context": null, "code": null, "err": {}, - "uuid": "0eebdcc0-23c8-43bb-aa34-017d688b3d6f", - "parentUUID": "bdd2dbaa-ce8b-4a01-b22f-32f7b6ae90f3", + "uuid": "c87ccecb-293e-48e8-b84b-5c6584c2e0ef", + "parentUUID": "43ad1a56-368b-4402-9424-e3dd2a3e2a9b", "isHook": false, "skipped": false }, @@ -102,8 +102,8 @@ "estack": "at NUnitSample.DataDriven.Two_pass_one_fails(Int32 arg) in D:\\Work-Git\\github\\Mini\\trx2junit\\samples\\NUnitSample\\DataDriven.cs:line 18\n", "diff": null }, - "uuid": "7183526a-6714-4b9a-aa96-5e15dee45f59", - "parentUUID": "bdd2dbaa-ce8b-4a01-b22f-32f7b6ae90f3", + "uuid": "f26b1e02-ba57-4ea3-a9f2-5cc3ad5a8212", + "parentUUID": "43ad1a56-368b-4402-9424-e3dd2a3e2a9b", "isHook": false, "skipped": false }, @@ -119,25 +119,25 @@ "context": null, "code": null, "err": {}, - "uuid": "dceab918-5dbc-4d70-b4b7-145fe459bebe", - "parentUUID": "bdd2dbaa-ce8b-4a01-b22f-32f7b6ae90f3", + "uuid": "306fbc91-c2d8-4879-9da2-de619c42f048", + "parentUUID": "43ad1a56-368b-4402-9424-e3dd2a3e2a9b", "isHook": false, "skipped": false } ], "suites": [], "passes": [ - "8240857f-c233-49a8-a8c7-ace0326d31df", - "0eebdcc0-23c8-43bb-aa34-017d688b3d6f", - "dceab918-5dbc-4d70-b4b7-145fe459bebe" + "8db56492-8387-4bb3-86d0-49e28651d121", + "c87ccecb-293e-48e8-b84b-5c6584c2e0ef", + "306fbc91-c2d8-4879-9da2-de619c42f048" ], "failures": [ - "88afb63e-2581-4a3e-adf9-4fcdd612a147", - "7183526a-6714-4b9a-aa96-5e15dee45f59" + "9056a5ce-8fb8-4683-b051-c9d09d00c3e6", + "f26b1e02-ba57-4ea3-a9f2-5cc3ad5a8212" ], "pending": [], "skipped": [], - "duration": 0, + "duration": 1062, "root": false, "rootEmpty": false, "_timeout": 10000 diff --git a/tests/data/result/trx-nunit-ignore-mochawesome.json b/tests/data/result/trx-nunit-ignore-mochawesome.json new file mode 100644 index 0000000..a47a022 --- /dev/null +++ b/tests/data/result/trx-nunit-ignore-mochawesome.json @@ -0,0 +1,153 @@ +{ + "stats": { + "suites": 1, + "tests": 5, + "passes": 2, + "pending": 2, + "failures": 1, + "testsRegistered": 5, + "passPercent": 40, + "pendingPercent": 40, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false, + "duration": 1074 + }, + "results": [ + { + "uuid": "a7b58f9a-1b72-42a9-baea-eae3d6a65b11", + "title": "", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "66cdcf2d-72b5-4c0b-95f6-877db1d5c2f1", + "title": "NUnitSample.SimpleTests", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 59, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes", + "estack": "at NUnitSample.SimpleTests.Failing_test() in D:\\Work-Git\\github\\Mini\\trx2junit\\samples\\NUnitSample\\SimpleTests.cs:line 21\n", + "diff": null + }, + "uuid": "13f1b4f8-3843-4118-ac8f-2a3025cfd493", + "parentUUID": "66cdcf2d-72b5-4c0b-95f6-877db1d5c2f1", + "isHook": false, + "skipped": false + }, + { + "title": "Ignored_test", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 1, + "state": "pending", + "speed": "fast", + "pass": false, + "fail": false, + "pending": true, + "context": "[\"skipped: Ignoring for testing ;-)\"]", + "code": null, + "err": {}, + "uuid": "49ee5955-75fc-4c1f-911e-a8d7ad68e968", + "parentUUID": "66cdcf2d-72b5-4c0b-95f6-877db1d5c2f1", + "isHook": false, + "skipped": false + }, + { + "title": "Passing_test", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "2eab89ae-7a62-48bd-9fef-57163138e7ce", + "parentUUID": "66cdcf2d-72b5-4c0b-95f6-877db1d5c2f1", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 1002, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "0f922e21-d5d5-44a0-9b29-713463de6c60", + "parentUUID": "66cdcf2d-72b5-4c0b-95f6-877db1d5c2f1", + "isHook": false, + "skipped": false + }, + { + "title": "Test_with_failed_assumption", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 11, + "state": "pending", + "speed": "fast", + "pass": false, + "fail": false, + "pending": true, + "context": "[\"skipped: Expected: True But was: False \"]", + "code": null, + "err": {}, + "uuid": "d9c144ed-606b-445a-9c71-77db30ed82a1", + "parentUUID": "66cdcf2d-72b5-4c0b-95f6-877db1d5c2f1", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "2eab89ae-7a62-48bd-9fef-57163138e7ce", + "0f922e21-d5d5-44a0-9b29-713463de6c60" + ], + "failures": [ + "13f1b4f8-3843-4118-ac8f-2a3025cfd493" + ], + "pending": [ + "49ee5955-75fc-4c1f-911e-a8d7ad68e968", + "d9c144ed-606b-445a-9c71-77db30ed82a1" + ], + "skipped": [], + "duration": 1074, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 10000 + } + ] +} \ No newline at end of file diff --git a/tests/data/result/trx-nunit-mochawesome.json b/tests/data/result/trx-nunit-mochawesome.json new file mode 100644 index 0000000..c2626a3 --- /dev/null +++ b/tests/data/result/trx-nunit-mochawesome.json @@ -0,0 +1,407 @@ +{ + "stats": { + "suites": 3, + "tests": 16, + "passes": 9, + "pending": 2, + "failures": 5, + "testsRegistered": 16, + "passPercent": 56.25, + "pendingPercent": 12.5, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false, + "duration": 3080 + }, + "results": [ + { + "uuid": "881352d5-c372-45d3-a05c-91ba1f20b5ca", + "title": "", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "55532edc-4879-48f5-880c-f01dcbd67cc1", + "title": "NUnitSample.DataDriven", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "NUnitSample.DataDriven", + "duration": 23, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes", + "estack": "at NUnitSample.DataDriven.Failing_test() in C:\\projects\\trx2junit\\samples\\NUnitSample\\DataDriven.cs:line 27\n\n\n1) at NUnitSample.DataDriven.Failing_test() in C:\\projects\\trx2junit\\samples\\NUnitSample\\DataDriven.cs:line 27\n", + "diff": null + }, + "uuid": "96aebed4-9d7d-4672-86a9-21f636f19c98", + "parentUUID": "55532edc-4879-48f5-880c-f01dcbd67cc1", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "NUnitSample.DataDriven", + "duration": 1009, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "153c7f00-3978-4fe1-a346-f9040f9abc05", + "parentUUID": "55532edc-4879-48f5-880c-f01dcbd67cc1", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails(0)", + "fullTitle": "NUnitSample.DataDriven", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "08cce3c9-3454-428a-822b-7c8c62bb776a", + "parentUUID": "55532edc-4879-48f5-880c-f01dcbd67cc1", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails(1)", + "fullTitle": "NUnitSample.DataDriven", + "duration": 1, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes", + "estack": "at NUnitSample.DataDriven.Two_pass_one_fails(Int32 arg) in C:\\projects\\trx2junit\\samples\\NUnitSample\\DataDriven.cs:line 18\n\n at InvokeStub_DataDriven.Two_pass_one_fails(Object, Span`1)\n\n\n1) at NUnitSample.DataDriven.Two_pass_one_fails(Int32 arg) in C:\\projects\\trx2junit\\samples\\NUnitSample\\DataDriven.cs:line 18\n\n at InvokeStub_DataDriven.Two_pass_one_fails(Object, Span`1)\n", + "diff": null + }, + "uuid": "b2cd8c21-fd1f-44ef-9e1a-09d7942d9cfa", + "parentUUID": "55532edc-4879-48f5-880c-f01dcbd67cc1", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails(2)", + "fullTitle": "NUnitSample.DataDriven", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "31572dd8-6a5f-4762-86f4-08971c909e23", + "parentUUID": "55532edc-4879-48f5-880c-f01dcbd67cc1", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "153c7f00-3978-4fe1-a346-f9040f9abc05", + "08cce3c9-3454-428a-822b-7c8c62bb776a", + "31572dd8-6a5f-4762-86f4-08971c909e23" + ], + "failures": [ + "96aebed4-9d7d-4672-86a9-21f636f19c98", + "b2cd8c21-fd1f-44ef-9e1a-09d7942d9cfa" + ], + "pending": [], + "skipped": [], + "duration": 1032, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + }, + { + "uuid": "2e2817ad-e50d-412b-8314-3183775e50d4", + "title": "NUnitSample.MemberData", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "NUnitSample.MemberData", + "duration": 4, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": " Failing for demo purposes Expected: True But was: False ", + "estack": "at NUnitSample.MemberData.Failing_test() in C:\\projects\\trx2junit\\samples\\NUnitSample\\MemberData.cs:line 31\n\n\n1) at NUnitSample.MemberData.Failing_test() in C:\\projects\\trx2junit\\samples\\NUnitSample\\MemberData.cs:line 31\n", + "diff": null + }, + "uuid": "d18cbadc-aaf9-4d61-aeea-7474f369cd9d", + "parentUUID": "2e2817ad-e50d-412b-8314-3183775e50d4", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "NUnitSample.MemberData", + "duration": 1015, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "d5ac2557-fe3c-428e-9b06-998560fb69a6", + "parentUUID": "2e2817ad-e50d-412b-8314-3183775e50d4", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails({ index = 0 })", + "fullTitle": "NUnitSample.MemberData", + "duration": 22, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "a422961e-e7a6-4bda-95bd-efd37a49a282", + "parentUUID": "2e2817ad-e50d-412b-8314-3183775e50d4", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails({ index = 1 })", + "fullTitle": "NUnitSample.MemberData", + "duration": 1, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": " Failing for demo purposes Expected: True But was: False ", + "estack": "at NUnitSample.MemberData.Two_pass_one_fails(Object obj) in C:\\projects\\trx2junit\\samples\\NUnitSample\\MemberData.cs:line 22\n\n at InvokeStub_MemberData.Two_pass_one_fails(Object, Span`1)\n\n\n1) at NUnitSample.MemberData.Two_pass_one_fails(Object obj) in C:\\projects\\trx2junit\\samples\\NUnitSample\\MemberData.cs:line 22\n\n at InvokeStub_MemberData.Two_pass_one_fails(Object, Span`1)\n", + "diff": null + }, + "uuid": "0de2d861-2269-4fcb-8764-6c94fd8c8a74", + "parentUUID": "2e2817ad-e50d-412b-8314-3183775e50d4", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails({ index = 2 })", + "fullTitle": "NUnitSample.MemberData", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "a593c959-21ea-4734-87bf-fec06240ce2a", + "parentUUID": "2e2817ad-e50d-412b-8314-3183775e50d4", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "d5ac2557-fe3c-428e-9b06-998560fb69a6", + "a422961e-e7a6-4bda-95bd-efd37a49a282", + "a593c959-21ea-4734-87bf-fec06240ce2a" + ], + "failures": [ + "d18cbadc-aaf9-4d61-aeea-7474f369cd9d", + "0de2d861-2269-4fcb-8764-6c94fd8c8a74" + ], + "pending": [], + "skipped": [], + "duration": 1041, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + }, + { + "uuid": "16213fa7-03d5-4c92-a045-01ea6012d3fe", + "title": "NUnitSample.SimpleTests", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 1, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes", + "estack": "at NUnitSample.SimpleTests.Failing_test() in C:\\projects\\trx2junit\\samples\\NUnitSample\\SimpleTests.cs:line 21\n\n\n1) at NUnitSample.SimpleTests.Failing_test() in C:\\projects\\trx2junit\\samples\\NUnitSample\\SimpleTests.cs:line 21\n", + "diff": null + }, + "uuid": "d20019aa-15e7-4c33-8481-a35bf2c2eaff", + "parentUUID": "16213fa7-03d5-4c92-a045-01ea6012d3fe", + "isHook": false, + "skipped": false + }, + { + "title": "Ignored_test", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 1, + "state": "pending", + "speed": "fast", + "pass": false, + "fail": false, + "pending": true, + "context": "[\"skipped: Ignoring for testing ;-)\"]", + "code": null, + "err": {}, + "uuid": "14547c95-d3cd-4b3d-98bf-9e25e11893db", + "parentUUID": "16213fa7-03d5-4c92-a045-01ea6012d3fe", + "isHook": false, + "skipped": false + }, + { + "title": "Passing_test", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "928dc1c7-77f7-4552-b679-e2e28daa52d9", + "parentUUID": "16213fa7-03d5-4c92-a045-01ea6012d3fe", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 1006, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "03fe00bc-24c2-42a2-b684-ca486edbd417", + "parentUUID": "16213fa7-03d5-4c92-a045-01ea6012d3fe", + "isHook": false, + "skipped": false + }, + { + "title": "Test_with_StdOut", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": "[{\"title\":\"system-out\",\"value\":\"message written to stdout\"}]", + "code": null, + "err": {}, + "uuid": "a34a9255-4e21-421b-b4e1-46f8ad15b7c5", + "parentUUID": "16213fa7-03d5-4c92-a045-01ea6012d3fe", + "isHook": false, + "skipped": false + }, + { + "title": "Test_with_failed_assumption", + "fullTitle": "NUnitSample.SimpleTests", + "duration": 1, + "state": "pending", + "speed": "fast", + "pass": false, + "fail": false, + "pending": true, + "context": "[\"skipped: Expected: True But was: False \",{\"title\":\"system-out\",\"value\":\"Expected: True \\n But was: False\"}]", + "code": null, + "err": {}, + "uuid": "bd4f8e96-063a-4844-8b34-533530f27d2a", + "parentUUID": "16213fa7-03d5-4c92-a045-01ea6012d3fe", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "928dc1c7-77f7-4552-b679-e2e28daa52d9", + "03fe00bc-24c2-42a2-b684-ca486edbd417", + "a34a9255-4e21-421b-b4e1-46f8ad15b7c5" + ], + "failures": [ + "d20019aa-15e7-4c33-8481-a35bf2c2eaff" + ], + "pending": [ + "14547c95-d3cd-4b3d-98bf-9e25e11893db", + "bd4f8e96-063a-4844-8b34-533530f27d2a" + ], + "skipped": [], + "duration": 1008, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 10000 + } + ] +} \ No newline at end of file diff --git a/tests/data/result/trx-xunit-datadriven-mochawesome.json b/tests/data/result/trx-xunit-datadriven-mochawesome.json index be3a235..31089a1 100644 --- a/tests/data/result/trx-xunit-datadriven-mochawesome.json +++ b/tests/data/result/trx-xunit-datadriven-mochawesome.json @@ -16,7 +16,7 @@ }, "results": [ { - "uuid": "6b75b277-d367-4bbe-98dd-e92a04cc037b", + "uuid": "1b4757c8-c09e-4cdf-8a0c-3fe0badd8a18", "title": "", "fullFile": "", "file": "", @@ -25,8 +25,8 @@ "tests": [], "suites": [ { - "uuid": "b9d62e49-d11f-4d28-908a-939a5e3b01d9", - "title": "MSTestSuite", + "uuid": "9784bf42-f3d0-4562-bfde-d5d123d13927", + "title": "XUnitSample.DataDriven", "file": "", "beforeHooks": [], "afterHooks": [], @@ -47,8 +47,8 @@ "estack": "at XUnitSample.DataDriven.Failing_test() in D:\\Work-Git\\github\\Mini\\trx2junit\\samples\\XUnitSample\\DataDriven.cs:line 26", "diff": null }, - "uuid": "aebb04c3-be08-4004-9e54-40510cb3f156", - "parentUUID": "b9d62e49-d11f-4d28-908a-939a5e3b01d9", + "uuid": "7a33d9a7-f8d5-4f51-a4b6-8a4507f58e2c", + "parentUUID": "9784bf42-f3d0-4562-bfde-d5d123d13927", "isHook": false, "skipped": false }, @@ -64,8 +64,8 @@ "context": null, "code": null, "err": {}, - "uuid": "dd7c0604-57b9-426e-8c2d-49e35f9ef660", - "parentUUID": "b9d62e49-d11f-4d28-908a-939a5e3b01d9", + "uuid": "7e18b525-33fa-45e5-b740-b591ebd1547f", + "parentUUID": "9784bf42-f3d0-4562-bfde-d5d123d13927", "isHook": false, "skipped": false }, @@ -81,8 +81,8 @@ "context": null, "code": null, "err": {}, - "uuid": "965bec21-b98d-4f3e-8510-ead408292800", - "parentUUID": "b9d62e49-d11f-4d28-908a-939a5e3b01d9", + "uuid": "be6798ec-3d1c-4faf-8c04-b707edba8a00", + "parentUUID": "9784bf42-f3d0-4562-bfde-d5d123d13927", "isHook": false, "skipped": false }, @@ -102,8 +102,8 @@ "estack": "at XUnitSample.DataDriven.Two_pass_one_fails(Int32 arg) in D:\\Work-Git\\github\\Mini\\trx2junit\\samples\\XUnitSample\\DataDriven.cs:line 17", "diff": null }, - "uuid": "e004d0c6-a02e-4040-a78d-01eab09246af", - "parentUUID": "b9d62e49-d11f-4d28-908a-939a5e3b01d9", + "uuid": "2c1f9e92-cd78-42be-816c-a1b62e476dc8", + "parentUUID": "9784bf42-f3d0-4562-bfde-d5d123d13927", "isHook": false, "skipped": false }, @@ -119,25 +119,25 @@ "context": null, "code": null, "err": {}, - "uuid": "9a44c2f4-0176-4d36-918f-1b174df9e6e2", - "parentUUID": "b9d62e49-d11f-4d28-908a-939a5e3b01d9", + "uuid": "72eb5bb8-9ab1-41ed-b1ef-5e85608acbb7", + "parentUUID": "9784bf42-f3d0-4562-bfde-d5d123d13927", "isHook": false, "skipped": false } ], "suites": [], "passes": [ - "dd7c0604-57b9-426e-8c2d-49e35f9ef660", - "965bec21-b98d-4f3e-8510-ead408292800", - "9a44c2f4-0176-4d36-918f-1b174df9e6e2" + "7e18b525-33fa-45e5-b740-b591ebd1547f", + "be6798ec-3d1c-4faf-8c04-b707edba8a00", + "72eb5bb8-9ab1-41ed-b1ef-5e85608acbb7" ], "failures": [ - "aebb04c3-be08-4004-9e54-40510cb3f156", - "e004d0c6-a02e-4040-a78d-01eab09246af" + "7a33d9a7-f8d5-4f51-a4b6-8a4507f58e2c", + "2c1f9e92-cd78-42be-816c-a1b62e476dc8" ], "pending": [], "skipped": [], - "duration": 0, + "duration": 1014, "root": false, "rootEmpty": false, "_timeout": 10000 diff --git a/tests/data/result/trx-xunit-ignore-mochawesome.json b/tests/data/result/trx-xunit-ignore-mochawesome.json new file mode 100644 index 0000000..8ed3ce0 --- /dev/null +++ b/tests/data/result/trx-xunit-ignore-mochawesome.json @@ -0,0 +1,135 @@ +{ + "stats": { + "suites": 1, + "tests": 4, + "passes": 2, + "pending": 1, + "failures": 1, + "testsRegistered": 4, + "passPercent": 50, + "pendingPercent": 25, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false, + "duration": 1028 + }, + "results": [ + { + "uuid": "39e58b31-bc7a-460c-88a4-c2d14bc3cab8", + "title": "", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "a24ee37d-80ff-4305-a6b5-30da74474f7b", + "title": "XUnitSample.SimpleTests", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "XUnitSample.SimpleTests", + "duration": 6, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes Expected: True Actual: False", + "estack": "at XUnitSample.SimpleTests.Failing_test() in D:\\Work-Git\\github\\Mini\\trx2junit\\samples\\XUnitSample\\SimpleTests.cs:line 20", + "diff": null + }, + "uuid": "24d31871-4617-4af7-bcbd-0d021b1e0155", + "parentUUID": "a24ee37d-80ff-4305-a6b5-30da74474f7b", + "isHook": false, + "skipped": false + }, + { + "title": "Ignored_test", + "fullTitle": "XUnitSample.SimpleTests", + "duration": 1, + "state": "pending", + "speed": "fast", + "pass": false, + "fail": false, + "pending": true, + "context": "[\"skipped: Ignoring for testing ;-)\"]", + "code": null, + "err": {}, + "uuid": "13dfb96e-392e-46c4-917e-0750bff1e578", + "parentUUID": "a24ee37d-80ff-4305-a6b5-30da74474f7b", + "isHook": false, + "skipped": false + }, + { + "title": "Passing_test", + "fullTitle": "XUnitSample.SimpleTests", + "duration": 2, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "0c851e75-7089-43a4-bb42-e5c4987b95a6", + "parentUUID": "a24ee37d-80ff-4305-a6b5-30da74474f7b", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "XUnitSample.SimpleTests", + "duration": 1019, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "3b222557-e005-49e5-b09d-dccb3bd8618f", + "parentUUID": "a24ee37d-80ff-4305-a6b5-30da74474f7b", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "0c851e75-7089-43a4-bb42-e5c4987b95a6", + "3b222557-e005-49e5-b09d-dccb3bd8618f" + ], + "failures": [ + "24d31871-4617-4af7-bcbd-0d021b1e0155" + ], + "pending": [ + "13dfb96e-392e-46c4-917e-0750bff1e578" + ], + "skipped": [], + "duration": 1028, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 10000 + } + ] +} \ No newline at end of file diff --git a/tests/data/result/trx-xunit-mochawesome.json b/tests/data/result/trx-xunit-mochawesome.json new file mode 100644 index 0000000..d113970 --- /dev/null +++ b/tests/data/result/trx-xunit-mochawesome.json @@ -0,0 +1,371 @@ +{ + "stats": { + "suites": 3, + "tests": 14, + "passes": 8, + "pending": 1, + "failures": 5, + "testsRegistered": 14, + "passPercent": 57.14285714285714, + "pendingPercent": 7.142857142857142, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false, + "duration": 3064 + }, + "results": [ + { + "uuid": "cca1775c-ca78-464c-b944-2acab1ddbb2e", + "title": "", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "02f7c8eb-d67e-4f8c-9b82-85b17701391d", + "title": "XUnitSample.DataDriven", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "XUnitSample.DataDriven", + "duration": 1, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes Expected: True Actual: False", + "estack": "at XUnitSample.DataDriven.Failing_test() in C:\\projects\\trx2junit\\samples\\XUnitSample\\DataDriven.cs:line 26\n\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)\n\n at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)", + "diff": null + }, + "uuid": "ef1c0374-b71e-4b58-a844-e2fcf4408ef1", + "parentUUID": "02f7c8eb-d67e-4f8c-9b82-85b17701391d", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "XUnitSample.DataDriven", + "duration": 1008, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "0ebc0f61-7412-41bb-9acd-86fb62a4a4f0", + "parentUUID": "02f7c8eb-d67e-4f8c-9b82-85b17701391d", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails(arg: 0)", + "fullTitle": "XUnitSample.DataDriven", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "4be3d477-3340-4e6b-94d5-6730b296bce2", + "parentUUID": "02f7c8eb-d67e-4f8c-9b82-85b17701391d", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails(arg: 1)", + "fullTitle": "XUnitSample.DataDriven", + "duration": 1, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes Expected: True Actual: False", + "estack": "at XUnitSample.DataDriven.Two_pass_one_fails(Int32 arg) in C:\\projects\\trx2junit\\samples\\XUnitSample\\DataDriven.cs:line 17\n\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)\n\n at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)", + "diff": null + }, + "uuid": "c015f8d3-55c5-46cb-abe3-cfb912537938", + "parentUUID": "02f7c8eb-d67e-4f8c-9b82-85b17701391d", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails(arg: 2)", + "fullTitle": "XUnitSample.DataDriven", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "83c24feb-8e4b-46d2-9372-fe526f0dd424", + "parentUUID": "02f7c8eb-d67e-4f8c-9b82-85b17701391d", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "0ebc0f61-7412-41bb-9acd-86fb62a4a4f0", + "4be3d477-3340-4e6b-94d5-6730b296bce2", + "83c24feb-8e4b-46d2-9372-fe526f0dd424" + ], + "failures": [ + "ef1c0374-b71e-4b58-a844-e2fcf4408ef1", + "c015f8d3-55c5-46cb-abe3-cfb912537938" + ], + "pending": [], + "skipped": [], + "duration": 1009, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + }, + { + "uuid": "664448ab-7054-46d2-a50b-0acd60dd785c", + "title": "XUnitSample.MemberData", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "XUnitSample.MemberData", + "duration": 2, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes Expected: True Actual: False", + "estack": "at XUnitSample.MemberData.Failing_test() in C:\\projects\\trx2junit\\samples\\XUnitSample\\MemberData.cs:line 32\n\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)\n\n at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)", + "diff": null + }, + "uuid": "dd25b2d5-031c-4801-99c0-ac33a89f1542", + "parentUUID": "664448ab-7054-46d2-a50b-0acd60dd785c", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "XUnitSample.MemberData", + "duration": 1014, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "3825b6e4-2d5e-492f-aa59-1deb88f138a5", + "parentUUID": "664448ab-7054-46d2-a50b-0acd60dd785c", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails(obj: { index = 0 })", + "fullTitle": "XUnitSample.MemberData", + "duration": 24, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "2570f649-4be9-4b7c-87b6-96c6a51096b7", + "parentUUID": "664448ab-7054-46d2-a50b-0acd60dd785c", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails(obj: { index = 1 })", + "fullTitle": "XUnitSample.MemberData", + "duration": 1, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes Expected: True Actual: False", + "estack": "at XUnitSample.MemberData.Two_pass_one_fails(Object obj) in C:\\projects\\trx2junit\\samples\\XUnitSample\\MemberData.cs:line 23\n\n at InvokeStub_MemberData.Two_pass_one_fails(Object, Span`1)\n\n at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)", + "diff": null + }, + "uuid": "d3da71af-fc26-4d45-9c43-387dce501a45", + "parentUUID": "664448ab-7054-46d2-a50b-0acd60dd785c", + "isHook": false, + "skipped": false + }, + { + "title": "Two_pass_one_fails(obj: { index = 2 })", + "fullTitle": "XUnitSample.MemberData", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "5b4e45e2-9156-4138-b48d-900d99d91ed3", + "parentUUID": "664448ab-7054-46d2-a50b-0acd60dd785c", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "3825b6e4-2d5e-492f-aa59-1deb88f138a5", + "2570f649-4be9-4b7c-87b6-96c6a51096b7", + "5b4e45e2-9156-4138-b48d-900d99d91ed3" + ], + "failures": [ + "dd25b2d5-031c-4801-99c0-ac33a89f1542", + "d3da71af-fc26-4d45-9c43-387dce501a45" + ], + "pending": [], + "skipped": [], + "duration": 1039, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + }, + { + "uuid": "17ba9e39-6fd5-4b77-bca3-9793a007dc2f", + "title": "XUnitSample.SimpleTests", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Failing_test", + "fullTitle": "XUnitSample.SimpleTests", + "duration": 2, + "state": "failed", + "speed": "fast", + "pass": false, + "fail": true, + "pending": false, + "context": null, + "code": null, + "err": { + "message": "Failing for demo purposes Expected: True Actual: False", + "estack": "at XUnitSample.SimpleTests.Failing_test() in C:\\projects\\trx2junit\\samples\\XUnitSample\\SimpleTests.cs:line 20\n\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)\n\n at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)", + "diff": null + }, + "uuid": "d17691f0-5d73-489d-a6dc-6dbea3677f4e", + "parentUUID": "17ba9e39-6fd5-4b77-bca3-9793a007dc2f", + "isHook": false, + "skipped": false + }, + { + "title": "Ignored_test", + "fullTitle": "XUnitSample.SimpleTests", + "duration": 1, + "state": "pending", + "speed": "fast", + "pass": false, + "fail": false, + "pending": true, + "context": "[\"skipped: Ignoring for testing ;-)\"]", + "code": null, + "err": {}, + "uuid": "36bc829e-ebeb-4815-b1ea-8a0b954a0622", + "parentUUID": "17ba9e39-6fd5-4b77-bca3-9793a007dc2f", + "isHook": false, + "skipped": false + }, + { + "title": "Passing_test", + "fullTitle": "XUnitSample.SimpleTests", + "duration": 1, + "state": "passed", + "speed": "fast", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "6ccfeacf-6807-4d50-a7f6-3a9610c0d76b", + "parentUUID": "17ba9e39-6fd5-4b77-bca3-9793a007dc2f", + "isHook": false, + "skipped": false + }, + { + "title": "Slow_test", + "fullTitle": "XUnitSample.SimpleTests", + "duration": 1014, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": null, + "err": {}, + "uuid": "e40a19b6-2c75-4fe2-9c7b-145edca0ed51", + "parentUUID": "17ba9e39-6fd5-4b77-bca3-9793a007dc2f", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "6ccfeacf-6807-4d50-a7f6-3a9610c0d76b", + "e40a19b6-2c75-4fe2-9c7b-145edca0ed51" + ], + "failures": [ + "d17691f0-5d73-489d-a6dc-6dbea3677f4e" + ], + "pending": [ + "36bc829e-ebeb-4815-b1ea-8a0b954a0622" + ], + "skipped": [], + "duration": 1016, + "root": false, + "rootEmpty": false, + "_timeout": 10000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 10000 + } + ] +} \ No newline at end of file diff --git a/tests/data/source/junit-mocha-xunit.xml b/tests/data/source/junit-mocha-xunit.xml index e02e1a9..5b1729d 100644 --- a/tests/data/source/junit-mocha-xunit.xml +++ b/tests/data/source/junit-mocha-xunit.xml @@ -1,13 +1,13 @@ - - - -Could not load file or assembly 'test, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. + + + +Could not load file or assembly 'test, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. Error: Could not load file or assembly 'test, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. at exports.func (lib\edge.js:174:17) at Context.<anonymous> (test\101_edge_func.js:82:19) at process.processImmediate (node:internal/timers:491:21) -The input did not match the regular expression /Could not load type 'Edge.Tests.idontexist'/. Input: +The input did not match the regular expression /Could not load type 'Edge.Tests.idontexist'/. Input: "System.IO.FileNotFoundException: Could not load file or assembly 'test, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified." @@ -17,12 +17,12 @@ AssertionError [ERR_ASSERTION]: The input did not match the regular expression / at Context.<anonymous> (test\101_edge_func.js:90:10) at process.processImmediate (node:internal/timers:491:21) -Could not load file or assembly 'test, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. +Could not load file or assembly 'test, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. Error: Could not load file or assembly 'test, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. at exports.func (lib\edge.js:174:17) at Context.<anonymous> (test\101_edge_func.js:102:19) at process.processImmediate (node:internal/timers:491:21) -The input did not match the regular expression /Unable to access the CLR method to wrap through reflection/. Input: +The input did not match the regular expression /Unable to access the CLR method to wrap through reflection/. Input: "System.IO.FileNotFoundException: Could not load file or assembly 'test, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified." @@ -32,13 +32,13 @@ AssertionError [ERR_ASSERTION]: The input did not match the regular expression / at Context.<anonymous> (test\101_edge_func.js:111:10) at process.processImmediate (node:internal/timers:491:21) - - - - - - -the string "new exception" was thrown, throw an Error :) + + + + + + +the string "new exception" was thrown, throw an Error :) Error: the string "new exception" was thrown, throw an Error :) at process.processImmediate (node:internal/timers:491:21) diff --git a/tests/data/source/trx-mstest-ignore.trx b/tests/data/source/trx-mstest-ignore.trx new file mode 100644 index 0000000..c1ddbd2 --- /dev/null +++ b/tests/data/source/trx-mstest-ignore.trx @@ -0,0 +1,61 @@ + + + + + + + + + + + + Assert.Fail failed. Failing for demo purposes + at MsTestSample.SimpleTests.Failing_test() in D:\Work-Git\github\Mini\trx2junit\samples\MsTestSample\SimpleTests.cs:line 20 + + + + + + + + + Ignoring for testing ;-) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Test 'Ignored_test' was skipped in the test run. + + + \ No newline at end of file diff --git a/tests/data/source/trx-mstest.trx b/tests/data/source/trx-mstest.trx new file mode 100644 index 0000000..b9b8980 --- /dev/null +++ b/tests/data/source/trx-mstest.trx @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + Assert.Fail failed. Failing for demo purposes + at MsTestSample.SimpleTests.Failing_test() in C:\projects\trx2junit\samples\MsTestSample\SimpleTests.cs:line 20 + at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) + at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) + + + + + + + + + Assert.Fail failed. Failing for demo purposes + at MsTestSample.DataDriven.Failing_test() in C:\projects\trx2junit\samples\MsTestSample\DataDriven.cs:line 25 + at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) + at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) + + + + + + + + Ignoring for testing ;-) + + + + + + + + Assert.Fail failed. Failing for demo purposes + at MsTestSample.DataDriven.Two_pass_one_fails(Int32 arg) in C:\projects\trx2junit\samples\MsTestSample\DataDriven.cs:line 16 + at InvokeStub_DataDriven.Two_pass_one_fails(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Test 'Ignored_test' was skipped in the test run. + + + + \ No newline at end of file diff --git a/tests/data/source/trx-nunit-ignore.trx b/tests/data/source/trx-nunit-ignore.trx new file mode 100644 index 0000000..b71ec23 --- /dev/null +++ b/tests/data/source/trx-nunit-ignore.trx @@ -0,0 +1,75 @@ + + + + + + + + + + + + + Expected: True + But was: False + + + + + + + + Failing for demo purposes + at NUnitSample.SimpleTests.Failing_test() in D:\Work-Git\github\Mini\trx2junit\samples\NUnitSample\SimpleTests.cs:line 21 + + + + + + + + Ignoring for testing ;-) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NUnit Adapter 3.10.0.21: Test execution startedRunning all tests in D:\Work-Git\github\Mini\trx2junit\samples\NUnitSample\bin\Debug\netcoreapp2.1\NUnitSample.dllNUnit3TestExecutor converted 5 of 5 NUnit test casesNUnit Adapter 3.10.0.21: Test execution completeTest 'Ignored_test' was skipped in the test run. + + + \ No newline at end of file diff --git a/tests/data/source/trx-nunit.trx b/tests/data/source/trx-nunit.trx new file mode 100644 index 0000000..f340d62 --- /dev/null +++ b/tests/data/source/trx-nunit.trx @@ -0,0 +1,220 @@ + + + + + + + + + + + Expected: True + But was: False + + Expected: True + But was: False + + + + + + + + Failing for demo purposes + at NUnitSample.SimpleTests.Failing_test() in C:\projects\trx2junit\samples\NUnitSample\SimpleTests.cs:line 21 + +1) at NUnitSample.SimpleTests.Failing_test() in C:\projects\trx2junit\samples\NUnitSample\SimpleTests.cs:line 21 + + + + + + + + + + Failing for demo purposes + at NUnitSample.DataDriven.Two_pass_one_fails(Int32 arg) in C:\projects\trx2junit\samples\NUnitSample\DataDriven.cs:line 18 + at InvokeStub_DataDriven.Two_pass_one_fails(Object, Span`1) + +1) at NUnitSample.DataDriven.Two_pass_one_fails(Int32 arg) in C:\projects\trx2junit\samples\NUnitSample\DataDriven.cs:line 18 + at InvokeStub_DataDriven.Two_pass_one_fails(Object, Span`1) + + + + + + + + + + message written to stdout + + + + + Ignoring for testing ;-) + + Ignoring for testing ;-) + + + + + + + + Failing for demo purposes + Expected: True + But was: False + + at NUnitSample.MemberData.Two_pass_one_fails(Object obj) in C:\projects\trx2junit\samples\NUnitSample\MemberData.cs:line 22 + at InvokeStub_MemberData.Two_pass_one_fails(Object, Span`1) + +1) at NUnitSample.MemberData.Two_pass_one_fails(Object obj) in C:\projects\trx2junit\samples\NUnitSample\MemberData.cs:line 22 + at InvokeStub_MemberData.Two_pass_one_fails(Object, Span`1) + + + + + + + + + + + Failing for demo purposes + Expected: True + But was: False + + at NUnitSample.MemberData.Failing_test() in C:\projects\trx2junit\samples\NUnitSample\MemberData.cs:line 31 + +1) at NUnitSample.MemberData.Failing_test() in C:\projects\trx2junit\samples\NUnitSample\MemberData.cs:line 31 + + + + + + + + + + Failing for demo purposes + at NUnitSample.DataDriven.Failing_test() in C:\projects\trx2junit\samples\NUnitSample\DataDriven.cs:line 27 + +1) at NUnitSample.DataDriven.Failing_test() in C:\projects\trx2junit\samples\NUnitSample\DataDriven.cs:line 27 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NUnit Adapter 4.3.0.0: Test execution started +Running all tests in C:\projects\trx2junit\samples\artifacts\bin\NUnitSample\debug\NUnitSample.dll + NUnit3TestExecutor discovered 16 of 16 NUnit test cases using Current Discovery mode, Non-Explicit run +Ignored_test: Ignoring for testing ;-) +Test 'Ignored_test' was skipped in the test run. +Test_with_failed_assumption: Expected: True + But was: False + +NUnit Adapter 4.3.0.0: Test execution complete + + + + + message written to stdout + + + + + \ No newline at end of file diff --git a/tests/data/source/trx-xunit-ignore.trx b/tests/data/source/trx-xunit-ignore.trx new file mode 100644 index 0000000..838af7e --- /dev/null +++ b/tests/data/source/trx-xunit-ignore.trx @@ -0,0 +1,68 @@ + + + + + + + + + + Ignoring for testing ;-) + + + + + + + + Failing for demo purposes +Expected: True +Actual: False + at XUnitSample.SimpleTests.Failing_test() in D:\Work-Git\github\Mini\trx2junit\samples\XUnitSample\SimpleTests.cs:line 20 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.0 (64-bit .NET Core 4.6.27317.03)[xUnit.net 00:00:00.45] Discovering: XUnitSample[xUnit.net 00:00:00.50] Discovered: XUnitSample[xUnit.net 00:00:00.51] Starting: XUnitSample[xUnit.net 00:00:00.67] Failing for demo purposes[xUnit.net 00:00:00.67] Expected: True[xUnit.net 00:00:00.67] Actual: False[xUnit.net 00:00:00.67] Stack Trace:[xUnit.net 00:00:00.67] D:\Work-Git\github\Mini\trx2junit\samples\XUnitSample\SimpleTests.cs(20,0): at XUnitSample.SimpleTests.Failing_test()[xUnit.net 00:00:01.69] Ignoring for testing ;-)[xUnit.net 00:00:01.71] Finished: XUnitSampleTest 'XUnitSample.SimpleTests.Ignored_test' was skipped in the test run. + + + + [xUnit.net 00:00:00.67] XUnitSample.SimpleTests.Failing_test [FAIL] + + + [xUnit.net 00:00:01.69] XUnitSample.SimpleTests.Ignored_test [SKIP] + + + + diff --git a/tests/data/source/trx-xunit.trx b/tests/data/source/trx-xunit.trx new file mode 100644 index 0000000..b2f268e --- /dev/null +++ b/tests/data/source/trx-xunit.trx @@ -0,0 +1,220 @@ + + + + + + + + + + + + Failing for demo purposes +Expected: True +Actual: False + at XUnitSample.DataDriven.Failing_test() in C:\projects\trx2junit\samples\XUnitSample\DataDriven.cs:line 26 + at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) + at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) + + + + + + + Failing for demo purposes +Expected: True +Actual: False + at XUnitSample.MemberData.Failing_test() in C:\projects\trx2junit\samples\XUnitSample\MemberData.cs:line 32 + at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) + at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) + + + + + + + + + Failing for demo purposes +Expected: True +Actual: False + at XUnitSample.DataDriven.Two_pass_one_fails(Int32 arg) in C:\projects\trx2junit\samples\XUnitSample\DataDriven.cs:line 17 + at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) + at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr) + + + + + + + + Failing for demo purposes +Expected: True +Actual: False + at XUnitSample.SimpleTests.Failing_test() in C:\projects\trx2junit\samples\XUnitSample\SimpleTests.cs:line 20 + at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) + at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) + + + + + + Ignoring for testing ;-) + + + + + + + Failing for demo purposes +Expected: True +Actual: False + at XUnitSample.MemberData.Two_pass_one_fails(Object obj) in C:\projects\trx2junit\samples\XUnitSample\MemberData.cs:line 23 + at InvokeStub_MemberData.Two_pass_one_fails(Object, Span`1) + at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit .NET 8.0.8) +[xUnit.net 00:00:00.24] Discovering: XUnitSample +[xUnit.net 00:00:00.26] Discovered: XUnitSample +[xUnit.net 00:00:00.27] Starting: XUnitSample +[xUnit.net 00:00:00.30] Failing for demo purposes +[xUnit.net 00:00:00.30] Expected: True +[xUnit.net 00:00:00.30] Actual: False +[xUnit.net 00:00:00.30] Stack Trace: +[xUnit.net 00:00:00.30] C:\projects\trx2junit\samples\XUnitSample\SimpleTests.cs(20,0): at XUnitSample.SimpleTests.Failing_test() +[xUnit.net 00:00:00.30] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) +[xUnit.net 00:00:00.30] at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) +[xUnit.net 00:00:00.30] Failing for demo purposes +[xUnit.net 00:00:00.30] Expected: True +[xUnit.net 00:00:00.30] Actual: False +[xUnit.net 00:00:00.30] Stack Trace: +[xUnit.net 00:00:00.30] C:\projects\trx2junit\samples\XUnitSample\MemberData.cs(32,0): at XUnitSample.MemberData.Failing_test() +[xUnit.net 00:00:00.30] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) +[xUnit.net 00:00:00.30] at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) +[xUnit.net 00:00:01.30] Failing for demo purposes +[xUnit.net 00:00:01.30] Expected: True +[xUnit.net 00:00:01.30] Actual: False +[xUnit.net 00:00:01.30] Stack Trace: +[xUnit.net 00:00:01.30] C:\projects\trx2junit\samples\XUnitSample\DataDriven.cs(26,0): at XUnitSample.DataDriven.Failing_test() +[xUnit.net 00:00:01.30] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) +[xUnit.net 00:00:01.30] at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) +[xUnit.net 00:00:01.30] Failing for demo purposes +[xUnit.net 00:00:01.30] Expected: True +[xUnit.net 00:00:01.30] Actual: False +[xUnit.net 00:00:01.30] Stack Trace: +[xUnit.net 00:00:01.30] C:\projects\trx2junit\samples\XUnitSample\DataDriven.cs(17,0): at XUnitSample.DataDriven.Two_pass_one_fails(Int32 arg) +[xUnit.net 00:00:01.30] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) +[xUnit.net 00:00:01.30] at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr) +[xUnit.net 00:00:01.34] Ignoring for testing ;-) +[xUnit.net 00:00:01.34] Failing for demo purposes +[xUnit.net 00:00:01.34] Expected: True +[xUnit.net 00:00:01.34] Actual: False +[xUnit.net 00:00:01.34] Stack Trace: +[xUnit.net 00:00:01.34] C:\projects\trx2junit\samples\XUnitSample\MemberData.cs(23,0): at XUnitSample.MemberData.Two_pass_one_fails(Object obj) +[xUnit.net 00:00:01.34] at InvokeStub_MemberData.Two_pass_one_fails(Object, Span`1) +[xUnit.net 00:00:01.34] at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +[xUnit.net 00:00:01.34] Finished: XUnitSample +Test 'XUnitSample.SimpleTests.Ignored_test' was skipped in the test run. + + + + + [xUnit.net 00:00:00.30] XUnitSample.SimpleTests.Failing_test [FAIL] + + + [xUnit.net 00:00:00.30] XUnitSample.MemberData.Failing_test [FAIL] + + + [xUnit.net 00:00:01.30] XUnitSample.DataDriven.Failing_test [FAIL] + + + [xUnit.net 00:00:01.30] XUnitSample.DataDriven.Two_pass_one_fails(arg: 1) [FAIL] + + + [xUnit.net 00:00:01.34] XUnitSample.SimpleTests.Ignored_test [SKIP] + + + [xUnit.net 00:00:01.34] XUnitSample.MemberData.Two_pass_one_fails(obj: { index = 1 }) [FAIL] + + + + \ No newline at end of file diff --git a/tests/setup.js b/tests/setup.js new file mode 100644 index 0000000..af584c6 --- /dev/null +++ b/tests/setup.js @@ -0,0 +1,45 @@ +const path = require('path'); +const fs = require("fs"); +const expect = require('@jest/globals').expect; + +const reportDir= './tests/data/result'; +const outDir= './tests/data/tmp'; + +function removeTempDir(){ + if(fs.existsSync(outDir)){ + fs.rmSync(outDir, { recursive: true, force: true }); + } +} + +function getFilename(file){ + return `${path.parse(file).name}-mochawesome.json` +} + +/** + * @returns {TestReportConverterOptions} options + */ +function createOptions(file, type){ + return { + testFile: path.join(__dirname, `data/source/${file}`), + testType: type, + reportDir: outDir, + reportFilename: getFilename(file), + junit: true + } +} + +/** + * @param {TestReportConverterOptions} options + * @param {string?} reportFilename + */ +function compare(options, reportFilename){ + let createdReport = fs.readFileSync(path.join(outDir, options.reportFilename), 'utf8'); + let report = fs.readFileSync(path.join(reportDir, reportFilename ?? options.reportFilename), 'utf8'); + + expect(createdReport.replaceAll(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,'')).toBe(report.replaceAll(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,'')); +} + +exports.outDir = outDir; +exports.createOptions = createOptions; +exports.compare = compare; +exports.removeTempDir = removeTempDir;