Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1720,11 +1720,11 @@ (db:with-db dbstruct #f #f (lambda (dbdat db) (sqlite3:for-each-row (lambda (target id runname state status owner event_time) (set! res (cons (make-simple-run target id runname state status owner event_time) res)) - (debug:print-info 0 *default-log-port* "db:simple-get-runs: res = " res)) + ) db qrystr ))) (debug:print-info 11 *default-log-port* "db:simple-get-runs END qrystr: " qrystr " target: " target " offset: " offset " limit: " count) res)) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -2488,28 +2488,12 @@ 'old2new ) (set! *didsomething* #t))) (if (args:get-arg "-import-sexpr") - (let* ( - (toppath (launch:setup)) - (tmppath (common:make-tmpdir-name toppath ""))) - (if (file-exists? (conc toppath "/.mtdb")) - (if (args:get-arg "-remove-dbs") - (let* ((dbfiles (conc toppath "/.mtdb/* " tmppath "/*"))) - (debug:print 0 *default-log-port* "Removing db files: " dbfiles) - (system (conc "rm -rvf " dbfiles)) - ) - (begin - (debug:print 0 *default-log-port* "ERROR: Cannot import sexpr with an existing DB present.") - (debug:print 0 *default-log-port* "Add '-remove-dbs all' to remove the current Megatest DBs.") - (set! *didsomething* #t) - (exit) - ) - ) - ) - (db:setup #f) + (begin + (launch:setup) (rmt:import-sexpr (args:get-arg "-import-sexpr")) (set! *didsomething* #t))) (when (args:get-arg "-sync-brute-force") (launch:setup) Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -1159,11 +1159,21 @@ )))) (define (rmt:insert-test run-id test-rec) (let* ((testname (alist-ref "testname" test-rec equal?)) - (item-path (alist-ref "item_path" test-rec equal?))) - (debug:print 0 *default-log-port* " Insert test in run "run-id": "testname"/"item-path) - (rmt:send-receive 'insert-test run-id test-rec))) + (item-path (alist-ref "item_path" test-rec equal?)) + (test-id (rmt:get-test-id run-id testname item-path)) + ) + + (if test-id + (debug:print 0 *default-log-port* "test "testname"/"item-path " already exists in run-id " run-id) + (begin + (debug:print 0 *default-log-port* " Insert test in run "run-id": "testname"/"item-path) + (rmt:send-receive 'insert-test run-id test-rec) + ) + ) + ) +)