diff --git a/pkg/cmd/pr/checks/checks.go b/pkg/cmd/pr/checks/checks.go index 36b59bb96..abd4d9a7b 100644 --- a/pkg/cmd/pr/checks/checks.go +++ b/pkg/cmd/pr/checks/checks.go @@ -103,6 +103,7 @@ func checksRun(opts *ChecksOptions) error { passing := 0 failing := 0 + skipping := 0 pending := 0 type output struct { @@ -131,15 +132,20 @@ func checksRun(opts *ChecksOptions) error { } } switch state { - case "SUCCESS", "NEUTRAL", "SKIPPED": + case "SUCCESS": passing++ + case "SKIPPED", "NEUTRAL": + mark = "-" + markColor = cs.Gray + skipping++ + bucket = "skipping" case "ERROR", "FAILURE", "CANCELLED", "TIMED_OUT", "ACTION_REQUIRED": mark = "X" markColor = cs.Red failing++ bucket = "fail" default: // "EXPECTED", "REQUESTED", "WAITING", "QUEUED", "PENDING", "IN_PROGRESS", "STALE" - mark = "-" + mark = "*" markColor = cs.Yellow pending++ bucket = "pending" @@ -209,7 +215,7 @@ func checksRun(opts *ChecksOptions) error { } summary := "" - if failing+passing+pending > 0 { + if failing+passing+skipping+pending > 0 { if failing > 0 { summary = "Some checks were not successful" } else if pending > 0 { @@ -218,9 +224,8 @@ func checksRun(opts *ChecksOptions) error { summary = "All checks were successful" } - tallies := fmt.Sprintf( - "%d failing, %d successful, and %d pending checks", - failing, passing, pending) + tallies := fmt.Sprintf("%d failing, %d successful, %d skipped, and %d pending checks", + failing, passing, skipping, pending) summary = fmt.Sprintf("%s\n%s", cs.Bold(summary), tallies) } diff --git a/pkg/cmd/pr/checks/checks_test.go b/pkg/cmd/pr/checks/checks_test.go index 36c5ac7f5..78d664c4f 100644 --- a/pkg/cmd/pr/checks/checks_test.go +++ b/pkg/cmd/pr/checks/checks_test.go @@ -90,25 +90,25 @@ func Test_checksRun(t *testing.T) { { name: "some failing", fixture: "./fixtures/someFailing.json", - wantOut: "Some checks were not successful\n1 failing, 1 successful, and 1 pending checks\n\nX sad tests 1m26s sweet link\n✓ cool tests 1m26s sweet link\n- slow tests 1m26s sweet link\n", + wantOut: "Some checks were not successful\n1 failing, 1 successful, 0 skipped, and 1 pending checks\n\nX sad tests 1m26s sweet link\n✓ cool tests 1m26s sweet link\n* slow tests 1m26s sweet link\n", wantErr: "SilentError", }, { name: "some pending", fixture: "./fixtures/somePending.json", - wantOut: "Some checks are still pending\n0 failing, 2 successful, and 1 pending checks\n\n✓ cool tests 1m26s sweet link\n✓ rad tests 1m26s sweet link\n- slow tests 1m26s sweet link\n", + wantOut: "Some checks are still pending\n0 failing, 2 successful, 0 skipped, and 1 pending checks\n\n✓ cool tests 1m26s sweet link\n✓ rad tests 1m26s sweet link\n* slow tests 1m26s sweet link\n", wantErr: "SilentError", }, { name: "all passing", fixture: "./fixtures/allPassing.json", - wantOut: "All checks were successful\n0 failing, 3 successful, and 0 pending checks\n\n✓ awesome tests 1m26s sweet link\n✓ cool tests 1m26s sweet link\n✓ rad tests 1m26s sweet link\n", + wantOut: "All checks were successful\n0 failing, 3 successful, 0 skipped, and 0 pending checks\n\n✓ awesome tests 1m26s sweet link\n✓ cool tests 1m26s sweet link\n✓ rad tests 1m26s sweet link\n", wantErr: "", }, { name: "with statuses", fixture: "./fixtures/withStatuses.json", - wantOut: "Some checks were not successful\n1 failing, 2 successful, and 0 pending checks\n\nX a status sweet link\n✓ cool tests 1m26s sweet link\n✓ rad tests 1m26s sweet link\n", + wantOut: "Some checks were not successful\n1 failing, 2 successful, 0 skipped, and 0 pending checks\n\nX a status sweet link\n✓ cool tests 1m26s sweet link\n✓ rad tests 1m26s sweet link\n", wantErr: "SilentError", }, { @@ -146,6 +146,12 @@ func Test_checksRun(t *testing.T) { wantOut: "a status\tfail\t0\tsweet link\ncool tests\tpass\t1m26s\tsweet link\nrad tests\tpass\t1m26s\tsweet link\n", wantErr: "SilentError", }, + { + name: "some skipped", + fixture: "./fixtures/someSkipping.json", + wantOut: "All checks were successful\n0 failing, 1 successful, 2 skipped, and 0 pending checks\n\n✓ cool tests 1m26s sweet link\n- rad tests 1m26s sweet link\n- skip tests 1m26s sweet link\n", + wantErr: "", + }, } for _, tt := range tests { diff --git a/pkg/cmd/pr/checks/fixtures/someSkipping.json b/pkg/cmd/pr/checks/fixtures/someSkipping.json new file mode 100644 index 000000000..65ac5b98f --- /dev/null +++ b/pkg/cmd/pr/checks/fixtures/someSkipping.json @@ -0,0 +1,42 @@ +{ + "number": 123, + "statusCheckRollup": { + "nodes": [ + { + "commit": { + "oid": "abc", + "statusCheckRollup": { + "contexts": { + "nodes": [ + { + "conclusion": "SUCCESS", + "status": "COMPLETED", + "name": "cool tests", + "completedAt": "2020-08-27T19:00:12Z", + "startedAt": "2020-08-27T18:58:46Z", + "detailsUrl": "sweet link" + }, + { + "conclusion": "SKIPPED", + "status": "COMPLETED", + "name": "rad tests", + "completedAt": "2020-08-27T19:00:12Z", + "startedAt": "2020-08-27T18:58:46Z", + "detailsUrl": "sweet link" + }, + { + "conclusion": "SKIPPED", + "status": "COMPLETED", + "name": "skip tests", + "completedAt": "2020-08-27T19:00:12Z", + "startedAt": "2020-08-27T18:58:46Z", + "detailsUrl": "sweet link" + } + ] + } + } + } + } + ] + } +} diff --git a/pkg/cmd/run/list/list_test.go b/pkg/cmd/run/list/list_test.go index ab9ecf8f7..c2f526d61 100644 --- a/pkg/cmd/run/list/list_test.go +++ b/pkg/cmd/run/list/list_test.go @@ -108,7 +108,7 @@ func TestListRun(t *testing.T) { WorkflowRuns: shared.TestRuns, })) }, - wantOut: "STATUS NAME WORKFLOW BRANCH EVENT ID ELAPSED AGE\nX cool commit timed out trunk push 1 4m34s Feb 23, 2021\n- cool commit in progress trunk push 2 4m34s Feb 23, 2021\n✓ cool commit successful trunk push 3 4m34s Feb 23, 2021\n✓ cool commit cancelled trunk push 4 4m34s Feb 23, 2021\nX cool commit failed trunk push 1234 4m34s Feb 23, 2021\n✓ cool commit neutral trunk push 6 4m34s Feb 23, 2021\n✓ cool commit skipped trunk push 7 4m34s Feb 23, 2021\n- cool commit requested trunk push 8 4m34s Feb 23, 2021\n- cool commit queued trunk push 9 4m34s Feb 23, 2021\nX cool commit stale trunk push 10 4m34s Feb 23, 2021\n\nFor details on a run, try: gh run view \n", + wantOut: "STATUS NAME WORKFLOW BRANCH EVENT ID ELAPSED AGE\nX cool commit timed out trunk push 1 4m34s Feb 23, 2021\n* cool commit in progress trunk push 2 4m34s Feb 23, 2021\n✓ cool commit successful trunk push 3 4m34s Feb 23, 2021\n- cool commit cancelled trunk push 4 4m34s Feb 23, 2021\nX cool commit failed trunk push 1234 4m34s Feb 23, 2021\n- cool commit neutral trunk push 6 4m34s Feb 23, 2021\n- cool commit skipped trunk push 7 4m34s Feb 23, 2021\n* cool commit requested trunk push 8 4m34s Feb 23, 2021\n* cool commit queued trunk push 9 4m34s Feb 23, 2021\nX cool commit stale trunk push 10 4m34s Feb 23, 2021\n\nFor details on a run, try: gh run view \n", }, { name: "blank nontty", @@ -196,7 +196,7 @@ func TestListRun(t *testing.T) { WorkflowRuns: shared.WorkflowRuns, })) }, - wantOut: "STATUS NAME WORKFLOW BRANCH EVENT ID ELAPSED AGE\n- cool commit in progress trunk push 2 4m34s Feb 23, 2021\n✓ cool commit successful trunk push 3 4m34s Feb 23, 2021\nX cool commit failed trunk push 1234 4m34s Feb 23, 2021\n\nFor details on a run, try: gh run view \n", + wantOut: "STATUS NAME WORKFLOW BRANCH EVENT ID ELAPSED AGE\n* cool commit in progress trunk push 2 4m34s Feb 23, 2021\n✓ cool commit successful trunk push 3 4m34s Feb 23, 2021\nX cool commit failed trunk push 1234 4m34s Feb 23, 2021\n\nFor details on a run, try: gh run view \n", }, } @@ -226,4 +226,4 @@ func TestListRun(t *testing.T) { } } -const longRunOutput = "STATUS NAME WORKFLOW BRANCH EVENT ID ELAPSED AGE\n- cool commit 0 trunk push 0 4m34s Feb 23, 2021\n- cool commit 1 trunk push 1 4m34s Feb 23, 2021\n- cool commit 2 trunk push 2 4m34s Feb 23, 2021\n- cool commit 3 trunk push 3 4m34s Feb 23, 2021\n- cool commit 4 trunk push 4 4m34s Feb 23, 2021\n- cool commit 5 trunk push 5 4m34s Feb 23, 2021\n- cool commit 6 trunk push 6 4m34s Feb 23, 2021\n- cool commit 7 trunk push 7 4m34s Feb 23, 2021\n- cool commit 8 trunk push 8 4m34s Feb 23, 2021\n- cool commit 9 trunk push 9 4m34s Feb 23, 2021\n- cool commit 10 trunk push 10 4m34s Feb 23, 2021\n- cool commit 11 trunk push 11 4m34s Feb 23, 2021\n- cool commit 12 trunk push 12 4m34s Feb 23, 2021\n- cool commit 13 trunk push 13 4m34s Feb 23, 2021\n- cool commit 14 trunk push 14 4m34s Feb 23, 2021\n- cool commit 15 trunk push 15 4m34s Feb 23, 2021\n- cool commit 16 trunk push 16 4m34s Feb 23, 2021\n- cool commit 17 trunk push 17 4m34s Feb 23, 2021\n- cool commit 18 trunk push 18 4m34s Feb 23, 2021\n- cool commit 19 trunk push 19 4m34s Feb 23, 2021\n- cool commit 20 trunk push 20 4m34s Feb 23, 2021\n- cool commit 21 trunk push 21 4m34s Feb 23, 2021\n- cool commit 22 trunk push 22 4m34s Feb 23, 2021\n- cool commit 23 trunk push 23 4m34s Feb 23, 2021\n- cool commit 24 trunk push 24 4m34s Feb 23, 2021\n- cool commit 25 trunk push 25 4m34s Feb 23, 2021\n- cool commit 26 trunk push 26 4m34s Feb 23, 2021\n- cool commit 27 trunk push 27 4m34s Feb 23, 2021\n- cool commit 28 trunk push 28 4m34s Feb 23, 2021\n- cool commit 29 trunk push 29 4m34s Feb 23, 2021\n- cool commit 30 trunk push 30 4m34s Feb 23, 2021\n- cool commit 31 trunk push 31 4m34s Feb 23, 2021\n- cool commit 32 trunk push 32 4m34s Feb 23, 2021\n- cool commit 33 trunk push 33 4m34s Feb 23, 2021\n- cool commit 34 trunk push 34 4m34s Feb 23, 2021\n- cool commit 35 trunk push 35 4m34s Feb 23, 2021\n- cool commit 36 trunk push 36 4m34s Feb 23, 2021\n- cool commit 37 trunk push 37 4m34s Feb 23, 2021\n- cool commit 38 trunk push 38 4m34s Feb 23, 2021\n- cool commit 39 trunk push 39 4m34s Feb 23, 2021\n- cool commit 40 trunk push 40 4m34s Feb 23, 2021\n- cool commit 41 trunk push 41 4m34s Feb 23, 2021\n- cool commit 42 trunk push 42 4m34s Feb 23, 2021\n- cool commit 43 trunk push 43 4m34s Feb 23, 2021\n- cool commit 44 trunk push 44 4m34s Feb 23, 2021\n- cool commit 45 trunk push 45 4m34s Feb 23, 2021\n- cool commit 46 trunk push 46 4m34s Feb 23, 2021\n- cool commit 47 trunk push 47 4m34s Feb 23, 2021\n- cool commit 48 trunk push 48 4m34s Feb 23, 2021\n- cool commit 49 trunk push 49 4m34s Feb 23, 2021\n- cool commit 50 trunk push 50 4m34s Feb 23, 2021\n- cool commit 51 trunk push 51 4m34s Feb 23, 2021\n- cool commit 52 trunk push 52 4m34s Feb 23, 2021\n- cool commit 53 trunk push 53 4m34s Feb 23, 2021\n- cool commit 54 trunk push 54 4m34s Feb 23, 2021\n- cool commit 55 trunk push 55 4m34s Feb 23, 2021\n- cool commit 56 trunk push 56 4m34s Feb 23, 2021\n- cool commit 57 trunk push 57 4m34s Feb 23, 2021\n- cool commit 58 trunk push 58 4m34s Feb 23, 2021\n- cool commit 59 trunk push 59 4m34s Feb 23, 2021\n- cool commit 60 trunk push 60 4m34s Feb 23, 2021\n- cool commit 61 trunk push 61 4m34s Feb 23, 2021\n- cool commit 62 trunk push 62 4m34s Feb 23, 2021\n- cool commit 63 trunk push 63 4m34s Feb 23, 2021\n- cool commit 64 trunk push 64 4m34s Feb 23, 2021\n- cool commit 65 trunk push 65 4m34s Feb 23, 2021\n- cool commit 66 trunk push 66 4m34s Feb 23, 2021\n- cool commit 67 trunk push 67 4m34s Feb 23, 2021\n- cool commit 68 trunk push 68 4m34s Feb 23, 2021\n- cool commit 69 trunk push 69 4m34s Feb 23, 2021\n- cool commit 70 trunk push 70 4m34s Feb 23, 2021\n- cool commit 71 trunk push 71 4m34s Feb 23, 2021\n- cool commit 72 trunk push 72 4m34s Feb 23, 2021\n- cool commit 73 trunk push 73 4m34s Feb 23, 2021\n- cool commit 74 trunk push 74 4m34s Feb 23, 2021\n- cool commit 75 trunk push 75 4m34s Feb 23, 2021\n- cool commit 76 trunk push 76 4m34s Feb 23, 2021\n- cool commit 77 trunk push 77 4m34s Feb 23, 2021\n- cool commit 78 trunk push 78 4m34s Feb 23, 2021\n- cool commit 79 trunk push 79 4m34s Feb 23, 2021\n- cool commit 80 trunk push 80 4m34s Feb 23, 2021\n- cool commit 81 trunk push 81 4m34s Feb 23, 2021\n- cool commit 82 trunk push 82 4m34s Feb 23, 2021\n- cool commit 83 trunk push 83 4m34s Feb 23, 2021\n- cool commit 84 trunk push 84 4m34s Feb 23, 2021\n- cool commit 85 trunk push 85 4m34s Feb 23, 2021\n- cool commit 86 trunk push 86 4m34s Feb 23, 2021\n- cool commit 87 trunk push 87 4m34s Feb 23, 2021\n- cool commit 88 trunk push 88 4m34s Feb 23, 2021\n- cool commit 89 trunk push 89 4m34s Feb 23, 2021\n- cool commit 90 trunk push 90 4m34s Feb 23, 2021\n- cool commit 91 trunk push 91 4m34s Feb 23, 2021\n- cool commit 92 trunk push 92 4m34s Feb 23, 2021\n- cool commit 93 trunk push 93 4m34s Feb 23, 2021\n- cool commit 94 trunk push 94 4m34s Feb 23, 2021\n- cool commit 95 trunk push 95 4m34s Feb 23, 2021\n- cool commit 96 trunk push 96 4m34s Feb 23, 2021\n- cool commit 97 trunk push 97 4m34s Feb 23, 2021\n- cool commit 98 trunk push 98 4m34s Feb 23, 2021\n- cool commit 99 trunk push 99 4m34s Feb 23, 2021\n- cool commit 100 trunk push 100 4m34s Feb 23, 2021\n\nFor details on a run, try: gh run view \n" +const longRunOutput = "STATUS NAME WORKFLOW BRANCH EVENT ID ELAPSED AGE\n* cool commit 0 trunk push 0 4m34s Feb 23, 2021\n* cool commit 1 trunk push 1 4m34s Feb 23, 2021\n* cool commit 2 trunk push 2 4m34s Feb 23, 2021\n* cool commit 3 trunk push 3 4m34s Feb 23, 2021\n* cool commit 4 trunk push 4 4m34s Feb 23, 2021\n* cool commit 5 trunk push 5 4m34s Feb 23, 2021\n* cool commit 6 trunk push 6 4m34s Feb 23, 2021\n* cool commit 7 trunk push 7 4m34s Feb 23, 2021\n* cool commit 8 trunk push 8 4m34s Feb 23, 2021\n* cool commit 9 trunk push 9 4m34s Feb 23, 2021\n* cool commit 10 trunk push 10 4m34s Feb 23, 2021\n* cool commit 11 trunk push 11 4m34s Feb 23, 2021\n* cool commit 12 trunk push 12 4m34s Feb 23, 2021\n* cool commit 13 trunk push 13 4m34s Feb 23, 2021\n* cool commit 14 trunk push 14 4m34s Feb 23, 2021\n* cool commit 15 trunk push 15 4m34s Feb 23, 2021\n* cool commit 16 trunk push 16 4m34s Feb 23, 2021\n* cool commit 17 trunk push 17 4m34s Feb 23, 2021\n* cool commit 18 trunk push 18 4m34s Feb 23, 2021\n* cool commit 19 trunk push 19 4m34s Feb 23, 2021\n* cool commit 20 trunk push 20 4m34s Feb 23, 2021\n* cool commit 21 trunk push 21 4m34s Feb 23, 2021\n* cool commit 22 trunk push 22 4m34s Feb 23, 2021\n* cool commit 23 trunk push 23 4m34s Feb 23, 2021\n* cool commit 24 trunk push 24 4m34s Feb 23, 2021\n* cool commit 25 trunk push 25 4m34s Feb 23, 2021\n* cool commit 26 trunk push 26 4m34s Feb 23, 2021\n* cool commit 27 trunk push 27 4m34s Feb 23, 2021\n* cool commit 28 trunk push 28 4m34s Feb 23, 2021\n* cool commit 29 trunk push 29 4m34s Feb 23, 2021\n* cool commit 30 trunk push 30 4m34s Feb 23, 2021\n* cool commit 31 trunk push 31 4m34s Feb 23, 2021\n* cool commit 32 trunk push 32 4m34s Feb 23, 2021\n* cool commit 33 trunk push 33 4m34s Feb 23, 2021\n* cool commit 34 trunk push 34 4m34s Feb 23, 2021\n* cool commit 35 trunk push 35 4m34s Feb 23, 2021\n* cool commit 36 trunk push 36 4m34s Feb 23, 2021\n* cool commit 37 trunk push 37 4m34s Feb 23, 2021\n* cool commit 38 trunk push 38 4m34s Feb 23, 2021\n* cool commit 39 trunk push 39 4m34s Feb 23, 2021\n* cool commit 40 trunk push 40 4m34s Feb 23, 2021\n* cool commit 41 trunk push 41 4m34s Feb 23, 2021\n* cool commit 42 trunk push 42 4m34s Feb 23, 2021\n* cool commit 43 trunk push 43 4m34s Feb 23, 2021\n* cool commit 44 trunk push 44 4m34s Feb 23, 2021\n* cool commit 45 trunk push 45 4m34s Feb 23, 2021\n* cool commit 46 trunk push 46 4m34s Feb 23, 2021\n* cool commit 47 trunk push 47 4m34s Feb 23, 2021\n* cool commit 48 trunk push 48 4m34s Feb 23, 2021\n* cool commit 49 trunk push 49 4m34s Feb 23, 2021\n* cool commit 50 trunk push 50 4m34s Feb 23, 2021\n* cool commit 51 trunk push 51 4m34s Feb 23, 2021\n* cool commit 52 trunk push 52 4m34s Feb 23, 2021\n* cool commit 53 trunk push 53 4m34s Feb 23, 2021\n* cool commit 54 trunk push 54 4m34s Feb 23, 2021\n* cool commit 55 trunk push 55 4m34s Feb 23, 2021\n* cool commit 56 trunk push 56 4m34s Feb 23, 2021\n* cool commit 57 trunk push 57 4m34s Feb 23, 2021\n* cool commit 58 trunk push 58 4m34s Feb 23, 2021\n* cool commit 59 trunk push 59 4m34s Feb 23, 2021\n* cool commit 60 trunk push 60 4m34s Feb 23, 2021\n* cool commit 61 trunk push 61 4m34s Feb 23, 2021\n* cool commit 62 trunk push 62 4m34s Feb 23, 2021\n* cool commit 63 trunk push 63 4m34s Feb 23, 2021\n* cool commit 64 trunk push 64 4m34s Feb 23, 2021\n* cool commit 65 trunk push 65 4m34s Feb 23, 2021\n* cool commit 66 trunk push 66 4m34s Feb 23, 2021\n* cool commit 67 trunk push 67 4m34s Feb 23, 2021\n* cool commit 68 trunk push 68 4m34s Feb 23, 2021\n* cool commit 69 trunk push 69 4m34s Feb 23, 2021\n* cool commit 70 trunk push 70 4m34s Feb 23, 2021\n* cool commit 71 trunk push 71 4m34s Feb 23, 2021\n* cool commit 72 trunk push 72 4m34s Feb 23, 2021\n* cool commit 73 trunk push 73 4m34s Feb 23, 2021\n* cool commit 74 trunk push 74 4m34s Feb 23, 2021\n* cool commit 75 trunk push 75 4m34s Feb 23, 2021\n* cool commit 76 trunk push 76 4m34s Feb 23, 2021\n* cool commit 77 trunk push 77 4m34s Feb 23, 2021\n* cool commit 78 trunk push 78 4m34s Feb 23, 2021\n* cool commit 79 trunk push 79 4m34s Feb 23, 2021\n* cool commit 80 trunk push 80 4m34s Feb 23, 2021\n* cool commit 81 trunk push 81 4m34s Feb 23, 2021\n* cool commit 82 trunk push 82 4m34s Feb 23, 2021\n* cool commit 83 trunk push 83 4m34s Feb 23, 2021\n* cool commit 84 trunk push 84 4m34s Feb 23, 2021\n* cool commit 85 trunk push 85 4m34s Feb 23, 2021\n* cool commit 86 trunk push 86 4m34s Feb 23, 2021\n* cool commit 87 trunk push 87 4m34s Feb 23, 2021\n* cool commit 88 trunk push 88 4m34s Feb 23, 2021\n* cool commit 89 trunk push 89 4m34s Feb 23, 2021\n* cool commit 90 trunk push 90 4m34s Feb 23, 2021\n* cool commit 91 trunk push 91 4m34s Feb 23, 2021\n* cool commit 92 trunk push 92 4m34s Feb 23, 2021\n* cool commit 93 trunk push 93 4m34s Feb 23, 2021\n* cool commit 94 trunk push 94 4m34s Feb 23, 2021\n* cool commit 95 trunk push 95 4m34s Feb 23, 2021\n* cool commit 96 trunk push 96 4m34s Feb 23, 2021\n* cool commit 97 trunk push 97 4m34s Feb 23, 2021\n* cool commit 98 trunk push 98 4m34s Feb 23, 2021\n* cool commit 99 trunk push 99 4m34s Feb 23, 2021\n* cool commit 100 trunk push 100 4m34s Feb 23, 2021\n\nFor details on a run, try: gh run view \n" diff --git a/pkg/cmd/run/shared/shared.go b/pkg/cmd/run/shared/shared.go index fc5bbc7bf..37ab38f3a 100644 --- a/pkg/cmd/run/shared/shared.go +++ b/pkg/cmd/run/shared/shared.go @@ -304,13 +304,13 @@ func Symbol(cs *iostreams.ColorScheme, status Status, conclusion Conclusion) (st case Success: return cs.SuccessIconWithColor(noColor), cs.Green case Skipped, Cancelled, Neutral: - return cs.SuccessIconWithColor(noColor), cs.Gray + return "-", cs.Gray default: return cs.FailureIconWithColor(noColor), cs.Red } } - return "-", cs.Yellow + return "*", cs.Yellow } func PullRequestForRun(client *api.Client, repo ghrepo.Interface, run Run) (int, error) { diff --git a/pkg/cmd/run/watch/watch_test.go b/pkg/cmd/run/watch/watch_test.go index d5384af91..a96f826f4 100644 --- a/pkg/cmd/run/watch/watch_test.go +++ b/pkg/cmd/run/watch/watch_test.go @@ -236,7 +236,7 @@ func TestWatchRun(t *testing.T) { askStubs: func(as *prompt.AskStubber) { as.StubOne(1) }, - wantOut: "\x1b[2J\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n- trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n✓ trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n\n✓ Run more runs (2) completed with 'success'\n", + wantOut: "\x1b[2J\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n* trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n✓ trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n\n✓ Run more runs (2) completed with 'success'\n", }, { name: "interval respected, windows", @@ -249,7 +249,7 @@ func TestWatchRun(t *testing.T) { askStubs: func(as *prompt.AskStubber) { as.StubOne(1) }, - wantOut: "\x1b[2J\x1b[2JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n- trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n\x1b[2JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n✓ trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n", + wantOut: "\x1b[2J\x1b[2JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n* trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n\x1b[2JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n✓ trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n", }, { name: "exit status respected", @@ -264,7 +264,7 @@ func TestWatchRun(t *testing.T) { askStubs: func(as *prompt.AskStubber) { as.StubOne(1) }, - wantOut: "\x1b[2J\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n- trunk more runs · 2\nTriggered via push about 59 minutes ago\n\n\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\nX trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\nX sad job in 4m34s (ID 20)\n ✓ barf the quux\n X quux the barf\n\nANNOTATIONS\nX the job is sad\nsad job: blaze.py#420\n\n\nX Run more runs (2) completed with 'failure'\n", + wantOut: "\x1b[2J\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n* trunk more runs · 2\nTriggered via push about 59 minutes ago\n\n\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\nX trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\nX sad job in 4m34s (ID 20)\n ✓ barf the quux\n X quux the barf\n\nANNOTATIONS\nX the job is sad\nsad job: blaze.py#420\n\n\nX Run more runs (2) completed with 'failure'\n", wantErr: true, errMsg: "SilentError", }, @@ -280,7 +280,7 @@ func TestWatchRun(t *testing.T) { askStubs: func(as *prompt.AskStubber) { as.StubOne(1) }, - wantOut: "\x1b[2J\x1b[2JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n- trunk more runs · 2\nTriggered via push about 59 minutes ago\n\n\x1b[2JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\nX trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\nX sad job in 4m34s (ID 20)\n ✓ barf the quux\n X quux the barf\n\nANNOTATIONS\nX the job is sad\nsad job: blaze.py#420\n\n", + wantOut: "\x1b[2J\x1b[2JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n* trunk more runs · 2\nTriggered via push about 59 minutes ago\n\n\x1b[2JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\nX trunk more runs · 2\nTriggered via push about 59 minutes ago\n\nJOBS\nX sad job in 4m34s (ID 20)\n ✓ barf the quux\n X quux the barf\n\nANNOTATIONS\nX the job is sad\nsad job: blaze.py#420\n\n", wantErr: true, errMsg: "SilentError", }, diff --git a/pkg/cmd/workflow/view/view_test.go b/pkg/cmd/workflow/view/view_test.go index 44f92310a..72eb86682 100644 --- a/pkg/cmd/workflow/view/view_test.go +++ b/pkg/cmd/workflow/view/view_test.go @@ -177,9 +177,9 @@ func TestViewRun(t *testing.T) { Total runs 10 Recent runs X cool commit timed out trunk push 1 - - cool commit in progress trunk push 2 + * cool commit in progress trunk push 2 ✓ cool commit successful trunk push 3 - ✓ cool commit cancelled trunk push 4 + - cool commit cancelled trunk push 4 To see more runs for this workflow, try: gh run list --workflow flow.yml To see the YAML for this workflow, try: gh workflow view flow.yml --yaml