aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-11-07 15:20:10 +0100
committerLudovic Courtès <ludo@gnu.org>2018-11-07 15:28:05 +0100
commit0b40dca734468e8b12b3ff58e3e779679f17d38e (patch)
treefef58d821277c25cd367189540a256116519b3f5
parentc76edac15d5c729d9e5997eee1ae126ccd95f44f (diff)
downloadcuirass-0b40dca734468e8b12b3ff58e3e779679f17d38e.tar
cuirass-0b40dca734468e8b12b3ff58e3e779679f17d38e.tar.gz
templates: Mark failures on the evaluation page.
* src/cuirass/templates.scm (evaluation-badges): Use a special badge denoting failure when the sum of all jobs is zero.
-rw-r--r--src/cuirass/templates.scm29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index 27bb51f..8ef3275 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -136,15 +136,26 @@
(define (evaluation-badges evaluation)
(if (zero? (assq-ref evaluation #:in-progress))
- `((a (@ (href "/eval/" ,(assq-ref evaluation #:id) "?status=succeeded")
- (class "badge badge-success"))
- ,(assq-ref evaluation #:succeeded))
- (a (@ (href "/eval/" ,(assq-ref evaluation #:id) "?status=failed")
- (class "badge badge-danger"))
- ,(assq-ref evaluation #:failed))
- (a (@ (href "/eval/" ,(assq-ref evaluation #:id) "?status=pending")
- (class "badge badge-secondary"))
- ,(assq-ref evaluation #:scheduled)))
+ (let ((succeeded (assq-ref evaluation #:succeeded))
+ (failed (assq-ref evaluation #:failed))
+ (scheduled (assq-ref evaluation #:scheduled)))
+ ;; XXX: Since we don't have information in the database about whether
+ ;; an evaluation failed, assume that it failed when it produced zero
+ ;; build jobs.
+ (if (zero? (+ succeeded failed scheduled))
+ `((span (@ (class "oi oi-x text-danger")
+ (title "Failed")
+ (aria-hidden "true"))
+ ""))
+ `((a (@ (href "/eval/" ,(assq-ref evaluation #:id) "?status=succeeded")
+ (class "badge badge-success"))
+ ,succeeded)
+ (a (@ (href "/eval/" ,(assq-ref evaluation #:id) "?status=failed")
+ (class "badge badge-danger"))
+ ,failed)
+ (a (@ (href "/eval/" ,(assq-ref evaluation #:id) "?status=pending")
+ (class "badge badge-secondary"))
+ ,scheduled))))
'((em "In progress…"))))
(define (evaluation-info-table name evaluations id-min id-max)