diff --git a/config.rkt b/config.rkt index ba7b13c..582dceb 100644 --- a/config.rkt +++ b/config.rkt @@ -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)]) diff --git a/main.rkt b/main.rkt index be79a55..66ec52a 100644 --- a/main.rkt +++ b/main.rkt @@ -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)) diff --git a/render.rkt b/render.rkt index fcf0732..23f8da0 100644 --- a/render.rkt +++ b/render.rkt @@ -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)) @@ -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 diff --git a/status-analyze.rkt b/status-analyze.rkt index 107d1b3..c301c12 100644 --- a/status-analyze.rkt +++ b/status-analyze.rkt @@ -21,7 +21,6 @@ [(? stderr?) (cons (cons s trl) rrl)])])) -' (module+ test (require rackunit) (check-equal? diff --git a/test-rendering.rkt b/test-rendering.rkt index aa2ac6c..b2f9cb6 100644 --- a/test-rendering.rkt +++ b/test-rendering.rkt @@ -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 @@ -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 @@ -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