984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
|
((and newstate newstatus)
(sqlite3:execute db "UPDATE tests SET state=?,status=? WHERE id=?;" newstate newstatus test-id))
(else
(if newstate (sqlite3:execute db "UPDATE tests SET state=? WHERE id=?;" newstate test-id))
(if newstatus (sqlite3:execute db "UPDATE tests SET status=? WHERE id=?;" newstatus test-id))
(if newcomment (sqlite3:execute db "UPDATE tests SET comment=? WHERE id=?;" newcomment test-id))))
(db:process-triggers test-id newstate newstatus)
#t) ;; retrun something to keep the remote calls happy
;; Never used
;; (define (db:test-set-state-status-by-run-id-testname db run-id test-name item-path status state)
;; (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))
;; NEW BEHAVIOR: Count tests running in only one run!
|
|
|
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
|
((and newstate newstatus)
(sqlite3:execute db "UPDATE tests SET state=?,status=? WHERE id=?;" newstate newstatus test-id))
(else
(if newstate (sqlite3:execute db "UPDATE tests SET state=? WHERE id=?;" newstate test-id))
(if newstatus (sqlite3:execute db "UPDATE tests SET status=? WHERE id=?;" newstatus test-id))
(if newcomment (sqlite3:execute db "UPDATE tests SET comment=? WHERE id=?;" newcomment test-id))))
(db:process-triggers test-id newstate newstatus)
#t)) ;; retrun something to keep the remote calls happy
;; Never used
;; (define (db:test-set-state-status-by-run-id-testname db run-id test-name item-path status state)
;; (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))
;; NEW BEHAVIOR: Count tests running in only one run!
|
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
|
;;======================================================================
(define (db:step-get-time-as-string vec)
(seconds->time-string (db:step-get-event_time vec)))
(define (db:get-steps-for-test dbstruct run-id test-id)
(let ((res '()))
(sqlite3:for-each-row
(lambda (id test-id stepname state status event-time logfile)
(set! res (cons (vector id test-id stepname state status event-time (if (string? logfile) logfile "")) res)))
(db:get-db dbstruct run-id)
"SELECT id,test_id,stepname,state,status,event_time,logfile_id FROM test_steps WHERE test_id=? ORDER BY id ASC;" ;; event_time DESC,id ASC;
test-id)
(reverse res)))
(define (db:get-steps-table dbstruct run-id test-id)
(let ((steps (db:get-steps-for-test dbstruct run-id test-id)))
;; ;; get a pretty table to summarize steps
;; ;;
;; (define (db:get-steps-table-list dbstruct run-id test-id #!key (work-area #f))
;; (let ((steps (db:get-steps-for-test dbstruct run-id test-id)))
;; ;; organise the steps for better readability
;; (let ((res (make-hash-table)))
;; (for-each
|
<
>
|
|
|
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
|
;;======================================================================
(define (db:step-get-time-as-string vec)
(seconds->time-string (db:step-get-event_time vec)))
(define (db:get-steps-for-test dbstruct run-id test-id)
(let ((res '()))
(sqlite3:for-each-row
(lambda (id test-id stepname state status event-time logfile)
(set! res (cons (vector id test-id stepname state status event-time (if (string? logfile) logfile "")) res)))
(db:get-db dbstruct run-id)
"SELECT id,test_id,stepname,state,status,event_time,logfile_id FROM test_steps WHERE test_id=? ORDER BY id ASC;" ;; event_time DESC,id ASC;
test-id)
(reverse res)))
;;(define (db:get-steps-table dbstruct run-id test-id)
;; (let ((steps (db:get-steps-for-test dbstruct run-id test-id)))
;; ;; get a pretty table to summarize steps
;; ;;
;; (define (db:get-steps-table-list dbstruct run-id test-id #!key (work-area #f))
;; (let ((steps (db:get-steps-for-test dbstruct run-id test-id)))
;; ;; organise the steps for better readability
;; (let ((res (make-hash-table)))
;; (for-each
|