@@ -86,33 +86,41 @@ (define (rmt:import-run target run-dat) (let* ((runname (car run-dat)) (all-dat (cdr run-dat)) (tests-data (alist-ref "data" all-dat equal?)) (run-meta (alist-ref "meta" all-dat equal?)) - (run-id (rmt:insert-run target runname run-meta))) + (run-id (string->number (alist-ref "id" run-meta equal?)))) + + (rmt:insert-run run-id target runname run-meta) (for-each (lambda (test-dat) (let* ((test-id (car test-dat)) (test-rec (cdr test-dat))) (rmt:insert-test run-id test-rec))) tests-data))) ;; insert run if not there, return id either way -(define (rmt:insert-run target runname run-meta) +(define (rmt:insert-run run-id target runname run-meta) ;; look for id, return if found (debug:print 0 *default-log-port* "Insert run: "target"/"runname) (let* ((runs (rmtmod:send-receive 'simple-get-runs #f ;; runpatt count offset target last-update) (list runname #f #f target #f)))) (if (null? runs) - (rmtmod:send-receive 'insert-run #f (list target runname run-meta)) - (simple-run-id (car runs))))) + (begin + (debug:print 0 *default-log-port* "inserting run for runname " runname " target " target) + (rmtmod:send-receive 'insert-run #f (list run-id target runname run-meta)) + ) + (begin + (debug:print 0 *default-log-port* "Found run-id " (simple-run-id (car runs)) " for runname " runname " target " target) + (simple-run-id (car runs) + ) + )))) (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) (rmtmod:send-receive 'insert-test run-id test-rec))) ;;====================================================================== ;; T E S T S ;;======================================================================