Unverified Commit 5ccc1cc2 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[ci] Create test summary comment if job immediately passes (#93236)

parent 8a390fbf
...@@ -130,13 +130,7 @@ class GitHubClient { ...@@ -130,13 +130,7 @@ class GitHubClient {
) )
} }
async upsertIssueComment( async upsertIssueComment(issueNumber, marker, body, fallbackHeadings = []) {
issueNumber,
marker,
body,
fallbackHeadings = [],
{ createIfMissing = true } = {}
) {
body = fitComment(body) body = fitComment(body)
const comments = await this.listIssueComments(issueNumber) const comments = await this.listIssueComments(issueNumber)
...@@ -152,10 +146,6 @@ class GitHubClient { ...@@ -152,10 +146,6 @@ class GitHubClient {
}) })
if (this.dryRun) { if (this.dryRun) {
if (!existing && !createIfMissing) {
console.log(`[dry-run] No existing comment found for #${issueNumber}`)
return
}
console.log( console.log(
`[dry-run] ${existing ? 'Would update' : 'Would create'} comment for #${issueNumber}` `[dry-run] ${existing ? 'Would update' : 'Would create'} comment for #${issueNumber}`
) )
...@@ -163,11 +153,6 @@ class GitHubClient { ...@@ -163,11 +153,6 @@ class GitHubClient {
return return
} }
if (!existing && !createIfMissing) {
console.log(`No existing comment found for #${issueNumber}, skipping`)
return
}
if (existing) { if (existing) {
try { try {
await this.request( await this.request(
...@@ -479,15 +464,10 @@ async function handleBuildAndTestWorkflow({ ...@@ -479,15 +464,10 @@ async function handleBuildAndTestWorkflow({
'', '',
].join('\n') ].join('\n')
await github.upsertIssueComment( await github.upsertIssueComment(pr.number, TEST_COMMENT_MARKER, body, [
pr.number, '## Failing test suites',
TEST_COMMENT_MARKER, '## Failing CI jobs',
body, ])
['## Failing test suites', '## Failing CI jobs'],
{
createIfMissing: false,
}
)
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment