From 4f7ec3e7923592dbfef32206bf1c2b21a36e15dd Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Sat, 24 Aug 2024 19:06:06 -0300 Subject: [PATCH] feat: add warning when fail on all platforms (#843) --- lib/ci/build-types/citgm_comparison_build.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/ci/build-types/citgm_comparison_build.js b/lib/ci/build-types/citgm_comparison_build.js index fb6c6775..d5fb58a8 100644 --- a/lib/ci/build-types/citgm_comparison_build.js +++ b/lib/ci/build-types/citgm_comparison_build.js @@ -44,6 +44,7 @@ export class CITGMComparisonBuild { const { failures: comparisonFailures } = comparisonBuild.results; const failures = {}; + let allPlatformFailures; for (const platform in comparisonFailures) { // Account for no failure on this platform, or different platform. if (!Object.prototype.hasOwnProperty.call(baseFailures, platform)) { @@ -66,11 +67,18 @@ export class CITGMComparisonBuild { if (newFailures.length !== 0) { result = statusType.FAILURE; } - + if (allPlatformFailures === undefined) { + allPlatformFailures = newFailures; + } else if (allPlatformFailures.length > 0) { + allPlatformFailures = allPlatformFailures.filter(f => { + return newFailures.includes(f); + }); + } failures[platform] = newFailures; } this.results.failures = failures; + this.results.allPlatformFailures = allPlatformFailures; this.result = result; return result; @@ -124,6 +132,12 @@ export class CITGMComparisonBuild { const str = `${totalFailures} failures in ${cID} not present in ${bID}`; cli.log(`${statusType.FAILURE}: ${str}\n\n`); console.table(output); + if ( + results.allPlatformFailures && + results.allPlatformFailures.length) { + const failures = results.allPlatformFailures.join(', '); + console.warn(`These modules failed in all platforms: ${failures}`); + } } formatAsJson() {