diff --git a/src/dev/jest/integration_tests/junit_reporter.test.js b/src/dev/jest/integration_tests/junit_reporter.test.js index b2ceedfb9f71..c26c8cfad802 100644 --- a/src/dev/jest/integration_tests/junit_reporter.test.js +++ b/src/dev/jest/integration_tests/junit_reporter.test.js @@ -29,7 +29,7 @@ const MINUTE = 1000 * 60; const ROOT_DIR = resolve(__dirname, '../../../../'); const FIXTURE_DIR = resolve(__dirname, '__fixtures__'); const TARGET_DIR = resolve(FIXTURE_DIR, 'target'); -const XML_PATH = resolve(TARGET_DIR, 'junit', process.env.JOB || '.', 'TEST-Jest Tests.xml'); +const XML_PATH = resolve(TARGET_DIR, 'junit', process.env.JOB || '.', `TEST-${process.env.JOB ? process.env.JOB + '-' : ''}Jest Tests.xml`); afterAll(async () => { await del(TARGET_DIR); diff --git a/src/dev/jest/junit_reporter.js b/src/dev/jest/junit_reporter.js index a1dcd0ba5026..0f748eff91e5 100644 --- a/src/dev/jest/junit_reporter.js +++ b/src/dev/jest/junit_reporter.js @@ -107,7 +107,7 @@ export default class JestJUnitReporter { rootDirectory, 'target/junit', process.env.JOB || '.', - `TEST-${reportName}.xml` + `TEST-${process.env.JOB ? process.env.JOB + '-' : ''}${reportName}.xml` ); const reportXML = root.end({ diff --git a/src/dev/mocha/__tests__/junit_report_generation.js b/src/dev/mocha/__tests__/junit_report_generation.js index 1b6dea9863bc..1cb53ea0ca1c 100644 --- a/src/dev/mocha/__tests__/junit_report_generation.js +++ b/src/dev/mocha/__tests__/junit_report_generation.js @@ -51,7 +51,14 @@ describe('dev/mocha/junit report generation', () => { await new Promise(resolve => mocha.run(resolve)); const report = await fcb(cb => parseString( - readFileSync(resolve(PROJECT_DIR, 'target/junit', process.env.JOB || '.', 'TEST-test.xml')), + readFileSync( + resolve( + PROJECT_DIR, + 'target/junit', + process.env.JOB || '.', + `TEST-${process.env.JOB ? process.env.JOB + '-' : ''}test.xml` + ) + ), cb ) ); diff --git a/src/dev/mocha/junit_report_generation.js b/src/dev/mocha/junit_report_generation.js index a1d0cf30348a..56f035964064 100644 --- a/src/dev/mocha/junit_report_generation.js +++ b/src/dev/mocha/junit_report_generation.js @@ -140,7 +140,7 @@ export function setupJUnitReportGeneration(runner, options = {}) { rootDirectory, 'target/junit', process.env.JOB || '.', - `TEST-${reportName}.xml` + `TEST-${process.env.JOB ? process.env.JOB + '-' : ''}${reportName}.xml` ); const reportXML = builder.end({ diff --git a/tasks/config/karma.js b/tasks/config/karma.js index 8e4d7b01d4a3..16947a97a3d1 100644 --- a/tasks/config/karma.js +++ b/tasks/config/karma.js @@ -67,7 +67,7 @@ module.exports = function (grunt) { reporters: process.env.CI ? ['dots', 'junit'] : ['progress'], junitReporter: { - outputFile: resolve(ROOT, 'target/junit', process.env.JOB || '.', 'TEST-karma.xml'), + outputFile: resolve(ROOT, 'target/junit', process.env.JOB || '.', `TEST-${process.env.JOB ? process.env.JOB + '-' : ''}karma.xml`), useBrowserName: false, nameFormatter: (browser, result) => [...result.suite, result.description].join(' '), classNameFormatter: (browser, result) => {