diff --git a/src/dev/jest/integration_tests/junit_reporter.test.js b/src/dev/jest/integration_tests/junit_reporter.test.js index b2ceedfb9f711..c26c8cfad8025 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 a1dcd0ba50261..0f748eff91e56 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 0e23662bdd84f..4ed81871403b6 100644 --- a/src/dev/mocha/__tests__/junit_report_generation.js +++ b/src/dev/mocha/__tests__/junit_report_generation.js @@ -50,7 +50,11 @@ describe('dev/mocha/junit report generation', () => { mocha.addFile(resolve(PROJECT_DIR, 'test.js')); 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')), cb) + parseString( + readFileSync( + resolve(PROJECT_DIR, 'target/junit', process.env.JOB || '.', `TEST-${process.env.JOB ? process.env.JOB + '-' : ''}test.xml`) + ), cb + ) ); // test case results are wrapped in diff --git a/src/dev/mocha/junit_report_generation.js b/src/dev/mocha/junit_report_generation.js index 7a2f45a819a04..b7222cfd0fb3c 100644 --- a/src/dev/mocha/junit_report_generation.js +++ b/src/dev/mocha/junit_report_generation.js @@ -146,7 +146,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 8e4d7b01d4a37..16947a97a3d14 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) => {