From 20d55e1cef41239b5a07092f72cce8ffcd9196df Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 4 Jul 2024 20:11:37 +0100 Subject: [PATCH] fix(NA): unhandled exception for junit report generation when no codeowners (#187597) This PR fixes what was brought on at https://github.com/elastic/kibana/pull/181711 . What was proposed won't work as we don't have codeowners files on branches other than main. (cherry picked from commit 228a6ffb0ff39bfdb5862071ee8cf559bb53e36a) --- packages/kbn-test/src/mocha/junit_report_generation.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/kbn-test/src/mocha/junit_report_generation.js b/packages/kbn-test/src/mocha/junit_report_generation.js index fcf31672d7996..c8eaa390ca41a 100644 --- a/packages/kbn-test/src/mocha/junit_report_generation.js +++ b/packages/kbn-test/src/mocha/junit_report_generation.js @@ -94,7 +94,10 @@ export function setupJUnitReportGeneration(runner, options = {}) { .map((node) => ({ skipped: true, node })); // cache codeowners for quicker lookup - const reversedCodeowners = getPathsWithOwnersReversed(); + let reversedCodeowners = []; + try { + reversedCodeowners = getPathsWithOwnersReversed(); + } catch {} const commandLine = prettifyCommandLine(process.argv);