Fix nightly E2E step summary

This commit is contained in:
Samuel Newman
2026-07-17 15:47:56 +03:00
parent 43429fc61c
commit 823cb99549
2 changed files with 54 additions and 1 deletions
+53
View File
@@ -169,6 +169,52 @@ function platformBlock(platform) {
return lines.join('\n').slice(0, 3000) return lines.join('\n').slice(0, 3000)
} }
function githubSummary({notify, platforms, shortSha, runUrl, commitUrl}) {
const lines = [
`# Nightly Maestro E2E ${notify ? 'failed' : 'passed'}`,
'',
`- Commit: [\`${shortSha}\`](${commitUrl})`,
`- Workflow run: [open run](${runUrl})`,
'',
]
for (const platform of platforms) {
lines.push(
`## ${platform.status === 'success' ? '✅' : '❌'} ${platform.name}`,
'',
`Job status: \`${platform.status}\``,
'',
)
if (platform.failures.length > 0) {
for (const failure of platform.failures.slice(0, 10)) {
lines.push(`- **${failure.name}:** ${failure.message}`)
}
if (platform.failures.length > 10) {
lines.push(`- …and ${platform.failures.length - 10} more failed flows`)
}
lines.push('')
} else if (platform.failed && !platform.hasJUnit) {
lines.push(
`- Setup phase: ${platform.phase || 'No phase metadata was captured'}`,
'',
)
} else if (platform.failed) {
lines.push(
`- The job failed after JUnit was written (latest phase: ${platform.phase || 'unknown'})`,
'',
)
}
if (platform.artifactUrl) {
lines.push(
`- [${platform.name} logs and artifacts](${platform.artifactUrl})`,
'',
)
}
}
return lines.join('\n').trim()
}
export function buildSummary({ export function buildSummary({
iosStatus, iosStatus,
androidStatus, androidStatus,
@@ -254,6 +300,13 @@ export function buildSummary({
return { return {
notify, notify,
platforms, platforms,
githubSummary: githubSummary({
notify,
platforms,
shortSha,
runUrl,
commitUrl,
}),
payload: {text, blocks}, payload: {text, blocks},
} }
} }
+1 -1
View File
@@ -369,7 +369,7 @@ jobs:
> e2e-summary.json > e2e-summary.json
echo "notify=$(jq -r .notify e2e-summary.json)" >> "$GITHUB_OUTPUT" echo "notify=$(jq -r .notify e2e-summary.json)" >> "$GITHUB_OUTPUT"
echo "payload=$(jq -c .payload e2e-summary.json)" >> "$GITHUB_OUTPUT" echo "payload=$(jq -c .payload e2e-summary.json)" >> "$GITHUB_OUTPUT"
jq -r .payload.text e2e-summary.json >> "$GITHUB_STEP_SUMMARY" jq -r .githubSummary e2e-summary.json >> "$GITHUB_STEP_SUMMARY"
- name: Notify Slack of E2E failures - name: Notify Slack of E2E failures
if: steps.summary.outputs.notify == 'true' if: steps.summary.outputs.notify == 'true'