Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -73,13 +73,13 @@ (define (patt-list-match item patts) (if (and item patts) ;; here we are filtering for matches with -itempatt (let ((res #f)) ;; look through all the item-patts if defined, format is patt1,patt2,patt3 ... wildcard is % (for-each (lambda (patt) - (if (string-match (glob->regexp - (string-translate patt "%" "*")) - item) + (if (string-match + (regexp (string-substitute "%" ".*" "a%b")) ;;(glob->regexp (string-translate patt "%" "*")) + item) (set! res #t))) (string-split patts ",")) res) #t)) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -433,15 +433,20 @@ ;; i.e. these lists define what to NOT show. ;; states and statuses are required to be lists, empty is ok ;; not-in #t = above behaviour, #f = must match (define (db:get-tests-for-run db run-id testpatt itempatt states statuses #!key (not-in #t)) (let* ((res '()) - (states-str (conc "('" (string-intersperse states "','") "')")) - (statuses-str (conc "('" (string-intersperse statuses "','") "')")) + ;; if states or statuses are null then assume match all when not-in is false + (states-str (conc " state in ('" (string-intersperse states "','") "')")) + (statuses-str (conc " status in ('" (string-intersperse statuses "','") "')")) + (state-status-qry (if (or (not (null? states)) + (not (null? states))) + (conc " AND " (if not-in "NOT" "") " (" states-str " AND " statuses-str ") ") + "")) (qry (conc "SELECT id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment " " FROM tests WHERE run_id=? AND testname like ? AND item_path LIKE ? " - " AND " (if not-in "NOT" "") " (state in " states-str " AND status IN " statuses-str ") " + state-status-qry ;; " ORDER BY id DESC;" " ORDER BY event_time ASC;" ;; POTENTIAL ISSUE! CHECK ME! Does anyting depend on this being sorted by id? ))) (debug:print 8 "INFO: db:get-tests-for-run qry=" qry) (sqlite3:for-each-row Index: megatest-version.scm ================================================================== --- megatest-version.scm +++ megatest-version.scm @@ -1,7 +1,7 @@ ;; Always use two digit decimal ;; 1.01, 1.02...1.10,1.11 ... 1.99,2.00.. (declare (unit megatest-version)) -(define megatest-version 1.41) +(define megatest-version 1.42) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -74,10 +74,11 @@ (setenv (key:get-fieldname key) val)) db (conc "SELECT " (key:get-fieldname key) " FROM runs WHERE id=?;") run-id)) keys) + (alist->env-vars (hash-table-ref/default *configdat* "env-override" '())) ;; Lets use this as an opportunity to put MT_RUNNAME in the environment (sqlite3:for-each-row (lambda (runname) (setenv "MT_RUNNAME" runname)) db Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -23,11 +23,11 @@ $(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_aa -v $(SERVER) >& aa.log & $(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ab -v $(SERVER) >& ab.log & $(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ac -v $(SERVER) >& ac.log & $(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ad -v $(SERVER) >& ad.log & -cleanprep : ../*.scm +cleanprep : ../*.scm Makefile *.config sqlite3 megatest.db "delete from metadat where var='SERVER';" mkdir -p /tmp/mt_runs /tmp/mt_links cd ..;make install $(MEGATEST) -remove-runs :runname $(RUNNAME)% -target %/%/% -testpatt % -itempatt % $(BINPATH)/dboard -rows 15 & Index: tests/megatest.config ================================================================== --- tests/megatest.config +++ tests/megatest.config @@ -36,10 +36,11 @@ WACKYVAR2 #{get validvalues state} WACKYVAR3 #{getenv USER} WACKYVAR4 #{scheme (+ 5 6 7)} WACKYVAR5 #{getenv sysname}/#{getenv fsname}/#{getenv datapath} WACKYVAR6 #{scheme (args:get-arg "-target")} +PREDICTABLE the_ans # XTERM [system xterm] # RUNDEAD [system exit 56] ## disks are: Index: tests/tests/test_mt_vars/testconfig ================================================================== --- tests/tests/test_mt_vars/testconfig +++ tests/tests/test_mt_vars/testconfig @@ -12,11 +12,11 @@ [requirements] waiton runfirst priority 0 [items] -NUMNUM [system cat $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/the_ans] +NUMNUM [system cat $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/$PREDICTABLE] [test_meta] author matt owner bob description This test runs a single ezstep which is expected to pass, no logpro file.