From b128bf62519ec15f5373aa2eb000db75c03b6ca5 Mon Sep 17 00:00:00 2001 From: Ash Wu Date: Wed, 25 Feb 2026 20:36:51 +0800 Subject: [PATCH] [build-tools] Wrap parseMaestroResults in try-catch to prevent step failure Signed-off-by: Ash Wu --- .../functions/reportMaestroTestResults.ts | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/build-tools/src/steps/functions/reportMaestroTestResults.ts b/packages/build-tools/src/steps/functions/reportMaestroTestResults.ts index 7f8d19b1bd..e377454210 100644 --- a/packages/build-tools/src/steps/functions/reportMaestroTestResults.ts +++ b/packages/build-tools/src/steps/functions/reportMaestroTestResults.ts @@ -53,31 +53,31 @@ export function createReportMaestroTestResultsFunction(ctx: CustomBuildContext): } const testsDirectory = inputs.tests_directory.value as string; - const flowResults = await parseMaestroResults( - junitDirectory, - testsDirectory, - stepsCtx.workingDirectory - ); - if (flowResults.length === 0) { - logger.info('No maestro test results found, skipping report'); - return; - } - - // Maestro allows overriding flow names via config, so different flow files can share - // the same name. JUnit XML only contains names (not file paths), making it impossible - // to map duplicates back to their original flow files. Skip and let the user fix it. - const names = flowResults.map(r => r.name); - const duplicates = names.filter((n, i) => names.indexOf(n) !== i); - if (duplicates.length > 0) { - logger.error( - `Duplicate test case names found in JUnit output: ${[...new Set(duplicates)].join( - ', ' - )}. Skipping report. Ensure each Maestro flow has a unique name.` + try { + const flowResults = await parseMaestroResults( + junitDirectory, + testsDirectory, + stepsCtx.workingDirectory ); - return; - } + if (flowResults.length === 0) { + logger.info('No maestro test results found, skipping report'); + return; + } + + // Maestro allows overriding flow names via config, so different flow files can share + // the same name. JUnit XML only contains names (not file paths), making it impossible + // to map duplicates back to their original flow files. Skip and let the user fix it. + const names = flowResults.map(r => r.name); + const duplicates = names.filter((n, i) => names.indexOf(n) !== i); + if (duplicates.length > 0) { + logger.error( + `Duplicate test case names found in JUnit output: ${[...new Set(duplicates)].join( + ', ' + )}. Skipping report. Ensure each Maestro flow has a unique name.` + ); + return; + } - try { const testCaseResults = flowResults.flatMap(f => { const status = FLOW_STATUS_TO_TEST_CASE_RESULT_STATUS[f.status]; if (!status) {