From a69d8d8917bbbaf873fe8f3b1a34b8ac934ca911 Mon Sep 17 00:00:00 2001 From: Tyler Smalley Date: Mon, 12 Oct 2020 18:43:08 -0700 Subject: [PATCH] [CI] Correctly resolve repository root for JUnit reports (#80226) (#80234) Signed-off-by: Tyler Smalley --- packages/kbn-test/src/jest/junit_reporter.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/kbn-test/src/jest/junit_reporter.ts b/packages/kbn-test/src/jest/junit_reporter.ts index 8deb6751bc268..0712584122e05 100644 --- a/packages/kbn-test/src/jest/junit_reporter.ts +++ b/packages/kbn-test/src/jest/junit_reporter.ts @@ -22,6 +22,7 @@ import { writeFileSync, mkdirSync } from 'fs'; import xmlBuilder from 'xmlbuilder'; +import { REPO_ROOT } from '@kbn/utils'; import type { Config } from '@jest/types'; import { AggregatedResult, Test, BaseReporter } from '@jest/reporters'; @@ -46,7 +47,7 @@ export default class JestJUnitReporter extends BaseReporter { constructor(globalConfig: Config.GlobalConfig, { rootDirectory, reportName }: ReporterOptions) { super(); this._reportName = reportName || 'Jest Tests'; - this._rootDirectory = rootDirectory ? resolve(rootDirectory) : resolve(__dirname, '../..'); + this._rootDirectory = rootDirectory ? resolve(rootDirectory) : REPO_ROOT; } /**