(t *testing.T)
| 27 | } |
| 28 | |
| 29 | func TestChecksStatus_SummarisingCheckRuns(t *testing.T) { |
| 30 | t.Parallel() |
| 31 | |
| 32 | tests := []struct { |
| 33 | name string |
| 34 | payload string |
| 35 | expectedChecksStatus PullRequestChecksStatus |
| 36 | }{ |
| 37 | { |
| 38 | name: "QUEUED is treated as Pending", |
| 39 | payload: singleCheckRunWithStatus("QUEUED"), |
| 40 | expectedChecksStatus: PullRequestChecksStatus{Pending: 1, Total: 1}, |
| 41 | }, |
| 42 | { |
| 43 | name: "IN_PROGRESS is treated as Pending", |
| 44 | payload: singleCheckRunWithStatus("IN_PROGRESS"), |
| 45 | expectedChecksStatus: PullRequestChecksStatus{Pending: 1, Total: 1}, |
| 46 | }, |
| 47 | { |
| 48 | name: "WAITING is treated as Pending", |
| 49 | payload: singleCheckRunWithStatus("WAITING"), |
| 50 | expectedChecksStatus: PullRequestChecksStatus{Pending: 1, Total: 1}, |
| 51 | }, |
| 52 | { |
| 53 | name: "PENDING is treated as Pending", |
| 54 | payload: singleCheckRunWithStatus("PENDING"), |
| 55 | expectedChecksStatus: PullRequestChecksStatus{Pending: 1, Total: 1}, |
| 56 | }, |
| 57 | { |
| 58 | name: "REQUESTED is treated as Pending", |
| 59 | payload: singleCheckRunWithStatus("REQUESTED"), |
| 60 | expectedChecksStatus: PullRequestChecksStatus{Pending: 1, Total: 1}, |
| 61 | }, |
| 62 | { |
| 63 | name: "COMPLETED with no conclusion is treated as Pending", |
| 64 | payload: singleCheckRunWithStatus("COMPLETED"), |
| 65 | expectedChecksStatus: PullRequestChecksStatus{Pending: 1, Total: 1}, |
| 66 | }, |
| 67 | { |
| 68 | name: "COMPLETED / STARTUP_FAILURE is treated as Pending", |
| 69 | payload: singleCompletedCheckRunWithConclusion("STARTUP_FAILURE"), |
| 70 | expectedChecksStatus: PullRequestChecksStatus{Pending: 1, Total: 1}, |
| 71 | }, |
| 72 | { |
| 73 | name: "COMPLETED / STALE is treated as Pending", |
| 74 | payload: singleCompletedCheckRunWithConclusion("STALE"), |
| 75 | expectedChecksStatus: PullRequestChecksStatus{Pending: 1, Total: 1}, |
| 76 | }, |
| 77 | { |
| 78 | name: "COMPLETED / SUCCESS is treated as Passing", |
| 79 | payload: singleCompletedCheckRunWithConclusion("SUCCESS"), |
| 80 | expectedChecksStatus: PullRequestChecksStatus{Passing: 1, Total: 1}, |
| 81 | }, |
| 82 | { |
| 83 | name: "COMPLETED / NEUTRAL is treated as Passing", |
| 84 | payload: singleCompletedCheckRunWithConclusion("NEUTRAL"), |
| 85 | expectedChecksStatus: PullRequestChecksStatus{Passing: 1, Total: 1}, |
| 86 | }, |
nothing calls this directly
no test coverage detected