Prevent crash when encountering "STALE" check conclusion
The "STALE" conclusion has shipped this January and is basically a conclusion that can only be reported by GitHub and not explicitly set by any integrations.
This commit is contained in:
parent
bc3f964621
commit
c0bc938ea4
2 changed files with 6 additions and 4 deletions
|
|
@ -22,7 +22,9 @@ func TestPullRequest_ChecksStatus(t *testing.T) {
|
||||||
{ "status": "COMPLETED",
|
{ "status": "COMPLETED",
|
||||||
"conclusion": "FAILURE" },
|
"conclusion": "FAILURE" },
|
||||||
{ "status": "COMPLETED",
|
{ "status": "COMPLETED",
|
||||||
"conclusion": "ACTION_REQUIRED" }
|
"conclusion": "ACTION_REQUIRED" },
|
||||||
|
{ "status": "COMPLETED",
|
||||||
|
"conclusion": "STALE" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -32,8 +34,8 @@ func TestPullRequest_ChecksStatus(t *testing.T) {
|
||||||
eq(t, err, nil)
|
eq(t, err, nil)
|
||||||
|
|
||||||
checks := pr.ChecksStatus()
|
checks := pr.ChecksStatus()
|
||||||
eq(t, checks.Total, 7)
|
eq(t, checks.Total, 8)
|
||||||
eq(t, checks.Pending, 2)
|
eq(t, checks.Pending, 3)
|
||||||
eq(t, checks.Failing, 3)
|
eq(t, checks.Failing, 3)
|
||||||
eq(t, checks.Passing, 2)
|
eq(t, checks.Passing, 2)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ func (pr *PullRequest) ChecksStatus() (summary PullRequestChecksStatus) {
|
||||||
summary.Passing++
|
summary.Passing++
|
||||||
case "ERROR", "FAILURE", "CANCELLED", "TIMED_OUT", "ACTION_REQUIRED":
|
case "ERROR", "FAILURE", "CANCELLED", "TIMED_OUT", "ACTION_REQUIRED":
|
||||||
summary.Failing++
|
summary.Failing++
|
||||||
case "EXPECTED", "REQUESTED", "QUEUED", "PENDING", "IN_PROGRESS":
|
case "EXPECTED", "REQUESTED", "QUEUED", "PENDING", "IN_PROGRESS", "STALE":
|
||||||
summary.Pending++
|
summary.Pending++
|
||||||
default:
|
default:
|
||||||
panic(fmt.Errorf("unsupported status: %q", state))
|
panic(fmt.Errorf("unsupported status: %q", state))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue