Index: TODO ================================================================== --- TODO +++ TODO @@ -16,12 +16,12 @@ # along with Megatest. If not, see . TODO ==== -. Dashboard should resist running from non-homehost - +. Simple, fast, make-like running: megatest run + would run that test, auto creating a default target and runname Migration to inmem db plus per run db ------------------------------------- Index: ulex/ulex.scm ================================================================== --- ulex/ulex.scm +++ ulex/ulex.scm @@ -51,12 +51,12 @@ ;; called before connecting to a db using connect. ;; ;; find or become the captain ;; setup and return a ulex object ;; -(define (setup) - (let* ((udata (make-udat)) +(define (setup #!optional (udata-in #f)) + (let* ((udata (or udata-in (make-udat))) (cpkts (get-all-captain-pkts udata)) ;; read captain pkts (captn (get-winning-pkt cpkts))) ;; check to see if our own server is started and start one if not (if (not (udat-serv-listener udata))(start-server-find-port udata)) (if captn @@ -108,11 +108,12 @@ (delta (- (current-milliseconds) start))) (values (equal? res cookie) delta))) ;; returns: success pingtime ;; -;; NOTE: causes all references to this worker to be wiped out in the callee (ususally the captain) +;; NOTE: causes all references to this worker to be wiped out in the +;; callee (ususally the captain) ;; (define (goodbye-ping udata host-port) (let* ((start (current-milliseconds)) (cookie (make-cookie udata)) (dbs (udat-my-dbs udata)) @@ -130,11 +131,12 @@ (let* ((host-port (udat-captain-host-port udata))) (if host-port (let* ((cookie (make-cookie udata)) (msg #f) ;; (conc dbname " " dbtype)) (params `(,dbname ,dbtype)) - (res (send udata host-port 'db-owner cookie msg params: params retval: #t))) + (res (send udata host-port 'db-owner cookie msg + params: params retval: #t))) (match (string-split res) ((retcookie owner-host-port) (values (equal? retcookie cookie) owner-host-port)))) (values #f -1)))) @@ -458,24 +460,29 @@ ;; NOTE: qrykey is what was called the "cookie" previously ;; ;; retval tells send to expect and wait for return data (one line) and return it or time out ;; this is for ping where we don't want to necessarily have set up our own server yet. ;; -(define (send udata host-port handler qrykey data #!key (hostname #f)(pid #f)(params '())(retval #f)) +(define (send udata host-port handler qrykey data + #!key (hostname #f)(pid #f)(params '())(retval #f)) (let* ((my-host-port (udat-my-host-port udata)) - (isme (equal? host-port my-host-port)) ;; am I calling myself? + (isme (equal? host-port my-host-port)) ;; am I calling + ;; myself? (dat (list handler ;; " " my-host-port ;; " " (udat-my-pid udata) ;; " " qrykey - params #;(if (null? params) "" (conc " " (string-intersperse params " "))) + params ;;(if (null? params) "" (conc " " + ;;(string-intersperse params " "))) ))) - ;; (print "send isme is " (if isme "true!" "false!") ", my-host-port: " my-host-port ", host-port: " host-port) + ;; (print "send isme is " (if isme "true!" "false!") ", + ;; my-host-port: " my-host-port ", host-port: " host-port) (if isme (ulex-handler udata dat data) - (handle-exceptions ;; ERROR - MAKE THIS EXCEPTION HANDLER MORE SPECIFIC + (handle-exceptions ;; ERROR - MAKE THIS EXCEPTION HANDLER MORE + ;; SPECIFIC exn #f (let-values (((inp oup)(tcp-connect host-port))) ;; ;; CONTROL LINE: