Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
(current-subprocess-timeout-seconds 90)
(current-monitoring-interval-seconds 60)
(number-of-cpus 18)
(putenv "PLT_DISPLAY_BACKING_SCALE" "1.0")

(define (string->number* s)
(with-handlers ([exn:fail? (lambda (x) #f)])
Expand Down
1 change: 1 addition & 0 deletions main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"cache.rkt"
"path-utils.rkt")

(putenv "PLT_DISPLAY_BACKING_SCALE" "1.0")
(init-revisions!)
(define cur-rev (newest-revision))
(define prev-rev (second-newest-revision))
Expand Down
15 changes: 10 additions & 5 deletions render.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,8 @@ in.}
(define r (and (file-exists? pth) (read-cache* pth)))
(define log-pth (rev-log-path rev))
(define log (and r (file-exists? log-pth) (read-cache* log-pth)))
(list rev (and r (rendering? r) r) log))
(define analyzed? (file-exists? (build-path (revision-dir rev) "analyzed")))
(list rev (and r (rendering? r) r) log analyzed?))
page-revs))
(define history-url (format "/file-history/~a" file-path-str))
(define title (format "DrDr / File History / ~a" file-path-str))
Expand All @@ -1219,23 +1220,27 @@ in.}
(tbody
,@(map
(match-lambda
[(list rev #f _)
[(list rev #f _ analyzed?)
(define name (number->string rev))
(define url (format "/~a/" rev))
`(tr ([class "dir"]
[onclick ,(format "document.location = ~S" url)])
(td (a ([href ,url]) ,name))
(td "Missing")
(td ,(if analyzed? "Missing" "Pending"))
(td "")
(td "")
(td ""))]
[(list rev (struct rendering (_ _ dur timeout unclean stderr _ changed)) log)
[(list rev (struct rendering (_ _ dur timeout unclean stderr _ changed)) log _)
(define name (number->string rev))
(define url (format "/~a/~a" rev file-path-str))
(define has-unclean? (not (lc-zero? unclean)))
(define has-stderr? (not (lc-zero? stderr)))
(define status-text
(cond
[(not (lc-zero? timeout)) "Timeout"]
[(not (lc-zero? unclean)) "Failure"]
[(and has-unclean? has-stderr?) "Failure + Stderr"]
[has-unclean? "Failure"]
[has-stderr? "Stderr"]
[else "Success"]))
(define exit-code-text
(cond
Expand Down
1 change: 0 additions & 1 deletion status-analyze.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
[(? stderr?)
(cons (cons s trl) rrl)])]))

'
(module+ test
(require rackunit)
(check-equal?
Expand Down
33 changes: 32 additions & 1 deletion test-rendering.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
(list "raco" "test" test-file-path)
(list (make-stdout #"running tests...\n") (make-stderr #"FAILURE: test failed\n"))
1)]
[(stderr)
(make-exit start-ms
end-ms
(list "raco" "test" test-file-path)
(list (make-stdout #"running tests...\n") (make-stderr #"warning: something\n"))
0)]
[else
(make-exit start-ms
end-ms
Expand Down Expand Up @@ -205,9 +211,19 @@
(format "http://localhost/file-history/~a" test-file-path)))
(define body (response-body resp))
(check-regexp-match #rx"Success" body)
(check-regexp-match #rx"Failure" body)
(check-regexp-match #rx"Failure \\+ Stderr" body)
(check-regexp-match #rx"Timeout" body))))

(test-case "file history page shows stderr status for exit-0 with stderr"
(call-with-test-data (lambda ()
(parameterize ([cache/file-mode 'cache])
(make-test-revision 104 #:status 'stderr #:author "carol"))
(define resp
(dispatch-request
(format "http://localhost/file-history/~a" test-file-path)))
(define body (response-body resp))
(check-regexp-match #rx"Stderr" body))))

(test-case "file history page shows exit codes"
(call-with-test-data (lambda ()
(define resp
Expand All @@ -234,6 +250,21 @@
(check-regexp-match #rx"99" body)
(check-regexp-match #rx"Missing" body))))

(test-case "file history page shows pending for incomplete revisions"
(call-with-test-data (lambda ()
;; Create a revision directory with no "analyzed" marker
(make-directory* (revision-log-dir 104))
(make-directory* (revision-analyze-dir 104))
(define resp
(dispatch-request
(format "http://localhost/file-history/~a" test-file-path)))
(define body (response-body resp))
(check-regexp-match #rx"104" body)
(check-regexp-match #rx"Pending" body)
;; Should NOT show "Missing" for rev 104
;; (Missing should only appear for completed rev 99 if present)
)))

(test-case "file result page links to file history"
(call-with-test-data (lambda ()
(define resp
Expand Down