Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -156,10 +156,17 @@ mkdir -p $(PREFIX)/bin/.$(ARCHSTR) test: tests/tests.scm cd tests;csi -I .. -b -n tests.scm +ext-tests/.fslckout : $(MTQA_FOSSIL) + mkdir -p ext-tests + cd ext-tests;fossil open --nested $(MTQA_FOSSIL) + +$(MTQA_FOSSIL) : + fossil clone https://www.kiatoa.com/fossils/megatest_qa $(MTQA_FOSSIL) + clean : rm -f $(OFILES) $(GOFILES) megatest dboard dboard.o megatest.o dashboard.o # Deploy section (not complete yet) # Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -665,11 +665,11 @@ ;;====================================================================== ;; E N V I R O N M E N T V A R S ;;====================================================================== -(define (save-environment-as-files fname #!key (ignorevars (list "USER" "HOME" "DISPLAY" "LS_COLORS" "XKEYSYMDB" "EDITOR" "MAKEFLAGS" "MAKEF"))) +(define (save-environment-as-files fname #!key (ignorevars (list "USER" "HOME" "DISPLAY" "LS_COLORS" "XKEYSYMDB" "EDITOR" "MAKEFLAGS" "MAKEF" "MAKEOVERRIDES"))) (let ((envvars (get-environment-variables)) (whitesp (regexp "[^a-zA-Z0-9_\\-:,.\\/%$]"))) (with-output-to-file (conc fname ".csh") (lambda () (for-each (lambda (keyval) @@ -711,10 +711,36 @@ (setenv var (->string val)) (unsetenv var)))) lst) res) '())) + +;; clear vars matching pattern, run proc, set vars back +;; if proc is a string run that string as a command with +;; system. +;; +(define (common:without-vars proc . var-patts) + (let ((vars (make-hash-table))) + (for-each + (lambda (vardat) ;; each env var + (for-each + (lambda (var-patt) + (if (string-match var-patt (car vardat)) + (let ((var (car vardat)) + (val (cdr vardat))) + (hash-table-set! vars var val) + (unsetenv var)))) + var-patts)) + (get-environment-variables)) + (cond + ((string? proc)(system proc)) + (proc (proc))) + (hash-table-for-each + vars + (lambda (var val) + (setenv var val))) + vars)) ;;====================================================================== ;; time and date nice to have stuff ;;====================================================================== Index: dashboard-tests.scm ================================================================== --- dashboard-tests.scm +++ dashboard-tests.scm @@ -490,12 +490,14 @@ (xterm (lambda (x) (if (directory-exists? rundir) (let ((shell (if (get-environment-variable "SHELL") (conc "-e " (get-environment-variable "SHELL")) ""))) - (system (conc "cd " rundir - ";mt_xterm -T \"" (string-translate testfullname "()" " ") "\" " shell "&"))) + (common:without-vars + (conc "cd " rundir + ";mt_xterm -T \"" (string-translate testfullname "()" " ") "\" " shell "&") + "MT_.*")) (message-window (conc "Directory " rundir " not found"))))) (widgets (make-hash-table)) (refreshdat (lambda () (let* ((curr-mod-time (file-modification-time db-path)) ;; (max ..... (if (file-exists? testdat-path) @@ -572,18 +574,34 @@ (iup:attribute-set! lbl "TITLE" newval) ;(mutex-unlock! mx1) ))))) lbl)) (store-button store-label) - (command-text-box (iup:textbox #:expand "HORIZONTAL" #:font "Courier New, -10")) + (command-proc (lambda (command-text-box) + (let* ((cmd (iup:attribute command-text-box "VALUE")) + (fullcmd (conc (dtests:get-pre-command) + cmd + (dtests:get-post-command)))) + (debug:print-info 02 "Running command: " fullcmd) + (common:without-vars fullcmd "MT_.*")))) + (command-text-box (iup:textbox + #:expand "HORIZONTAL" + #:font "Courier New, -10" + #:action (lambda (obj cnum val) + ;; (print "cnum=" cnum) + (if (eq? cnum 13) + (command-prox obj))) + )) (command-launch-button (iup:button "Execute!" #:action (lambda (x) - (let* ((cmd (iup:attribute command-text-box "VALUE")) - (fullcmd (conc (dtests:get-pre-command) - cmd - (dtests:get-post-command)))) - (debug:print-info 02 "Running command: " fullcmd) - (system fullcmd))))) + (command-proc command-text-box)))) + ;; (lambda (x) + ;; (let* ((cmd (iup:attribute command-text-box "VALUE")) + ;; (fullcmd (conc (dtests:get-pre-command) + ;; cmd + ;; (dtests:get-post-command)))) + ;; (debug:print-info 02 "Running command: " fullcmd) + ;; (common:without-vars fullcmd "MT_.*"))))) (kill-jobs (lambda (x) (iup:attribute-set! command-text-box "VALUE" (conc "megatest -target " keystring " -runname " runname " -set-state-status KILLREQ,n/a -testpatt %/% " @@ -603,22 +621,24 @@ " -testpatt " (conc testname "/" (if (equal? item-path "") "%" item-path)) " -v")))) (clean-run-execute (lambda (x) - (let ((cmd (conc "bmegatest -remove-runs -target " keystring " -runname " runname + (let ((cmd (conc "megatest -remove-runs -target " keystring " -runname " runname " -testpatt " (conc testname "/" (if (equal? item-path "") - "%" - item-path)) + "%" + item-path)) ";megatest -target " keystring " -runname " runname - " -runtests " (conc testname "/" (if (equal? item-path "") + " -run -preclean -testpatt " (conc testname "/" (if (equal? item-path "") "%" item-path)) ))) - (system (conc (dtests:get-pre-command) - cmd - (dtests:get-post-command)))))) + (common:without-vars + (conc (dtests:get-pre-command) + cmd + (dtests:get-post-command)) + "MT_.*")))) (remove-test (lambda (x) (iup:attribute-set! command-text-box "VALUE" (conc "megatest -remove-runs -target " keystring " -runname " runname " -testpatt " (conc testname "/" (if (equal? item-path "") Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -3268,19 +3268,20 @@ ;;====================================================================== ;; A routine to map itempaths using a itemmap ;; patha and pathb must be strings or this will fail ;; -(define (db:compare-itempaths patha pathb itemmaps) +;; path-b is waiting on path-a +;; +(define (db:compare-itempaths test-b-name path-a path-b itemmaps ) (debug:print-info 6 "ITEMMAPS: " itemmaps) - (let* ((testname-a (car (string-split patha "/"))) - (itemmap (tests:lookup-itemmap itemmaps testname-a))) + (let* ((itemmap (tests:lookup-itemmap itemmaps test-b-name))) (if itemmap - (let ((pathb-mapped (db:multi-pattern-apply pathb itemmap))) - (debug:print-info 6 "ITEMMAP is " itemmap ", path: " pathb ", mapped path: " pathb-mapped) - (equal? patha pathb-mapped)) - (equal? patha pathb)))) + (let ((path-b-mapped (db:multi-pattern-apply path-b itemmap))) + (debug:print-info 6 "ITEMMAP is " itemmap ", path: " path-b ", mapped path: " path-b-mapped) + (equal? path-a path-b-mapped)) + (equal? path-b path-a)))) ;; A routine to convert test/itempath using a itemmap ;; NOTE: to process only an itempath (i.e. no prepended testname) ;; just call db:multi-pattern-apply ;; @@ -3324,11 +3325,11 @@ ;; Note: mode 'normal means that tests must be COMPLETED and ok (i.e. PASS, WARN, CHECK, SKIP or WAIVED) ;; mode 'toplevel means that tests must be COMPLETED only ;; mode 'itemmatch or 'itemwait means that tests items must be COMPLETED and (PASS|WARN|WAIVED|CHECK) [[ NB// NOT IMPLEMENTED YET ]] ;; ;; (define (db:get-prereqs-not-met dbstruct run-id waitons ref-item-path mode) -(define (db:get-prereqs-not-met dbstruct run-id waitons ref-item-path mode itemmaps) ;; #!key (mode '(normal))(itemmap #f)) +(define (db:get-prereqs-not-met dbstruct run-id waitons ref-test-name ref-item-path mode itemmaps) ;; #!key (mode '(normal))(itemmap #f)) (if (or (not waitons) (null? waitons)) '() (let* ((unmet-pre-reqs '()) (result '())) @@ -3349,11 +3350,12 @@ (item-path (db:test-get-item-path test)) (is-completed (equal? state "COMPLETED")) (is-running (equal? state "RUNNING")) (is-killed (equal? state "KILLED")) (is-ok (member status '("PASS" "WARN" "CHECK" "WAIVED" "SKIP"))) - (same-itempath (db:compare-itempaths item-path ref-item-path itemmaps))) ;; (equal? ref-item-path item-path))) + ;; testname-b path-a path-b + (same-itempath (db:compare-itempaths ref-test-name item-path ref-item-path itemmaps))) ;; (equal? ref-item-path item-path))) (set! ever-seen #t) (cond ;; case 1, non-item (parent test) is ((and (equal? item-path "") ;; this is the parent test of the waiton being examined is-completed Index: docs/manual/megatest_manual.html ================================================================== --- docs/manual/megatest_manual.html +++ docs/manual/megatest_manual.html @@ -1291,86 +1291,76 @@
[requirements] waiton A B [itemmap] A (\d+)/aa aa/\1 -B (\d+)/bb bb/\1- -
[requirements] -waiton C -itemmap (\d+)/res \1/aa-
[requirements] -waiton C -itemmap (\d+)/res \1/bb-
[requirements] -# With a toplevel test you may wish to generate your list +B (\d+)/bb -------------------- + +.Testconfig for Test D+
waiton C +itemmap (\d+)/res \1/aa
.Testconfig for Test E+
waiton C +itemmap (\d+)/res \1/bb
Dynamic Flow Dependency Tree +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.Autogeneration waiton list for dynamic flow dependency trees+
# With a toplevel test you may wish to generate your list # of tests to run dynamically # -# waiton #{shell get-valid-tests-to-run.sh} -
runtimelim 1h 2m 3s # this will automatically kill the test if it runs for more than 1h 2m and 3s-
A test with a skip section will conditional skip running.
[skip] -prevrunning x -# rundelay 30m 15s-
# NB// If the prevrunning line exists with *any* value the test will +waiton #{shell get-valid-tests-to-run.sh}
Run time limit +^^^^^^^^^^^^^^+
runtimelim 1h 2m 3s # this will automatically kill the test if it runs for more than 1h 2m and 3s
Skip +^^^^ + +A test with a skip section will conditional skip running. + +.Skip section example+
prevrunning x +# rundelay 30m 15s
Skip on Still-running Tests +^^^^^^^^^^^^^^^^^^^^^^^^^^^+
# NB// If the prevrunning line exists with any value the test will # automatically SKIP if the same-named test is currently RUNNING. The # "x" can be any string. Comment out the prevrunning line to turn off -# skip. - -[skip] -prevrunning x -
[skip] -fileexists /path/to/a/file # skip if /path/to/a/file exists-
[skip] -rundelay 15m 15s-
prevrunning x
Skip if a File Exists +^^^^^^^^^^^^^^^^^^^^^+
fileexists /path/to/a/file # skip if /path/to/a/file exists
Skip if test ran more recently than specified time +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.Skip if this test has been run in the past fifteen minutes and 15 seconds.+
A disks section in testconfig will override the disks section in megatest.config. This can be used to allocate disks on a per-test or per item @@ -1397,11 +1387,10 @@ # diff diff %file1% %file2% # This builtin rule is applied if a <waivername>.logpro file exists # logpro diff %file1% %file2% | logpro %waivername%.logpro %waivername%.html
# Override the rollup for specific tests [testrollup] runfirst mysummary.sh
In megatest.config add the following sections: