@@ -1048,6 +1048,64 @@ func TestViewRun(t *testing.T) {
10481048 },
10491049 wantOut : quuxTheBarfLogOutput ,
10501050 },
1051+ {
1052+ name : "exit status respected with log-failed, failed run" ,
1053+ opts : & ViewOptions {
1054+ RunID : "1234" ,
1055+ LogFailed : true ,
1056+ ExitStatus : true ,
1057+ },
1058+ httpStubs : func (reg * httpmock.Registry ) {
1059+ reg .Register (
1060+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/runs/1234" ),
1061+ httpmock .JSONResponse (shared .FailedRun ))
1062+ reg .Register (
1063+ httpmock .REST ("GET" , "runs/1234/jobs" ),
1064+ httpmock .JSONResponse (shared.JobsPayload {
1065+ Jobs : []shared.Job {
1066+ shared .SuccessfulJob ,
1067+ shared .FailedJob ,
1068+ },
1069+ }))
1070+ reg .Register (
1071+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/runs/1234/logs" ),
1072+ httpmock .BinaryResponse (zipArchive ))
1073+ reg .Register (
1074+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/workflows/123" ),
1075+ httpmock .JSONResponse (shared .TestWorkflow ))
1076+ },
1077+ wantOut : quuxTheBarfLogOutput ,
1078+ wantErr : true ,
1079+ },
1080+ {
1081+ name : "exit status respected with log, failed run" ,
1082+ opts : & ViewOptions {
1083+ RunID : "1234" ,
1084+ Log : true ,
1085+ ExitStatus : true ,
1086+ },
1087+ httpStubs : func (reg * httpmock.Registry ) {
1088+ reg .Register (
1089+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/runs/1234" ),
1090+ httpmock .JSONResponse (shared .FailedRun ))
1091+ reg .Register (
1092+ httpmock .REST ("GET" , "runs/1234/jobs" ),
1093+ httpmock .JSONResponse (shared.JobsPayload {
1094+ Jobs : []shared.Job {
1095+ shared .SuccessfulJob ,
1096+ shared .FailedJob ,
1097+ },
1098+ }))
1099+ reg .Register (
1100+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/runs/1234/logs" ),
1101+ httpmock .BinaryResponse (zipArchive ))
1102+ reg .Register (
1103+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/workflows/123" ),
1104+ httpmock .JSONResponse (shared .TestWorkflow ))
1105+ },
1106+ wantOut : expectedRunLogOutput ,
1107+ wantErr : true ,
1108+ },
10511109 {
10521110 name : "interactive with log, with no step logs available (#10551)" ,
10531111 tty : true ,
0 commit comments