Index: api.scm ================================================================== --- api.scm +++ api.scm @@ -55,11 +55,22 @@ ((get-run-info) (let ((res (apply db:get-run-info db params))) (list (vector-ref res 0) (vector->list (vector-ref res 1))))) ((register-run) (apply db:register-run db params)) ((set-tests-state-status) (apply db:set-tests-state-status db params)) - ((get-tests-for-run) (map vector->list (apply db:get-tests-for-run db params))) + ((get-tests-for-run) (let ((res (apply db:get-tests-for-run db params))) + (if (list? res) + (map (lambda (x) + (if (list? x) + (vector->list x) + (begin + (debug:print 0 "ERROR in remote of get-tests-for-run, not a vector") + x))) + res) + (begin + (debug:print 0 "ERROR in remote of get-tests-for-run, not a list") + res)))) ((get-test-id) (apply db:get-test-id-not-cached db params)) ((get-tests-for-runs-mindata) (map vector->list (apply db:get-tests-for-runs-mindata db params))) ((get-run-name-from-id) (apply db:get-run-name-from-id db params)) ((delete-run) (apply db:delete-run db params)) ((get-runs) (let* ((res (apply db:get-runs db params)) @@ -114,17 +125,18 @@ ;; NB// Runs on the server as part of the server loop ;; (define (api:process-request db $) ;; the $ is the request vars proc (let* ((cmd ($ 'cmd)) (paramsj ($ 'params)) - (params (rmt:json-str->dat paramsj)) + (params (db:string->obj paramsj)) ;; (rmt:json-str->dat paramsj)) (res (api:execute-requests db cmd params))) ;; This can be here but needs controls to ensure it doesn't run more than every 4 seconds - (rmt:dat->json-str - (if (or (string? res) - (list? res) - (number? res) - (boolean? res)) - res - (list "ERROR" 1 cmd params res))))) + ;; (rmt:dat->json-str + ;; (if (or (string? res) + ;; (list? res) + ;; (number? res) + ;; (boolean? res)) + ;; res + ;; (list "ERROR, not string, list, number or boolean" 1 cmd params res))))) + (db:obj->string res))) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1550,23 +1550,23 @@ ;;====================================================================== ;; NOTE: Can remove the regex and base64 encoding for zmq (define (db:obj->string obj) (case *transport-type* - ((fs) obj) - ((http) + ;; ((fs) obj) + ((http fs) (string-substitute (regexp "=") "_" (base64:base64-encode (with-output-to-string (lambda ()(serialize obj)))) #t)) ((zmq)(with-output-to-string (lambda ()(serialize obj)))) (else obj))) (define (db:string->obj msg) (case *transport-type* - ((fs) msg) - ((http) + ;; ((fs) msg) + ((http fs) (if (string? msg) (with-input-from-string (base64:base64-decode (string-substitute (regexp "_") "=" msg #t)) Index: mt.scm ================================================================== --- mt.scm +++ mt.scm @@ -17,10 +17,11 @@ (declare (uses items)) (declare (uses runconfig)) (declare (uses tests)) (declare (uses server)) (declare (uses runs)) +(declare (uses rmt)) (include "common_records.scm") (include "key_records.scm") (include "db_records.scm") (include "run_records.scm") Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -37,18 +37,18 @@ ;; cmd is a symbol ;; vars is a json string encoding the parameters for the call ;; (define (rmt:send-receive cmd params) (case *transport-type* - ((fs) + ((fs-aint-here) (debug:print 0 "ERROR: Not yet (re)supported") (exit 1)) - ((http) - (let* ((jparams (rmt:dat->json-str params)) + ((fs http) + (let* ((jparams (db:obj->string params)) ;; (rmt:dat->json-str params)) (res (http-transport:client-api-send-receive *runremote* cmd jparams))) (if res - (rmt:json-str->dat res) + (db:string->obj res) ;; (rmt:json-str->dat res) (begin (debug:print 0 "ERROR: Bad value from http-transport:client-api-send-receive " res) #f)) )) (else @@ -129,14 +129,20 @@ (define (rmt:set-tests-state-status run-id testnames currstate currstatus newstate newstatus) (rmt:send-receive 'set-tests-state-status (list run-id testnames currstate currstatus newstate newstatus))) (define (rmt:get-tests-for-run run-id testpatt states statuses offset limit not-in sort-by sort-order qryvals) - (map list->vector (rmt:send-receive 'get-tests-for-run (list run-id testpatt states statuses offset limit not-in sort-by sort-order qryvals)))) + (let ((res (rmt:send-receive 'get-tests-for-run (list run-id testpatt states statuses offset limit not-in sort-by sort-order qryvals)))) + (if (list? res) + (map list->vector res) + res))) (define (rmt:get-tests-for-runs-mindata run-ids testpatt states status not-in) - (map list->vector (rmt:send-receive 'get-tests-for-runs-mindata (list run-ids testpatt states status not-in)))) + (let ((res (rmt:send-receive 'get-tests-for-runs-mindata (list run-ids testpatt states status not-in)))) + (cond + ((list? res)(map list->vector res)) + (else res)))) (define (rmt:delete-test-records test-id) (rmt:send-receive 'delete-test-records (list test-id))) (define (rmt:test-set-status-state test-id status state msg) Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -158,14 +158,11 @@ fullprep : cleanprep cd fullrun;$(MEGATEST) -remove-runs :runname $(RUNNAME)% -target %/%/% -testpatt %/% cd fullrun;$(BINPATH)/dashboard -rows 15 & dashboard : cleanprep - cd fullrun && $(BINPATH)/dashboard -transport fs -rows 20 & - -dashboard-http : cleanprep - cd fullrun && $(BINPATH)/dashboard -transport http -rows 20 & + cd fullrun && $(BINPATH)/dashboard -rows 20 & remove : cd fullrun;$(MEGATEST) -remove-runs :runname $(RUN) -testpatt % -itempatt % :sysname % :fsname % :datapath % clean :