Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -76,27 +76,30 @@ (begin (print "Failed to find megatest.config, exiting") (exit 1))) (define *db* (open-db)) + +;; HACK ALERT: this is a hack, please fix. +(define *read-only* (file-read-access? (conc *toppath* "/megatest.db"))) ;; (server:client-setup *db*) (define toplevel #f) (define dlg #f) (define max-test-num 0) -(define *keys* (rdb:get-keys *db*)) -(define *keys* (db:get-keys *db*)) +(define *keys* (rdb:get-keys *db*)) +;; (define *keys* (db:get-keys *db*)) (define *dbkeys* (map (lambda (x)(vector-ref x 0)) (append *keys* (list (vector "runname" "blah"))))) (define *header* #f) (define *allruns* '()) (define *buttondat* (make-hash-table)) ;; (define *alltestnamelst* '()) (define *searchpatts* (make-hash-table)) (define *num-runs* 8) (define *tot-run-count* (rdb:get-num-runs *db* "%")) -(define *tot-run-count* (db:get-num-runs *db* "%")) +;; (define *tot-run-count* (db:get-num-runs *db* "%")) (define *last-update* (current-seconds)) (define *num-tests* 15) (define *start-run-offset* 0) (define *start-test-offset* 0) (define *examine-test-dat* (make-hash-table)) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1221,11 +1221,14 @@ (define (rdb:get-keys db) (if *runremote* (let ((host (vector-ref *runremote* 0)) (port (vector-ref *runremote* 1))) - ((rpc:procedure 'rdb:get-keys host port))) + (if *db-keys* *db-keys* + (let ((keys ((rpc:procedure 'rdb:get-keys host port)))) + (set! *db-keys* keys) + keys))) (db:get-keys db))) (define (rdb:get-num-runs db runpatt) (if *runremote* (let ((host (vector-ref *runremote* 0)) Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -222,10 +222,11 @@ " this-step-status: " this-step-status " overall-status: " overall-status " next-status: " next-status " rollup-status: " rollup-status) (case next-status ((warn) (set! rollup-status 2) + ;; NB// test-set-status! does rdb calls under the hood (test-set-status! db run-id test-name "RUNNING" "WARN" itemdat (if (eq? this-step-status 'warn) "Logpro warning found" #f) #f)) ((pass) (test-set-status! db run-id test-name "RUNNING" "PASS" itemdat #f #f)) @@ -284,11 +285,11 @@ (sqlite3:finalize! db) (exit 1)))) (set! kill-tries (+ 1 kill-tries)) (mutex-unlock! m))) (sqlite3:finalize! db) - (thread-sleep! (+ 8 (random 4))) ;; add some jitter to the call home time to spread out the db accesses + (thread-sleep! (+ 10 (random 10))) ;; add some jitter to the call home time to spread out the db accesses (loop (calc-minutes))))))) (th1 (make-thread monitorjob)) (th2 (make-thread runit))) (set! job-thread th2) (thread-start! th1) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -397,18 +397,18 @@ (runs:update-test_meta db test-name test-conf) ;; (lambda (itemdat) ;;; ((ripeness "overripe") (temperature "cool") (season "summer")) (let* ((new-test-path (string-intersperse (cons test-path (map cadr itemdat)) "/")) (new-test-name (if (equal? item-path "") test-name (conc test-name "/" item-path))) ;; just need it to be unique - (testdat (rdb:get-test-info db run-id test-name item-path))) + (testdat (db:get-test-info db run-id test-name item-path))) (if (not testdat) (begin ;; ensure that the path exists before registering the test ;; NOPE: Cannot! Don't know yet which disk area will be assigned.... ;; (system (conc "mkdir -p " new-test-path)) (rtests:register-test db run-id test-name item-path) - (set! testdat (rdb:get-test-info db run-id test-name item-path)))) + (set! testdat (db:get-test-info db run-id test-name item-path)))) (change-directory test-path) (case (if force ;; (args:get-arg "-force") 'NOT_STARTED (if testdat (string->symbol (test:get-state testdat)) Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -21,13 +21,11 @@ (for-each (lambda (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 - ;; (conc "," (string-intersperse tags ",") ",") - )) + pth)) item-paths ))) ;; get the previous record for when this test was run where all keys match but runname ;; returns #f if no such test found, returns a single test record if found (define (test:get-previous-test-run-record db run-id test-name item-path)