942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
|
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
|
-
-
-
+
+
+
-
-
+
+
+
|
(single-test (and (null? items) (equal? item-path "")))
(item-test (not (equal? item-path "")))
;; look through all the item-patts if defined, format is patt1,patt2,patt3 ... wildcard is %
(item-matches (if item-patts
(let ((res #f))
(for-each
(lambda (patt)
(if (string-match (glob->regexp
(string-translate patt "%" "*"))
item-path)
(if (string-search (glob->regexp
(string-translate patt "%" "*"))
item-path)
(set! res #t)))
(string-split item-patts ",")))
#t)))
(string-split item-patts ","))
res)
#t)))
(debug:print 3 "max-concurrent-jobs: " max-concurrent-jobs ", num-running: " num-running)
(if (and item-matches (runs:can-run-more-tests db))
(begin
(let loop2 ((ts (db:get-test-info db run-id test-name item-path)) ;; #f)
(ct 0))
(if (and (not ts)
(< ct 10))
|
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
|
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
|
-
-
+
+
|
(full-name (conc testname "/" item-path))
(prev-test-dat (hash-table-ref/default curr-tests-hash full-name #f))
(test-steps (db:get-steps-for-test db (db:test-get-id testdat)))
(new-test-record #f))
;; replace these with insert ... select
(apply sqlite3:execute
db
(conc "INSERT OR REPLACE INTO tests (run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment,first_err,first_warn) "
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);")
(conc "INSERT OR REPLACE INTO tests (run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment) "
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);")
new-run-id (cddr (vector->list testdat)))
(set! new-testdat (car (db-get-tests-for-run db new-run-id testname item-path '() '())))
(hash-table-set! curr-tests-hash full-name new-testdat) ;; this could be confusing, which record should go into the lookup table?
;; Now duplicate the test steps
(debug:print 4 "Copying records in test_steps from test_id=" (db:test-get-id testdat) " to " (db:test-get-id new-testdat))
(sqlite3:execute
db
|