227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
(if currstatus (conc "status='" currstatus "' AND ") "")
" testname=? AND NOT (item_path='' AND testname in (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));")))
;;(print "QRY: " qry)
(sqlite3:execute db qry newstate newstatus testname testname)))
testnames))
;; "('" (string-intersperse tests "','") "')")
(define (db:get-count-tests-running db)
(let ((res 0))
(sqlite3:for-each-row
(lambda (count)
(set! res count))
db
"SELECT count(id) FROM tests WHERE state = 'RUNNING' OR state = 'LAUNCHED' OR state = 'REMOTEHOSTSTART';")
|
>
>
>
>
>
|
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
|
(if currstatus (conc "status='" currstatus "' AND ") "")
" testname=? AND NOT (item_path='' AND testname in (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));")))
;;(print "QRY: " qry)
(sqlite3:execute db qry newstate newstatus testname testname)))
testnames))
;; "('" (string-intersperse tests "','") "')")
(define (db:test-set-state-status-by-id db test-id newstate newstatus newcomment)
(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)))
(define (db:get-count-tests-running db)
(let ((res 0))
(sqlite3:for-each-row
(lambda (count)
(set! res count))
db
"SELECT count(id) FROM tests WHERE state = 'RUNNING' OR state = 'LAUNCHED' OR state = 'REMOTEHOSTSTART';")
|