Index: api.scm ================================================================== --- api.scm +++ api.scm @@ -88,10 +88,11 @@ (thread-sleep! 3) (if pid (process-signal pid signal/kill) (thread-start! th1)) '(#t "exit process started"))) + ((sdb-qry) (apply sdb:qry params)) ;; TESTMETA ((testmeta-get-record) (apply db:testmeta-get-record dbstruct params)) ((testmeta-add-record) (apply db:testmeta-add-record dbstruct params)) ((testmeta-update-field) (apply db:testmeta-update-field dbstruct params)) Index: client.scm ================================================================== --- client.scm +++ client.scm @@ -57,10 +57,16 @@ (if (not (setup-for-run)) (begin (debug:print 0 "ERROR: failed to find megatest.config, exiting") (exit)))) (push-directory *toppath*) ;; This is probably NOT needed + ;; clients get the sdb:qry proc created here + (if (not sdb:qry) + (begin + (set! sdb:qry (make-sdb:qry (conc *toppath* "/db/strings.db"))) ;; we open the normalization helpers here + (sdb:qry 'setup #f))) + (debug:print-info 11 "*transport-type* is " *transport-type* ", *runremote* is " *runremote*) (let* ((hostinfo (open-run-close tasks:get-best-server tasks:open-db))) (debug:print-info 11 "CLIENT SETUP, hostinfo=" hostinfo) (set! *transport-type* (if hostinfo (string->symbol (tasks:hostinfo-get-transport hostinfo)) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -163,15 +163,24 @@ (dbr:dbstruct-set-main! dbstruct db) db)))) ;; Make the dbstruct, setup up auxillary db's and call for main db at least once ;; -(define (db:setup) - (let ((dbstruct (make-dbr:dbstruct path: *toppath*))) +(define (db:setup #!key (local #f)) + (let ((dbstruct (make-dbr:dbstruct path: *toppath* local: local))) (db:get-db dbstruct #f) ;; force one call to main - (set! sdb:qry (make-sdb:qry (conc *toppath* "/db/strings.db"))) ;; we open the normalization helpers here - (set! *fdb* (filedb:open-db (conc *toppath* "/db/paths.db"))) + (if (not sdb:qry) + (begin + (set! sdb:qry (make-sdb:qry (conc *toppath* "/db/strings.db"))) ;; we open the normalization helpers here + (sdb:qry 'setup #f) + ;; Initialize with some known needed strings, NOTE: set this up to only execute on first db initialization + (for-each + (lambda (str) + (sdb:qry 'get-id str)) + (list "" "logs/final.log")))) + ;; (sdb:qry 'setdb ( + ;; (set! *fdb* (filedb:open-db (conc *toppath* "/db/paths.db"))) dbstruct)) ;; sync all touched runs to disk (define (db:sync-touched dbstruct) (for-each @@ -195,12 +204,12 @@ (let ((rundb (vector-ref runvec (dbr:dbstruct-field-name->num 'rundb)))) (if (sqlite3:database? rundb) (sqlite3:finalize! rundb) (debug:print 0 "WARNING: attempting to close databases but got " rundb " instead of a database")))) (hash-table-values (vector-ref dbstruct 1))) - (sdb:qry 'finalize! #f) - (filedb:finalize-db! *fdb*)) + (sdb:qry 'finalize! #f)) + ;; (filedb:finalize-db! *fdb*)) (define (open-inmem-db) (let* ((db (sqlite3:open-database ":memory:")) (handler (make-busy-timeout 3600))) (db:initialize-run-id-db db) @@ -226,11 +235,11 @@ '("shortdir_id" #f) '("item_path" #f) '("state" #f) '("status" #f) '("attemptnum" #f) - '("final_logf" #f) + '("final_logf_id" #f) '("logdat" #f) '("run_duration" #f) '("comment" #f) '("event_time" #f) '("fail_count" #f) @@ -285,11 +294,11 @@ '("shortdir_id" #f) '("item_path" #f) '("state" #f) '("status" #f) '("attemptnum" #f) - '("final_logf" #f) + '("final_logf_id" #f) '("logdat" #f) '("run_duration" #f) '("comment" #f) '("event_time" #f) '("fail_count" #f) @@ -502,11 +511,11 @@ shortdir_id INTEGER DEFAULT -1, item_path TEXT DEFAULT '', state TEXT DEFAULT 'NOT_STARTED', status TEXT DEFAULT 'FAIL', attemptnum INTEGER DEFAULT 0, - final_logf TEXT DEFAULT 'logs/final.log', + final_logf_id INTEGER DEFAULT 1, -- 'logs/final.log', logdat TEXT DEFAULT '', run_duration INTEGER DEFAULT 0, comment TEXT DEFAULT '', event_time TIMESTAMP DEFAULT (strftime('%s','now')), fail_count INTEGER DEFAULT 0, @@ -1126,11 +1135,11 @@ ;; 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 dbstruct run-id testpatt states statuses offset limit not-in sort-by sort-order qryvals) (let* ((qryvalstr (case qryvals ((shortlist) "id,run_id,testname,item_path,state,status") - ((#f) "id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir_id,item_path,run_duration,final_logf,comment") + ((#f) "id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir_id,item_path,run_duration,final_logf_id,comment") (else qryvals))) (res '()) ;; if states or statuses are null then assume match all when not-in is false (states-qry (if (null? states) #f @@ -1231,12 +1240,24 @@ test-id))) res)) ;; get a useful subset of the tests data (used in dashboard ;; use db:mintests-get-{id ,run_id,testname ...} -(define (db:get-tests-for-runs-mindata dbstruct run-ids testpatt states status not-in) - (db:get-tests-for-runs dbstruct run-ids testpatt states status not-in: not-in qryvals: "id,run_id,testname,state,status,event_time,item_path")) +(define (db:get-tests-for-runs-mindata dbstruct run-ids testpatt states statuses not-in) + (db:get-tests-for-runs dbstruct run-ids testpatt states statuses not-in: not-in qryvals: "id,run_id,testname,state,status,event_time,item_path")) + +(define (db:get-tests-for-runs dbstruct run-ids testpatt states statuses #!key (not-in #f)(qryvals #f)) + (let ((res '())) + (for-each + (lambda (run-id) + (set! res (append + res + (db:get-tests-for-run dbstruct run-id testpatt states statuses #f #f not-in #f #f qryvals)))) + (if run-ids + run-ids + (db:get-all-run-ids dbstruct))) + res)) ;; Convert calling routines to get list of run-ids and loop, do not use the get-tests-for-runs ;; (define (db:delete-test-records dbstruct run-id test-id) @@ -1349,21 +1370,21 @@ (db:get-db dbstruct run-id) "SELECT id FROM tests WHERE testname=? AND item_path=?;" testname item-path) res)) -(define db:test-record-qry-selector "id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir_id,item_path,run_duration,final_logf,comment,shortdir_id") +(define db:test-record-qry-selector "id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir_id,item_path,run_duration,final_logf_id,comment,shortdir_id") ;; NOTE: Use db:test-get* to access records ;; NOTE: This needs rundir_id decoding? Decide, decode here or where used? For the moment decode where used. (define (db:get-all-tests-info-by-run-id dbstruct run-id) (let ((db (db:get-db dbstruct run-id)) (res '())) (sqlite3:for-each-row - (lambda (id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run-duration final_logf comment short-dir-id) + (lambda (id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run-duration final-logf-id comment short-dir-id) ;; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - (set! res (cons (vector id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run-duration final_logf comment short-dir-id) + (set! res (cons (vector id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run-duration final-logf-id comment short-dir-id) res))) (db:get-db dbstruct run-id) (conc "SELECT " db:test-record-qry-selector " FROM tests WHERE run_id=?;") run-id) res)) @@ -1371,13 +1392,13 @@ ;; Get test data using test_id (define (db:get-test-info-by-id dbstruct run-id test-id) (let ((db (db:get-db dbstruct run-id)) (res #f)) (sqlite3:for-each-row - (lambda (id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final_logf comment short-dir-id) + (lambda (id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final-logf-id comment short-dir-id) ;; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - (set! res (vector id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final_logf comment short-dir-id))) + (set! res (vector id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final-logf-id comment short-dir-id))) (db:get-db dbstruct run-id) (conc "SELECT " db:test-record-qry-selector " FROM tests WHERE id=?;") test-id) res)) @@ -1386,13 +1407,13 @@ ;; (define (db:get-test-info-by-ids dbstruct run-id test-ids) (let ((db (db:get-db dbstruct run-id)) (res '())) (sqlite3:for-each-row - (lambda (id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final_logf comment short-dir-id) + (lambda (id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final-logf-id comment short-dir-id) ;; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - (set! res (cons (vector id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final_logf comment short-dir-id) + (set! res (cons (vector id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final-logf-id comment short-dir-id) res))) (db:get-db dbstruct run-id) (conc "SELECT " db:test-record-qry-selector " FROM tests WHERE id in (" (string-intersperse (map conc test-ids) ",") ");")) res)) @@ -1688,11 +1709,11 @@ END WHERE id=?;") ;; DONE '(test-set-log "UPDATE tests SET final_logf_id=? WHERE id=?;") ;; DONE '(test-set-rundir-by-test-id "UPDATE tests SET rundir_id=? WHERE id=?") ;; DONE '(test-set-rundir "UPDATE tests SET rundir_id=? AND testname=? AND item_path=?;") ;; DONE '(delete-tests-in-state "DELETE FROM tests WHERE state=?;") ;; DONE - '(tests:test-set-toplog "UPDATE tests SET final_logf=? WHERE run_id=? AND testname=? AND item_path='';") + '(tests:test-set-toplog "UPDATE tests SET final_logf_id=? WHERE run_id=? AND testname=? AND item_path='';") '(update-cpuload-diskfree "UPDATE tests SET cpuload=?,diskfree=? WHERE id=?;") ;; DONE '(update-uname-host "UPDATE tests SET uname=?,host=? WHERE id=?;") ;; DONE '(update-test-state "UPDATE tests SET state=? WHERE state=? AND run_id=? AND testname=? AND NOT (item_path='' AND testname IN (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));") '(update-test-status "UPDATE tests SET status=? WHERE status like ? AND run_id=? AND testname=? AND NOT (item_path='' AND testname IN (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));") ;; stuff for roll-up-pass-fail-counts @@ -2021,11 +2042,11 @@ (results (list runsheader)) (testdata-header (list "Run Id" "Testname" "Item Path" "Category" "Variable" "Value" "Expected" "Tol" "Units" "Status" "Comment")) (mainqry (conc "SELECT t.testname,r.id,runname," keysstr ",t.testname, t.item_path,tm.description,t.state,t.status, - final_logf,run_duration, + final_logf_id,run_duration, strftime('%m/%d/%Y %H:%M:%S',datetime(t.event_time,'unixepoch'),'localtime'), tm.tags,r.owner,t.comment, author, tm.owner,reviewed, diskfree,uname,rundir, Index: db_records.scm ================================================================== --- db_records.scm +++ db_records.scm @@ -87,10 +87,11 @@ (define-inline (db:test-get-event_time vec) (vector-ref vec 5)) (define-inline (db:test-get-host vec) (vector-ref vec 6)) (define-inline (db:test-get-cpuload vec) (vector-ref vec 7)) (define-inline (db:test-get-diskfree vec) (vector-ref vec 8)) (define-inline (db:test-get-uname vec) (vector-ref vec 9)) +;; (define-inline (db:test-get-rundir vec) (sdb:qry 'getstr (vector-ref vec 10))) (define-inline (db:test-get-rundir vec) (vector-ref vec 10)) (define-inline (db:test-get-item-path vec) (vector-ref vec 11)) (define-inline (db:test-get-run_duration vec) (vector-ref vec 12)) (define-inline (db:test-get-final_logf vec) (vector-ref vec 13)) (define-inline (db:test-get-comment vec) (vector-ref vec 14)) Index: http-transport.scm ================================================================== --- http-transport.scm +++ http-transport.scm @@ -431,15 +431,16 @@ (let ((start-time (current-milliseconds)) (sync-time #f) (rem-time #f)) (if *inmemdb* (db:sync-touched *inmemdb*)) (set! sync-time (- (current-milliseconds) start-time)) - ;; (debug:print 0 "SYNC: time= " sync-time) (set! rem-time (quotient (- 4000 sync-time) 1000)) - (if (and (< rem-time 4) + (debug:print 0 "SYNC: time= " sync-time ", rem-time=" rem-time) + (if (and (<= rem-time 4) (> rem-time 0)) - (thread-sleep! rem-time))) + (thread-sleep! rem-time) + (thread-sleep! 4))) ;; fallback for if the math is changed ... ;; (thread-sleep! 4) ;; no need to do this very often (if (< count 1) ;; 3x3 = 9 secs aprox (loop (+ count 1))) @@ -460,13 +461,16 @@ ;; NOTE: Get rid of this mechanism! It really is not needed... ;; (open-run-close tasks:server-update-heartbeat tasks:open-db spid) (tasks:server-update-heartbeat tdb spid) ;; (if ;; (or (> numrunning 0) ;; stay alive for two days after last access + + ;; Transfer *last-db-access* to last-access to use in checking that we are still alive (mutex-lock! *heartbeat-mutex*) (set! last-access *last-db-access*) (mutex-unlock! *heartbeat-mutex*) + ;; (debug:print 11 "last-access=" last-access ", server-timeout=" server-timeout) (if (and *server-run* (> (+ last-access server-timeout) (current-seconds))) (begin @@ -524,10 +528,11 @@ (thread-start! th2) (thread-start! th3) (set! *didsomething* #t) (thread-join! th2)) (debug:print 0 "ERROR: Failed to setup for megatest"))) + (sdb:qry 'finalize) (exit))) (define (http-transport:server-signal-handler signum) (handle-exceptions exn Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -523,11 +523,11 @@ (if (not (hash-table-ref/default *toptest-paths* testname #f)) (let* ((testinfo (rmt:get-test-info-by-id run-id test-id)) ;; run-id testname item-path)) (curr-test-path (if testinfo ;; (filedb:get-path *fdb* ;; (db:get-path dbstruct - (db:test-get-rundir testinfo) ;; ) + (rmt:sdb-qry 'getstr (db:test-get-rundir testinfo)) ;; ) #f))) (hash-table-set! *toptest-paths* testname curr-test-path) ;; NB// Was this for the test or for the parent in an iterated test? ;;(cdb:test-set-rundir! *runremote* run-id testname "" (filedb:register-path *fdb* lnkpath)) ;; toptest-path) (rmt:general-call 'test-set-rundir run-id lnkpath testname "") ;; toptest-path) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -358,11 +358,11 @@ "-stop-server" "-show-cmdinfo" "-list-runs"))) (if (setup-for-run) (begin - + (set! *fdb* (filedb:open-db (conc *toppath* "/db/paths.db"))) ;; if not list or kill then start a client (if appropriate) (if (or (args-defined? "-h" "-version" "-gen-megatest-area" "-gen-megatest-test") (eq? (length (hash-table-keys args:arg-hash)) 0)) (debug:print-info 1 "Server connection not needed") ;; ok, so lets connect to the server @@ -384,12 +384,10 @@ (case chosen-transport ((http) (set! *transport-type 'http) (server:ensure-running) ;; Get rid of this - (set! sdb:qry (make-sdb:qry (conc *toppath* "/db/strings.db"))) ;; we open the normalization helpers here - (set! *fdb* (filedb:open-db (conc *toppath* "/db/paths.db"))) (client:launch)) (else ;; (fs) (debug:print 0 "ERROR: Should NOT be getting here! fs transport is no longer supported") (set! *transport-type* 'fs) @@ -618,11 +616,12 @@ (equal? (db:test-get-state test) "NOT_STARTED"))) (begin (print " cpuload: " (db:test-get-cpuload test) "\n diskfree: " (db:test-get-diskfree test) "\n uname: " (sdb:qry 'getstr (db:test-get-uname test)) - "\n rundir: " (filedb:get-path *fdb* (db:test-get-rundir test)) + "\n rundir: " (sdb:qry 'getstr ;; (filedb:get-path *fdb* + (db:test-get-rundir test)) ) ;; Each test ;; DO NOT remote run (let ((steps (db:get-steps-for-test dbstruct run-id (db:test-get-id test)))) (for-each @@ -1196,11 +1195,11 @@ ;; (if (and *runremote* ;; (socket? *runremote*)) ;; (close-socket *runremote*)) (if sdb:qry (sdb:qry 'finalize #f)) -(if *fdb* (filedb:finalize-db! *fdb*)) +;; (if *fdb* (filedb:finalize-db! *fdb*)) (if (not *didsomething*) (debug:print 0 help)) ;; (if *runremote* (rpc:close-all-connections!)) Index: mt.scm ================================================================== --- mt.scm +++ mt.scm @@ -127,17 +127,18 @@ ;; T R I G G E R S ;;====================================================================== (define (mt:process-triggers run-id test-id newstate newstatus) (let* ((test-dat (rmt:get-test-info-by-id run-id test-id)) - (test-rundir ;; (filedb:get-path *fdb* - (db:test-get-rundir test-dat)) ;; ) + (test-rundir (rmt:sdb-qry 'getstr ;; (filedb:get-path *fdb* + (db:test-get-rundir test-dat))) ;; ) (test-name (db:test-get-testname test-dat)) (tconfig #f) (state (if newstate newstate (db:test-get-state test-dat))) (status (if newstatus newstatus (db:test-get-status test-dat)))) - (if (and (file-exists? test-rundir) + (if (and test-rundir ;; #f means no dir set yet + (file-exists? test-rundir) (directory? test-rundir)) (begin (push-directory test-rundir) (set! tconfig (mt:lazy-read-test-config test-name)) (pop-directory) Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -89,10 +89,14 @@ (rmt:send-receive 'general-call (append (list stmtname run-id) params))) (define (rmt:sync-inmem->db) (rmt:send-receive 'sync-inmem->db '())) +(define (rmt:sdb-qry qry val) + ;; add caching if qry is 'getid or 'getstr + (rmt:send-receive 'sdb-qry (list qry val))) + ;;====================================================================== ;; K E Y S ;;====================================================================== (define (rmt:get-key-val-pairs run-id) @@ -144,11 +148,11 @@ (rmt:send-receive 'get-previous-test-run-record (list run-id test-name item-path))) (define (rmt:get-matching-previous-test-run-records run-id test-name item-path) (rmt:send-receive 'get-matching-previous-test-run-records (list run-id test-name item-path))) -(define (rmt:test-get-logfile-info run-id test-name) +(define (rmt:test-get-logfileg-info run-id test-name) (rmt:send-receive 'test-get-logfile-info (list run-id test-name))) (define (rmt:test-get-records-for-index-file run-id test-name) (rmt:send-receive 'test-get-records-for-index-file (list run-id test-name))) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -1125,10 +1125,11 @@ (cond ;; Have to check for skip conditions. This one skips if there are same-named tests ;; currently running ((and skip-check (configf:lookup test-conf "skip" "prevrunning")) + ;; run-ids = #f means *all* runs (let ((running-tests (rmt:get-tests-for-runs-mindata #f full-test-name '("RUNNING" "REMOTEHOSTSTART" "LAUNCHED") '() #f))) (if (not (null? running-tests)) ;; have to skip (set! skip-test "Skipping due to previous tests running")))) ((and skip-check (configf:lookup test-conf "skip" "fileexists")) @@ -1250,12 +1251,12 @@ action) ((run-wait) (debug:print 1 "Waiting for run " runkey ", run=" runnamepatt " to complete")) (else (debug:print-info 0 "action not recognised " action))) - (let ((sorted-tests (sort tests (lambda (a b)(let ((dira (filedb:get-path *fdb* (db:test-get-rundir a))) - (dirb (filedb:get-path *fdb* (db:test-get-rundir b)))) + (let ((sorted-tests (sort tests (lambda (a b)(let ((dira (rmt:sdb-qry 'getstr (db:test-get-rundir a))) ;; (filedb:get-path *fdb* (db:test-get-rundir a))) + (dirb (rmt:sdb-qry 'getstr (db:test-get-rundir b)))) ;; ((filedb:get-path *fdb* (db:test-get-rundir b)))) (if (and (string? dira)(string? dirb)) (> (string-length dira)(string-length dirb)) #f))))) (test-retry-time (make-hash-table)) (allow-run-time 10)) ;; seconds to allow for killing tests before just brutally killing 'em @@ -1268,11 +1269,12 @@ (debug:print 0 "ERROR: We have a test-id of " test-id " but no record was found. NOTE: No locking of records is done between processes, do not simultaneously remove the same run from two processes!") (if (not (null? tal)) (loop (car tal)(cdr tal)))) (let* ((item-path (db:test-get-item-path new-test-dat)) (test-name (db:test-get-testname new-test-dat)) - (run-dir (filedb:get-path *fdb* (db:test-get-rundir new-test-dat))) ;; run dir is from the link tree + (run-dir ;;(filedb:get-path *fdb* + (rmt:sdb-qry 'getid (db:test-get-rundir new-test-dat))) ;; run dir is from the link tree (real-dir (if (file-exists? run-dir) (resolve-pathname run-dir) #f)) (test-state (db:test-get-state new-test-dat)) (test-fulln (db:test-get-fullname new-test-dat))) Index: sdb.scm ================================================================== --- sdb.scm +++ sdb.scm @@ -21,18 +21,18 @@ (declare (unit sdb)) ;; (define (sdb:open fname) - (let* ((dbpath fname) - (dbexists (let ((fe (file-exists? dbpath))) + (let* ((dbpath (pathname-directory fname)) + (dbexists (let ((fe (file-exists? fname))) (if fe fe (begin - (create-directory (conc *toppath* "/db") #t) + (create-directory dbpath #t) #f)))) - (sdb (sqlite3:open-database dbpath)) + (sdb (sqlite3:open-database fname)) (handler (make-busy-timeout 136000))) (sqlite3:set-busy-handler! sdb handler) (if (not dbexists) (sdb:initialize sdb)) (sqlite3:execute sdb "PRAGMA synchronous = 1;") @@ -41,11 +41,11 @@ (define (sdb:initialize sdb) (sqlite3:execute sdb "CREATE TABLE IF NOT EXISTS strs (id INTEGER PRIMARY KEY, str TEXT, CONSTRAINT str UNIQUE (str));") - (sqlite3:execute sdb "CREATE INDEX strindx ON strs (str);")) + (sqlite3:execute sdb "CREATE INDEX IF NOT EXISTS strindx ON strs (str);")) ;; (define sumup (let ((a 0))(lambda (x)(set! a (+ x a)) a))) (define (sdb:register-string sdb str) (sqlite3:execute sdb "INSERT OR IGNORE INTO strs (str) VALUES (?);" str)) @@ -77,12 +77,15 @@ (define (make-sdb:qry fname) (let ((sdb #f) (scache (make-hash-table)) (icache (make-hash-table))) (lambda (cmd var) - (if (not sdb)(set! sdb (sdb:open fname))) (case cmd + ((setup) (set! sdb (if (not sdb) + (sdb:open (if var var fname))))) + ((setdb) (set! sdb var)) + ((getdb) sdb) ((finalize) (if sdb (begin (sqlite3:finalize! sdb) (set! sdb #f)))) ((getid) (let ((id (if (or (number? var) @@ -96,7 +99,9 @@ (sdb:string->id sdb scache var))))) ((getstr) (if (or (number? var) (string->number var)) (sdb:id->string sdb icache var) var)) + ((passid) var) + ((passstr) var) (else #f))))) Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -134,12 +134,12 @@ ;; Check for waiver eligibility ;; (define (tests:check-waiver-eligibility testdat prev-testdat) (let* ((test-registry (make-hash-table)) (testconfig (tests:get-testconfig (db:test-get-testname testdat) test-registry #f)) - (test-rundir (sdb:qry 'getstr (db:test-get-rundir testdat))) - (prev-rundir (sdb:qry 'getstr (db:test-get-rundir prev-testdat))) + (test-rundir (sdb:qry 'passstr (db:test-get-rundir testdat))) + (prev-rundir (sdb:qry 'passstr (db:test-get-rundir prev-testdat))) (waivers (configf:section-vars testconfig "waivers")) (waiver-rx (regexp "^(\\S+)\\s+(.*)$")) (diff-rule "diff %file1% %file2%") (logpro-rule "diff %file1% %file2% | logpro %waivername%.logpro %waivername%.html")) (if (not (file-exists? test-rundir))