@@ -773,19 +773,21 @@ resh)) ;; tests:genrate dashboard body ;; -(define (tests:dashboard-body page pg-size keys numkeys total-runs linktree area-name get-prev-links get-next-links flag) +(define (tests:dashboard-body page pg-size keys numkeys total-runs linktree area-name get-prev-links get-next-links flag run-patt target-patt) (let* ((start (* page pg-size)) - (runsdat (rmt:get-runs "%" pg-size start (map (lambda (x)(list x "%")) keys))) + ;(runsdat (rmt:get-runs "%" pg-size start (map (lambda (x)(list x "%")) keys))) + (runsdat (rmt:get-runs-by-patt keys run-patt target-patt start pg-size #f 0)) + ; db:get-runs-by-patt keys runnamepatt targpatt offset limit fields last-update (header (vector-ref runsdat 0)) (runs (vector-ref runsdat 1)) - (ctr 0) - (test-runs-hash (tests:get-rest-data runs header numkeys)) - (test-list (hash-table-keys test-runs-hash)) - ) + (ctr 0) + (test-runs-hash (tests:get-rest-data runs header numkeys)) + (test-list (hash-table-keys test-runs-hash))) + (print header ) (s:html tests:css-jscript-block (tests:css-jscript-block-cond flag) (s:title "Summary for " area-name) (s:body 'onload "addEvents();" (get-prev-links page linktree) (get-next-links page linktree total-runs) @@ -805,11 +807,11 @@ res)) keys) (s:tr (s:th "Run Name") (map (lambda (run) - (s:th (vector-ref run 3))) + (s:th (db:get-value-by-header run header "runname"))) runs)) (map (lambda (test-name) (let* ((item-hash (hash-table-ref/default test-runs-hash test-name #f)) (item-keys (sort (hash-table-keys item-hash) string<=?))) @@ -836,16 +838,29 @@ ;; (tests:create-html-tree "test-index.html") ;; (define (tests:create-html-tree outf) (let* ((lockfile (conc outf ".lock")) - (runs-to-process '()) + (runs-to-process '()) (linktree (common:get-linktree)) - (area-name (common:get-testsuite-name)) - (keys (rmt:get-keys)) - (numkeys (length keys)) - (total-runs (rmt:get-num-runs "%")) + (area-name (common:get-testsuite-name)) + (keys (rmt:get-keys)) + (numkeys (length keys)) + (run-patt (if (args:get-arg "-run-patt") + (args:get-arg "-run-patt") + "%")) + (target (if (args:get-arg "-target-patt") + (args:get-arg "-target-patt") + "%")) + (targlist (string-split target "/")) + (numtarg (length targlist)) + (targtweaked (if (> numkeys numtarg) + (append targlist (make-list (- numkeys numtarg) "%")) + targlist)) + (target-patt (string-join targtweaked "/")) + ;(total-runs (rmt:get-num-runs "%")) ;;this needs to be changed to filter by target + (total-runs (rmt:get-runs-cnt-by-patt run-patt target-patt keys )) (pg-size 10)) (if (common:simple-file-lock lockfile) (begin ;(print total-runs) (let loop ((page 0)) @@ -858,14 +873,13 @@ (get-next-links (lambda (page linktree total-runs) (let* ((link (if (> total-runs (+ 10 (* page pg-size))) (s:a "next>>" 'href (conc linktree "/page" (+ page 1) ".html")) (s:a "" 'href (conc linktree "/page" page ".html"))))) link))) ) - ;(print (tests:dashboard-body page pg-size keys numkeys total-runs linktree area-name)) - (s:output-new - oup - (tests:dashboard-body page pg-size keys numkeys total-runs linktree area-name get-prev-links get-next-links #f)) + (s:output-new + oup + (tests:dashboard-body page pg-size keys numkeys total-runs linktree area-name get-prev-links get-next-links #f run-patt target-patt)) ;; update this function (close-output-port oup) ; (set! page (+ 1 page)) (if (> total-runs (* (+ 1 page) pg-size)) (loop (+ 1 page))))) (common:simple-file-release-lock lockfile)) @@ -919,12 +933,14 @@ ;(define (tests:create-html-tree o) (let* ( ;(page "1") (linktree (common:get-linktree)) (area-name (common:get-testsuite-name)) - (keys (rmt:get-keys)) - (numkeys (length keys)) + (keys (rmt:get-keys)) + (numkeys (length keys)) + (targtweaked (make-list numkeys "%")) + (target-patt (string-join targtweaked "/")) (total-runs (rmt:get-num-runs "%")) (pg-size 10) (pg (if (equal? page #f) 0 (- (string->number page) 1))) @@ -940,13 +956,12 @@ (let* ((link (if (> total-runs (+ 10 (* pg pg-size))) (s:a "next>> " 'href (conc "dashboard?page=" (+ pg 2) )) (s:a "" 'href (conc "dashboard?page=" pg ))))) link))) - (html-body (tests:dashboard-body pg pg-size keys numkeys total-runs linktree area-name get-prev-links get-next-links #t))) - ;(print (tests:dashboard-body page pg-size keys numkeys total-runs linktree area-name)) -html-body)) + (html-body (tests:dashboard-body pg pg-size keys numkeys total-runs linktree area-name get-prev-links get-next-links #t "%" target-patt))) ;; update tis function + html-body)) (define (tests:create-html-summary outf) (let* ((lockfile (conc outf ".lock")) (linktree (common:get-linktree)) (keys (rmt:get-keys)) @@ -1126,12 +1141,14 @@ (s:td 'class "test" target) (let* ((runs (hash-table-ref/default target-hash target #f)) (rest-row (map (lambda (run) (if (equal? run "") (s:td run) - (s:td - (s:a 'href (conc linktree "/" target "/" run "/run.html") run)))) + (if (file-exists?(conc linktree "/" target "/" run )) + (begin + (s:td + (s:a 'href (conc linktree "/" target "/" run "/run.html") run)))))) (reverse runs)))) rest-row))) targets))) tbl))))) (close-output-port oup)))