Skip to content

Commit

Permalink
feat: add warning when fail on all platforms (#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS authored Aug 24, 2024
1 parent f420432 commit 4f7ec3e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/ci/build-types/citgm_comparison_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 4f7ec3e

Please sign in to comment.