Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -734,27 +734,10 @@ ;;====================================================================== ;; T E S T S ;;====================================================================== -;; REFACTOR THIS ONE, IT DOESNT FOLLOW CURRENT PATTERNS -(define (db:tests-register-test run-id test-name item-path) - (debug:print-info 11 "db:tests-register-test START run-id=" run-id ", test-name=" test-name ", item-path=\"" item-path "\"") - (let ((item-paths (if (equal? item-path "") - (list item-path) - (list item-path "")))) - (for-each - (lambda (pth) - (cdb:tests-register-test *runremote* run-id test-name pth)) - ;; (sqlite3:execute db "INSERT OR IGNORE INTO tests (run_id,testname,event_time,item_path,state,status) VALUES (?,?,strftime('%s','now'),?,'NOT_STARTED','n/a');" - ;; run-id - ;; test-name - ;; pth)) - item-paths) - (debug:print-info 11 "db:tests-register-test END run-id=" run-id ", test-name=" test-name ", item-path=\"" item-path "\"") - #f)) - ;; states and statuses are lists, turn them into ("PASS","FAIL"...) and use NOT IN ;; i.e. these lists define what to NOT show. ;; states and statuses are required to be lists, empty is ok ;; not-in #t = above behaviour, #f = must match (define (db:get-tests-for-run db run-id testpatt states statuses Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -409,23 +409,26 @@ (if (not (null? tal)) (loop (car tal)(cdr tal) reruns))) ;; Registery has been started for this test but has not yet completed ;; this should be rare, the case where there are only a couple of tests and the db is slow ;; delay a short while and continue - ((eq? (hash-table-ref/default test-registery (runs:make-full-test-name test-name item-path) #f) 'start) - (thread-sleep! 0.01) - (loop (car newtal)(cdr newtal) reruns)) + ;; ((eq? (hash-table-ref/default test-registery (runs:make-full-test-name test-name item-path) #f) 'start) + ;; (thread-sleep! 0.01) + ;; (loop (car newtal)(cdr newtal) reruns)) ((not (hash-table-ref/default test-registery (runs:make-full-test-name test-name item-path) #f)) (debug:print-info 4 "Pre-registering test " test-name "/" item-path " to create placeholder" ) ;; NEED TO THREADIFY THIS (let ((th (make-thread (lambda () (mutex-lock! registery-mutex) (hash-table-set! test-registery (runs:make-full-test-name test-name item-path) 'start) (mutex-unlock! registery-mutex) - (cdb:tests-register-test *runremote* run-id test-name item-path) + ;; If haven't done it before register a top level test if this is an itemized test + (if (not (eq? (hash-table-ref/default test-registery (runs:make-full-test-name test-name "") #f) 'done)) + (cdb:tests-register-test *runremote* run-id test-name "")) + (cdb:tests-register-test *runremote* run-id test-name item-path) (mutex-lock! registery-mutex) - (hash-table-set! test-registery (runs:make-full-test-name test-name item-path) 'done) + (hash-table-set! test-registery (runs:make-full-test-name test-name item-path) 'done) (mutex-unlock! registery-mutex)) (conc test-name "/" item-path)))) (thread-start! th)) (thread-sleep! *global-delta*) (runs:shrink-can-run-more-tests-delay) ;; DELAY TWEAKER (still needed?)