@@ -128,11 +128,11 @@ ;; if found then return that matching test record (debug:print 4 "selstr: " selstr ", qrystr: " qrystr ", keyvals: " keyvals ", previous run ids found: " prev-run-ids) (if (null? prev-run-ids) #f (let loop ((hed (car prev-run-ids)) (tal (cdr prev-run-ids))) - (let ((results (db-get-tests-for-run db hed test-name item-path))) + (let ((results (db-get-tests-for-run db hed test-name item-path #f #f))) (debug:print 4 "Got tests for run-id " run-id ", test-name " test-name ", item-path " item-path ": " results) (if (and (null? results) (not (null? tal))) (loop (car tal)(cdr tal)) (if (null? results) #f @@ -166,11 +166,11 @@ (debug:print 4 "selstr: " selstr ", qrystr: " qrystr ", keyvals: " keyvals ", previous run ids found: " prev-run-ids) (if (null? prev-run-ids) '() ;; no previous runs? return null (let loop ((hed (car prev-run-ids)) (tal (cdr prev-run-ids))) - (let ((results (db-get-tests-for-run db hed test-name item-path))) + (let ((results (db-get-tests-for-run db hed test-name item-path #f #f))) (debug:print 4 "Got tests for run-id " run-id ", test-name " test-name ", item-path " item-path " results: " (intersperse results "\n")) ;; Keep only the youngest of any test/item combination (for-each (lambda (testdat) @@ -750,11 +750,11 @@ (lambda (run) (let ((runkey (string-intersperse (map (lambda (k) (db:get-value-by-header run header (vector-ref k 0))) keys) "/")) (dirs-to-remove (make-hash-table))) (let* ((run-id (db:get-value-by-header run header "id") ) - (tests (db-get-tests-for-run db (db:get-value-by-header run header "id") testpatt itempatt)) + (tests (db-get-tests-for-run db (db:get-value-by-header run header "id") testpatt itempatt #f #f)) (lasttpath "/does/not/exist/I/hope")) (if (not (null? tests)) (begin (debug:print 1 "Removing tests for run: " runkey " " (db:get-value-by-header run header "runname")) @@ -801,11 +801,11 @@ (hash-table-delete! dirs-to-remove dir-to-remove)) (debug:print 2 "Skipping removal of " dir-to-remove " for now as it still has references in the database"))))) (sort (hash-table-keys dirs-to-remove) (lambda (a b)(> (string-length a)(string-length b))))) ;; remove the run if zero tests remain - (let ((remtests (db-get-tests-for-run db (db:get-value-by-header run header "id") #f #f))) + (let ((remtests (db-get-tests-for-run db (db:get-value-by-header run header "id") #f #f #f #f))) (if (null? remtests) ;; no more tests remaining (let* ((dparts (string-split lasttpath "/")) (runpath (conc "/" (string-intersperse (take dparts (- (length dparts) 1)) "/")))) @@ -887,11 +887,11 @@ ;; This could probably be refactored into one complex query ... (define (runs:rollup-run db keys) (let* ((new-run-id (register-run db keys)) (prev-tests (test:get-matching-previous-test-run-records db new-run-id "%" "%")) - (curr-tests (db-get-tests-for-run db new-run-id "%" "%")) + (curr-tests (db-get-tests-for-run db new-run-id "%" "%" #f #f)) (curr-tests-hash (make-hash-table))) ;; index the already saved tests by testname and itempath in curr-tests-hash (for-each (lambda (testdat) (let* ((testname (db:test-get-testname testdat)) @@ -914,11 +914,11 @@ (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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);") new-run-id (cddr (vector->list testdat))) - (set! new-testdat (car (db-get-tests-for-run db new-run-id testname item-path))) + (set! new-testdat (car (db-get-tests-for-run db new-run-id testname item-path #f #f))) (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