Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -120,12 +120,13 @@ (loop (car tal)(cdr tal)) (car results))))))))) (define (test-set-status! db run-id test-name state status itemdat-or-path comment dat) - (let ((item-path (if (string? itemdat-or-path) itemdat-or-path (item-list->path itemdat-or-path))) - (otherdat (if dat dat (make-hash-table))) + (let ((real-status status) + (item-path (if (string? itemdat-or-path) itemdat-or-path (item-list->path itemdat-or-path))) + (otherdat (if dat dat (make-hash-table))) ;; before proceeding we must find out if the previous test (where all keys matched except runname) ;; was WAIVED if this test is FAIL (waived (if (equal? status "FAIL") (let ((prev-test (test:get-previous-test-run-records db run-id test-name item-path))) (if (and prev-test (not (null? prev-test))) ;; true if we found a previous test in this run series @@ -136,10 +137,12 @@ (equal? prev-state "WAIVED")) prev-comment ;; waived is either the comment or #f #f)) #f)) #f))) + + (if waived (set! real-status "WAIVED")) ;; update the primary record IF state AND status are defined (if (and state status) (sqlite3:execute db "UPDATE tests SET state=?,status=?,event_time=strftime('%s','now') WHERE run_id=? AND testname=? AND item_path=?;" state status run-id test-name item-path)) @@ -192,14 +195,15 @@ 'RUNNING' ELSE 'COMPLETED' END, status=CASE WHEN fail_count > 0 THEN 'FAIL' WHEN pass_count > 0 AND fail_count=0 THEN 'PASS' ELSE 'UNKNOWN' END WHERE run_id=? AND testname=? AND item_path='';" run-id test-name run-id test-name))) - (if (and (string? comment) - (string-match (regexp "\\S+") comment)) + (if (or (and (string? comment) + (string-match (regexp "\\S+") comment)) + waived) (sqlite3:execute db "UPDATE tests SET comment=? WHERE run_id=? AND testname=? AND item_path=?;" - (car comment) run-id test-name item-path)) + (if waived waived comment) run-id test-name item-path)) )) (define (test-set-log! db run-id test-name itemdat logf) (let ((item-path (item-list->path itemdat))) (sqlite3:execute db "UPDATE tests SET final_logf=? WHERE run_id=? AND testname=? AND item_path=?;"