Index: dashboard-tests.scm ================================================================== --- dashboard-tests.scm +++ dashboard-tests.scm @@ -209,14 +209,10 @@ (store-label "HostName" (iup:label ;; (sdb:qry 'getstr (db:test-get-host testdat) ;; ) #:expand "HORIZONTAL") (lambda (testdat)(db:test-get-host testdat))) - (store-label "Uname" - (iup:label " " #:expand "HORIZONTAL") - (lambda (testdat) ;; (sdb:qry 'getstr - (db:test-get-uname testdat))) ;; ) (store-label "DiskFree" (iup:label (conc (db:test-get-diskfree testdat)) #:expand "HORIZONTAL") (lambda (testdat)(conc (db:test-get-diskfree testdat)))) (store-label "CPULoad" (iup:label (conc (db:test-get-cpuload testdat)) #:expand "HORIZONTAL") @@ -228,11 +224,30 @@ (iup:label (conc (db:test-get-final_logf testdat)) #:expand "HORIZONTAL") (lambda (testdat)(conc (db:test-get-final_logf testdat)))) (store-label "ProcessId" (iup:label (conc (db:test-get-process_id testdat)) #:expand "HORIZONTAL") (lambda (testdat)(conc (db:test-get-process_id testdat)))) + (store-label "Uname" + (iup:label " " #:expand "HORIZONTAL") ;; #:wordwrap "YES") + (lambda (testdat) ;; (sdb:qry 'getstr + (db:test-get-uname testdat))) ;; ) ))))) + +;; if there is a submegatest create a button to launch dashboard in that area +;; +(define (submegatest-panel dbstruct keydat testdat runname testconfig) + (let* ((subarea (configf:lookup testconfig "setup" "submegatest")) + (area-exists (and subarea (file-exists? subarea)))) + (debug:print-info 0 "Megatest subarea=" subarea ", area-exists=" area-exists) + (if subarea + (iup:frame + #:title "Megatest Run Info" ; #:expand "YES" + (iup:button + "Launch Dashboard" + #:action (lambda (obj) + (system (conc "cd " subarea ";env -i PATH=$PATH DISPLAY=$DISPLAY HOME=$HOME USER=$USER dashboard &"))))) + (iup:vbox)))) ;; use a global for setting the buttons colors ;; state status teststeps (define *state-status* (vector #f #f #f)) (define (update-state-status-buttons testdat) @@ -412,10 +427,11 @@ (if (not testdat) (begin (debug:print 2 "ERROR: No test data found for test " test-id ", exiting") (exit 1)) (let* (;; (run-id (if testdat (db:test-get-run_id testdat) #f)) + (test-registry (tests:get-all)) (keydat (if testdat (db:get-key-val-pairs dbstruct run-id) #f)) (rundat (if testdat (db:get-run-info dbstruct run-id) #f)) (runname (if testdat (db:get-value-by-header (db:get-rows rundat) (db:get-header rundat) "runname") #f)) @@ -428,10 +444,11 @@ logfile)) ;; (testdat-path (conc rundir "/testdat.db")) ;; this gets recalculated until found (teststeps (if testdat (tests:get-compressed-steps dbstruct run-id test-id) '())) (testfullname (if testdat (db:test-get-fullname testdat) "Gathering data ...")) (testname (if testdat (db:test-get-testname testdat) "n/a")) + ;; (tests:get-testconfig testdat testname 'return-procs)) (testmeta (if testdat (let ((tm (db:testmeta-get-record dbstruct testname))) (if tm tm (make-db:testmeta))) (make-db:testmeta))) @@ -439,10 +456,17 @@ (map (lambda (keyval) ;; (conc ":" (car keyval) " " (cadr keyval))) (cadr keyval)) keydat) "/")) + (runconfig (let ((runconfigf (conc *toppath* "/runconfigs.config"))) + (if (file-exists? runconfigf) + (setup-env-defaults runconfigf run-id (make-hash-table) keydat keystring) + (make-hash-table)))) + (testconfig (begin + (runs:set-megatest-env-vars run-id inkeyvals: keydat inrunname: runname intarget: keystring) ;; these may be needed by the launching process + (tests:get-testconfig (db:test-get-testname testdat) test-registry #t))) (item-path (db:test-get-item-path testdat)) (viewlog (lambda (x) (if (file-exists? logfile) ;(system (conc "firefox " logfile "&")) (dashboard-tests:run-html-viewer logfile) @@ -612,11 +636,13 @@ ;; The run and test info (iup:hbox ; #:expand "YES" (run-info-panel dbstruct keydat testdat runname) (test-info-panel testdat store-label widgets) (test-meta-panel testmeta store-meta)) - (host-info-panel testdat store-label) + (iup:hbox + (host-info-panel testdat store-label) + (submegatest-panel dbstruct keydat testdat runname testconfig)) ;; The controls (iup:frame #:title "Actions" (iup:vbox (iup:hbox (iup:button "View Log" #:action viewlog #:size "80x") Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -484,13 +484,12 @@ (args:get-arg "-m") #f) ;; need to update the top test record if PASS or FAIL and this is a subtest ;; NO NEED TO CALL roll-up-pass-fail-counts HERE, THIS IS DONE IN roll-up-pass-fail-counts called by tests:test-set-status! )) ;; for automated creation of the rollup html file this is a good place... - ;; (if (and (not (equal? item-path "")) - ;; (< (random (rmt:get-count-tests-running-for-testname run-id test-name)) 5)) - (tests:summarize-items run-id test-id test-name #f) + (if (not (equal? item-path "")) + (tests:summarize-items run-id test-id test-name #f)) (tests:summarize-test run-id test-id) ;; don't force - just update if no ) (mutex-unlock! m) (debug:print 2 "Output from running " fullrunscript ", pid " (vector-ref exit-info 0) " in work area " work-area ":\n====\n exit code " (vector-ref exit-info 2) "\n" "====\n") Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -94,12 +94,13 @@ (safe-setenv (car varval)(cadr varval))) (configf:get-section runconfig section))) (list "default" target)) (vector target runname testpatt keys keyvals envdat mconfig runconfig serverdat transport db toppath run-id))) -(define (runs:set-megatest-env-vars run-id #!key (inkeys #f)(inrunname #f)(inkeyvals #f)) - (let* ((target (or (common:args-get-target) +(define (runs:set-megatest-env-vars run-id #!key (inkeys #f)(inrunname #f)(inkeyvals #f)(intarget #f)) + (let* ((target (or intarget + (common:args-get-target) (get-environment-variable "MT_TARGET"))) (keys (if inkeys inkeys (rmt:get-keys))) (keyvals (if inkeyvals inkeyvals (keys:target->keyval keys target))) (vals (hash-table-ref/default *env-vars-by-run-id* run-id #f)) (link-tree (configf:lookup *configdat* "setup" "linktree"))) Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -627,11 +627,13 @@ ;; (last (string-split testp "/"))) ;; tests))))) (define (tests:get-testconfig test-name test-registry system-allowed) - (let* ((test-path (hash-table-ref/default test-registry test-name (conc *toppath* "/tests/" test-name))) + (let* ((test-path (hash-table-ref/default + test-registry test-name + (conc *toppath* "/tests/" test-name))) (test-configf (conc test-path "/testconfig")) (testexists (and (file-exists? test-configf)(file-read-access? test-configf))) (tcfg (if testexists (read-config test-configf #f system-allowed environ-patt: (if system-allowed "pre-launch-env-vars"