fix: count cancelled github checks as failed (#4077)
This commit is contained in:
parent
1dd9f85bf6
commit
bdacd8469f
|
|
@ -80,6 +80,17 @@ describe('hostedReviewSummaryFromGitHubPRInfo', () => {
|
|||
expect(summary.checksStatus).toBe('failure')
|
||||
})
|
||||
|
||||
it('treats cancelled checks as failed in hosted review summaries', () => {
|
||||
const summary = hostedReviewSummaryFromGitHubPRInfo({
|
||||
pr: { ...pr, checksStatus: 'success' },
|
||||
owner: 'acme',
|
||||
repo: 'orca',
|
||||
checks: [{ name: 'ci', status: 'completed', conclusion: 'cancelled', url: null }]
|
||||
})
|
||||
|
||||
expect(summary.checksStatus).toBe('failure')
|
||||
})
|
||||
|
||||
it('distinguishes loaded empty comments from unknown comments', () => {
|
||||
expect(
|
||||
hostedReviewSummaryFromGitHubPRInfo({
|
||||
|
|
|
|||
|
|
@ -36,7 +36,10 @@ function deriveChecksStatus(
|
|||
return prChecksStatus
|
||||
}
|
||||
const hasFailure = checks.some(
|
||||
(check) => check.conclusion === 'failure' || check.conclusion === 'timed_out'
|
||||
(check) =>
|
||||
check.conclusion === 'failure' ||
|
||||
check.conclusion === 'timed_out' ||
|
||||
check.conclusion === 'cancelled'
|
||||
)
|
||||
if (hasFailure) {
|
||||
return 'failure'
|
||||
|
|
|
|||
Loading…
Reference in New Issue