Skip to content

Commit a17be75

Browse files
committed
Distinguish failure, stderr, and both in file history status column
1 parent f6f707b commit a17be75

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

render.rkt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1233,10 +1233,14 @@ in.}
12331233
[(list rev (struct rendering (_ _ dur timeout unclean stderr _ changed)) log _)
12341234
(define name (number->string rev))
12351235
(define url (format "/~a/~a" rev file-path-str))
1236+
(define has-unclean? (not (lc-zero? unclean)))
1237+
(define has-stderr? (not (lc-zero? stderr)))
12361238
(define status-text
12371239
(cond
12381240
[(not (lc-zero? timeout)) "Timeout"]
1239-
[(not (lc-zero? unclean)) "Failure"]
1241+
[(and has-unclean? has-stderr?) "Failure + Stderr"]
1242+
[has-unclean? "Failure"]
1243+
[has-stderr? "Stderr"]
12401244
[else "Success"]))
12411245
(define exit-code-text
12421246
(cond

test-rendering.rkt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
(list "raco" "test" test-file-path)
6666
(list (make-stdout #"running tests...\n") (make-stderr #"FAILURE: test failed\n"))
6767
1)]
68+
[(stderr)
69+
(make-exit start-ms
70+
end-ms
71+
(list "raco" "test" test-file-path)
72+
(list (make-stdout #"running tests...\n") (make-stderr #"warning: something\n"))
73+
0)]
6874
[else
6975
(make-exit start-ms
7076
end-ms
@@ -205,9 +211,19 @@
205211
(format "http://localhost/file-history/~a" test-file-path)))
206212
(define body (response-body resp))
207213
(check-regexp-match #rx"Success" body)
208-
(check-regexp-match #rx"Failure" body)
214+
(check-regexp-match #rx"Failure \\+ Stderr" body)
209215
(check-regexp-match #rx"Timeout" body))))
210216

217+
(test-case "file history page shows stderr status for exit-0 with stderr"
218+
(call-with-test-data (lambda ()
219+
(parameterize ([cache/file-mode 'cache])
220+
(make-test-revision 104 #:status 'stderr #:author "carol"))
221+
(define resp
222+
(dispatch-request
223+
(format "http://localhost/file-history/~a" test-file-path)))
224+
(define body (response-body resp))
225+
(check-regexp-match #rx"Stderr" body))))
226+
211227
(test-case "file history page shows exit codes"
212228
(call-with-test-data (lambda ()
213229
(define resp

0 commit comments

Comments
 (0)