1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
|
(sqlite3:for-each-row
(lambda (count)
(set! res count)) ;; select * from tests where run_id=1 and uname = 'n/a' and item_path='';
(db:get-db dbstruct run-id)
"SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=? AND NOT (uname = 'n/a' AND item_path = '');" run-id)
res))
(define (db:get-count-tests-running-in-jobgroup dbstruct run-id jobgroup)
(if (not jobgroup)
0 ;;
(let ((res 0)
(testnames '()))
;; get the testnames
(sqlite3:for-each-row
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
|
(sqlite3:for-each-row
(lambda (count)
(set! res count)) ;; select * from tests where run_id=1 and uname = 'n/a' and item_path='';
(db:get-db dbstruct run-id)
"SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=? AND NOT (uname = 'n/a' AND item_path = '');" run-id)
res))
;; override states to count with list of strings.
;;
(define (db:get-count-tests-running-for-run-id -blah db run-id states)
(let ((res 0)
(sqrystr (conc "SELECT count(id) FROM tests WHERE state in ('"
(if states
(string-intersperse states "','")
"RUNNING','LAUNCHED','REMOTEHOSTSTART")
"') AND run_id=? AND NOT (uname = 'n/a' AND item_path = '');")))
(sqlite3:for-each-row
(lambda (count)
(set! res count)) ;; select * from tests where run_id=1 and uname = 'n/a' and item_path='';
db
sqrystr run-id)
;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=? AND NOT (uname = 'n/a' AND item_path = '');" run-id)
res))
(define (db:get-count-tests-running-in-jobgroup dbstruct run-id jobgroup)
(if (not jobgroup)
0 ;;
(let ((res 0)
(testnames '()))
;; get the testnames
(sqlite3:for-each-row
|