[CI] Make cypress reporting more resilient (#184397)

## Summary
cypress reporter will occasionally get an empty result object - it draws
attention from other error messages in the stream, and allows misleading
conclusions

let's not fail reporting because of that, and hope that the real error
will also surface.


See:
https://buildkite.com/elastic/kibana-pull-request/builds/212655#018fc04b-e385-4760-87db-41b65f86fb40

---------

Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
This commit is contained in:
Alex Szabo 2024-05-29 16:13:54 +02:00 committed by GitHub
parent d39739ee85
commit 8bbba600c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -493,10 +493,15 @@ ${JSON.stringify(cyCustomEnv, null, 2)}
(runResult) => !failedSpecFilePaths.includes(runResult.spec.absolute)
)
),
...retryResults,
..._.filter(retryResults, (retryResult) => !!retryResult),
] as CypressCommandLine.CypressRunResult[];
renderSummaryTable(finalResults);
try {
renderSummaryTable(finalResults);
} catch (e) {
log.error('Failed to render summary table');
log.error(e);
}
const hasFailedTests = (
runResults: Array<