@@ -127,10 +127,35 @@ logf run-id test-name item-path))) (define (test-set-toplog! db run-id test-name logf) (sqlite3:execute db "UPDATE tests SET final_logf=? WHERE run_id=? AND testname=? AND item_path='';" logf run-id test-name)) + +(define (tests:summarize-items db run-id test-name) + (obtain-dot-lock "final-results.html" 1 20 30) ;; retry every second for 20 seconds, call it dead after 30 seconds and steal the lock + (let ((oup (open-output-file "final-results.html"))) + (with-output-to-port + oup + (print "Summary: " test-name "") + (sqlite3:for-each-row + (lambda (id itempath state status run_duration logf comment) + (print "" + "" + "" + "" + "" + "") + "SELECT id,item_path,state,status,run_duration,final_logf,comment FROM tests WHERE run_id=? AND testname=? AND item_path != '';")) + (print "") + (close-output-port oup) + (release-dot-lock "final-results.html")) + + ;; ADD UPDATE TO FINAL LOG HERE + +)) + + ;; ;; TODO: Converge this with db:get-test-info ;; (define (runs:get-test-info db run-id test-name item-path) ;; (let ((res #f)) ;; (vector #f #f #f #f #f #f))) ;; (sqlite3:for-each-row
" itempath "" state "" status "" comment "