Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -29,11 +29,11 @@ (define *toppath* #f) (define *already-seen-runconfig-info* #f) (define *waiting-queue* (make-hash-table)) (define *globalexitstatus* 0) ;; attempt to work around possible thread issues (define *passnum* 0) ;; when running track calls to run-tests or similar - +(define *verbosity* 1) (define-inline (get-with-default val default) (let ((val (args:get-arg val))) (if val val default))) @@ -89,18 +89,18 @@ (with-output-to-file (conc fname ".csh") (lambda () (for-each (lambda (key) (let* ((val (cdr key)) (sval (if (string-search whitesp val)(conc "'" val "'") val))) - (debug:print 2 "setenv " (car key) " " sval))) + (print "setenv " (car key) " " sval))) envvars))) (with-output-to-file (conc fname ".sh") (lambda () (for-each (lambda (key) (let* ((val (cdr key)) (sval (if (string-search whitesp val)(conc "'" val "'") val))) - (debug:print 2 "export " (car key) "=" sval))) + (print "export " (car key) "=" sval))) envvars))))) ;; set some env vars from an alist, return an alist with original values ;; (("VAR" "value") ...) (define (alist->env-vars lst) Index: configf.scm ================================================================== --- configf.scm +++ configf.scm @@ -58,11 +58,11 @@ (val (let* ((cmdres (cmd-run->list cmd)) (status (cadr cmdres)) (res (car cmdres))) (if (not (eq? status 0)) (begin - (debug:print 0 "ERROR: problem with " inl ", return code not 0") + (debug:print 0 "ERROR: problem with " inl ", return code " status) (exit 1))) (if (null? res) "" (string-intersperse res " "))))) (hash-table-set! res curr-section-name Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -140,10 +140,16 @@ runs) (set! *header* header) (set! *allruns* result) maxtests)) +(define *collapsed* (make-hash-table)) +(define (toggle-hide testname) + (if (hash-table-ref/default *collapsed* testname #f) + (hash-table-delete! *collapsed* testname) + (hash-table-set! *collapsed* testname #t))) + (define (update-labels uidat) (let* ((rown 0) (lftcol (vector-ref uidat 0)) (numcols (vector-length lftcol)) (maxn (- numcols 1)) @@ -190,35 +196,10 @@ (lftcol (vector-ref uidat 0)) (tableheader (vector-ref uidat 1)) (table (vector-ref uidat 2)) (coln 0)) (update-labels uidat) - (for-each - (lambda (popup) - (let* ((test-id (car popup)) - (widgets (hash-table-ref *examine-test-dat* popup)) - (stepslbl (hash-table-ref/default widgets "Test Steps" #f))) - (if stepslbl - (let* ((fmtstr "~15a~8a~8a~20a") - (newtxt (string-intersperse - (append - (list - (format #f fmtstr "Stepname" "State" "Status" "Event Time") - (format #f fmtstr "========" "=====" "======" "==========")) - (map (lambda (x) - ;; take advantage of the \n on time->string - (format #f fmtstr - (db:step-get-stepname x) - (db:step-get-state x) - (db:step-get-status x) - (time->string - (seconds->local-time - (db:step-get-event_time x))))) - (db-get-test-steps-for-run *db* test-id))) - "\n"))) - (iup:attribute-set! stepslbl "TITLE" newtxt))))) - (hash-table-keys *examine-test-dat*)) (set! *alltestnamelst* '()) (for-each (lambda (rundat) (if (not rundat) ;; handle padded runs ;; ;; id run-id testname state status event-time host cpuload diskfree uname rundir item-path run-duration @@ -350,10 +331,12 @@ ((>= testnum ntests) ;; now lftlst will be an hbox with the test keys and the test name labels (set! lftlst (append lftlst (list (apply iup:vbox (reverse res)))))) (else (let ((labl (iup:button "" #:flat "YES" #:size "100x15" #:fontsize "10"))) + (iup:attribute-set! labl "ACTION" (lambda (obj) + (toggle-hide (iup:attribute obj "TITLE")))) (vector-set! lftcol testnum labl) (loop (+ testnum 1)(cons labl res)))))) ;; (let loop ((runnum 0) (keynum 0) Index: items.scm ================================================================== --- items.scm +++ items.scm @@ -51,16 +51,32 @@ ;; (("ANIMAL" "Elephant") ("SEASON" "Fall")) ;; (("ANIMAL" "Lion") ("SEASON" "Spring")) ;; (("ANIMAL" "Lion") ("SEASON" "Fall"))) (define (item-assoc->item-list itemsdat) (if (and itemsdat (not (null? itemsdat))) - (let ((itemlst (map (lambda (x) - (let ((name (car x)) - (items (cadr x))) - (list name (string-split items)))) - itemsdat))) - (process-itemlist #f '() itemlst)) + (let ((itemlst (filter (lambda (x) + (list? x)) + (map (lambda (x) + (debug:print 6 "item-assoc->item-list x: " x) + (if (< (length x) 2) + (begin + (debug:print 0 "ERROR: malformed items spec " (string-intersperse x " ")) + (list (car x)'())) + (let ((name (car x)) + (items (cadr x))) + (list name (string-split items))))) + itemsdat)))) + (let ((debuglevel 5)) + (debug:print 5 "item-assoc->item-list: itemsdat => itemlst ") + (if (>= *verbosity* 5) + (begin + (pp itemsdat) + (print " => ") + (pp itemlst)))) + (if (> (length itemlst) 0) + (process-itemlist #f '() itemlst) + '())) '())) ;; return a list consisting on a single null list for non-item runs ;; Nope, not now, return null as of 6/6/2011 ;; (item-table->item-list '(("ANIMAL" "Elephant Lion")("SEASON" "Spring Winter"))) ;; => ((("ANIMAL" "Elephant")("SEASON" "Spring")) @@ -68,11 +84,11 @@ (define (item-table->item-list itemtable) (let ((newlst (map (lambda (x) (if (> (length x) 1) (list (car x) (string-split (cadr x))) - x)) + (list x '()))) itemtable)) (res '())) ;; a list of items (let loop ((indx 0) (item '()) ;; an item will be ((KEYNAME1 VAL1)(KEYNAME2 VAL2) ...) (elflag #f)) Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -97,11 +97,14 @@ (if (file-exists? (conc lnkpath "/" testname)) (system (conc "rm -f " lnkpath "/" testname))) (system (conc "ln -sf " dfullp " " lnkpath "/" testname)) (if (directory? dfullp) (begin - (system (conc "rsync -av " test-path "/ " dfullp "/")) + (let* ((cmd (conc "rsync -av" (if (> *verbosity* 1) "" "q") " " test-path "/ " dfullp "/")) + (status (system cmd))) + (if (not (eq? status 0)) + (debug:print 2 "ERROR: problem with running \"" cmd "\""))) (list dfullp toptest-path)) (list #f #f)))) ;; 1. look though disks list for disk with most space ;; 2. create run dir on disk, path name is meaningful Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -124,15 +124,15 @@ ;;====================================================================== ;; Misc setup stuff ;;====================================================================== -(define *verbosity* (cond - ((args:get-arg "-debug")(string->number (args:get-arg "-debug"))) - ((args:get-arg "-v") 2) - ((args:get-arg "-q") 0) - (else 1))) +(set! *verbosity* (cond + ((args:get-arg "-debug")(string->number (args:get-arg "-debug"))) + ((args:get-arg "-v") 2) + ((args:get-arg "-q") 0) + (else 1))) ;;====================================================================== ;; Remove old run(s) ;;====================================================================== Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -315,13 +315,20 @@ (allitems (if (or (not (null? items))(not (null? itemstable))) (append (item-assoc->item-list items) (item-table->item-list itemstable)) '(()))) ;; a list with one null list is a test with no items (runconfigf (conc *toppath* "/runconfigs.config"))) - (debug:print 1 "items: ")(pp allitems) + (debug:print 1 "items: ") + (if (>= *verbosity* 1)(pp allitems)) + (if (>= *verbosity* 5) + (begin + (print "items: ")(pp (item-assoc->item-list items)) + (print "itestable: ")(pp (item-table->item-list itemstable)))) (if (args:get-arg "-m") (db:set-comment-for-run db run-id (args:get-arg "-m"))) + ;; braindead work-around for poorly specified allitems list BUG!!! FIXME + (if (null? allitems)(set! allitems '(()))) (let loop ((itemdat (car allitems)) (tal (cdr allitems))) ;; (lambda (itemdat) ;;; ((ripeness "overripe") (temperature "cool") (season "summer")) ;; Handle lists of items (let* ((item-path (item-list->path itemdat)) ;; (string-intersperse (map cadr itemdat) "/")) Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -2,11 +2,11 @@ MEGATEST=$(shell realpath ../megatest) runall : cd ../;make - $(MEGATEST) -keepgoing -runall :sysname ubuntu :fsname nfs :datapath none :runname `date +%GWW%V.%u` -m "This is a comment specific to a run" + $(MEGATEST) -keepgoing -runall :sysname ubuntu :fsname nfs :datapath none :runname `date +%GWW%V.%u` -m "This is a comment specific to a run" -v test : cd ../;make test make runall Index: tests/megatest.config ================================================================== --- tests/megatest.config +++ tests/megatest.config @@ -27,10 +27,12 @@ # in the testconfig [pre-launch-env-overrides] section [env-override] SPECIAL_ENV_VARS overide them here - should be seen at launch and in the runs TESTVAR [system realpath .] DEADVAR [system ls] +# XTERM [system xterm] +# RUNDEAD [system exit 56] ## disks are: ## name host:/path/to/area ## -or- ## name /path/to/area Index: tests/tests.scm ================================================================== --- tests/tests.scm +++ tests/tests.scm @@ -21,11 +21,11 @@ (equal? "/tmp" bestdir)))) ;; db (define row (vector "a" "b" "c" "blah")) (define header (list "col1" "col2" "col3" "col4")) -(test "Get row by header" "blah" (db-get-value-by-header row header "col4")) +(test "Get row by header" "blah" (db:get-value-by-header row header "col4")) ;; (define *toppath* "tests") (define *db* #f) (test "setup for run" #t (begin (setup-for-run) (string? (getenv "MT_RUN_AREA_HOME")))) @@ -52,16 +52,16 @@ (test "write env files" "nada.csh" (begin (save-environment-as-files "nada") (and (file-exists? "nada.sh") (file-exists? "nada.csh")))) -(test "get all legal tests" (list "runfirst" "sqlitespeed") (sort (get-all-legal-tests) string<=?)) +(test "get all legal tests" (list "runfirst" "runwithfirst" "singletest" "singletest2" "sqlitespeed") (sort (get-all-legal-tests) string<=?)) (test "register-test, test info" "NOT_STARTED" (begin (register-test *db* 1 "nada" "") - (test:get-state (runs:get-test-info *db* 1 "nada" "")))) + (test:get-state (db:get-test-info *db* 1 "nada" "")))) (test "get-keys" "sysname" (key:get-fieldname (car (sort (db-get-keys *db*)(lambda (a b)(string>=? (vector-ref a 0)(vector-ref b 0))))))) (define remargs (args:get-args '("bar" "foo" ":runname" "bob" ":sysname" "ubuntu" ":fsname" "nfs" ":datapath" "blah/foo" "nada") @@ -80,6 +80,15 @@ (alist->env-vars prevvals) result)) (test "env restored" "1234" (get-environment-variable "BLAHFOO")) - + +(test "Items assoc" "Elephant" (cadar (cadr (item-assoc->item-list '(("ANIMAL" "Elephant Lion")("SEASON" "Spring Fall")))))) +(set! *verbosity* 6) +(test "Items assoc" '()(item-assoc->item-list '(("a" "a b c d")("b" "c d e")("c" "")("d")))) +(set! *verbosity* -1) +(test "Items assoc empty items" '() (item-assoc->item-list '(("A")))) +(set! *verbosity* 1) +(test "Items table" "SEASON" (caadar (item-table->item-list '(("ANIMAL" "Elephant Lion")("SEASON" "Spring Winter"))))) +(test "Items table empty items I" '() (item-table->item-list '(("A")))) +(test "Items table empty items II" '() (item-table->item-list '(("A" "")))) Index: tests/tests/sqlitespeed/testconfig ================================================================== --- tests/tests/sqlitespeed/testconfig +++ tests/tests/sqlitespeed/testconfig @@ -4,6 +4,7 @@ [requirements] waiton runfirst [items] MANYITEMS [system (env > envfile.txt;echo aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au)] +# BORKED