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

# Backport

This will backport the following commits from `main` to `8.14`:
- [[CI] Make cypress reporting more resilient
(#184397)](https://github.com/elastic/kibana/pull/184397)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"alex.szabo@elastic.co"},"sourceCommit":{"committedDate":"2024-05-29T14:13:54Z","message":"[CI]
Make cypress reporting more resilient (#184397)\n\n## Summary\ncypress
reporter will occasionally get an empty result object - it
draws\nattention from other error messages in the stream, and allows
misleading\nconclusions\n\nlet's not fail reporting because of that, and
hope that the real error\nwill also
surface.\n\n\nSee:\nhttps://buildkite.com/elastic/kibana-pull-request/builds/212655#018fc04b-e385-4760-87db-41b65f86fb40\n\n---------\n\nCo-authored-by:
Patryk Kopycinski
<contact@patrykkopycinski.com>","sha":"8bbba600c19d0930d5b77872a1352d35ff8cfbc8","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","v8.15.0"],"title":"[CI]
Make cypress reporting more
resilient","number":184397,"url":"https://github.com/elastic/kibana/pull/184397","mergeCommit":{"message":"[CI]
Make cypress reporting more resilient (#184397)\n\n## Summary\ncypress
reporter will occasionally get an empty result object - it
draws\nattention from other error messages in the stream, and allows
misleading\nconclusions\n\nlet's not fail reporting because of that, and
hope that the real error\nwill also
surface.\n\n\nSee:\nhttps://buildkite.com/elastic/kibana-pull-request/builds/212655#018fc04b-e385-4760-87db-41b65f86fb40\n\n---------\n\nCo-authored-by:
Patryk Kopycinski
<contact@patrykkopycinski.com>","sha":"8bbba600c19d0930d5b77872a1352d35ff8cfbc8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/184397","number":184397,"mergeCommit":{"message":"[CI]
Make cypress reporting more resilient (#184397)\n\n## Summary\ncypress
reporter will occasionally get an empty result object - it
draws\nattention from other error messages in the stream, and allows
misleading\nconclusions\n\nlet's not fail reporting because of that, and
hope that the real error\nwill also
surface.\n\n\nSee:\nhttps://buildkite.com/elastic/kibana-pull-request/builds/212655#018fc04b-e385-4760-87db-41b65f86fb40\n\n---------\n\nCo-authored-by:
Patryk Kopycinski
<contact@patrykkopycinski.com>","sha":"8bbba600c19d0930d5b77872a1352d35ff8cfbc8"}}]}]
BACKPORT-->

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
This commit is contained in:
Kibana Machine 2024-05-29 17:12:49 -04:00 committed by GitHub
parent 8a37e604d6
commit b6c1b9b41c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -492,10 +492,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<