Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -392,11 +392,13 @@ "-runall" "run all tests" (lambda (target runname keys keynames keyvallst) (runs:run-tests target runname - (args:get-arg "-runtests") + (if (args:get-arg "-testpatt") + (args:get-arg "-testpatt") + "%/%") user args:arg-hash)))) ;; ) ;;====================================================================== ;; run one test Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -387,11 +387,11 @@ (map (lambda (t) (if (vector? t) (conc (db:test-get-state t) "/" (db:test-get-status t)) (conc " WARNING: t is not a vector=" t ))) prereqs-not-met) ", ") " fails: " fails) - (debug:print 4 "INFO: hed=" hed) + (debug:print 4 "INFO: hed=" hed "\n test-record=" test-record "\n test-name: " test-name "\n item-path: " item-path "\n test-patts: " test-patts) ;; Don't know at this time if the test have been launched at some time in the past ;; i.e. is this a re-launch? (debug:print 4 "INFO: run-limits-info = " run-limits-info) (cond ;; INNER COND #1 for a launchable test @@ -403,10 +403,11 @@ (thread-sleep! *global-delta*) (if (not (null? tal)) (loop (car tal)(cdr tal) reruns))) ((and (not (hash-table-ref/default test-registery (runs:make-full-test-name test-name item-path) #f)) (and max-concurrent-jobs (> (- max-concurrent-jobs num-running) 5))) + (debug:print 4 "INFO: Pre-registering test " test-name "/" item-path " to create placeholder" ) (open-run-close db:tests-register-test #f run-id test-name item-path) (hash-table-set! test-registery (runs:make-full-test-name test-name item-path) #t) (thread-sleep! *global-delta*) (loop (car newtal)(cdr newtal) reruns)) ((not have-resources) ;; simply try again after waiting a second @@ -487,11 +488,13 @@ "\n fails: " (runs:pretty-string fails) "\n testmode: " testmode "\n num-retries: " num-retries "\n (eq? testmode 'toplevel): " (eq? testmode 'toplevel) "\n (null? non-completed): " (null? non-completed) - "\n reruns: " reruns) + "\n reruns: " reruns + "\n items: " items + "\n can-run-more: " can-run-more) (cond ;; INNER COND #2 ((or (null? prereqs-not-met) ;; all prereqs met, fire off the test ;; or, if it is a 'toplevel test and all prereqs not met are COMPLETED then launch (and (eq? testmode 'toplevel) @@ -510,11 +513,17 @@ (debug:print 0 "ERROR: The proc from reading the setup did not yield a list - please report this") (exit 1)))))) ((null? fails) (debug:print 4 "INFO: fails is null, moving on in the queue but keeping " hed " for now") (thread-sleep! *global-delta*) - (loop (car newtal)(cdr newtal) reruns)) ;; an issue with prereqs not yet met? + ;; only increment num-retries when there are no tests runing + (if (eq? 0 (list-ref can-run-more 1)) + (set! num-retries (+ num-retries 1))) + (if (> num-retries max-retries) + (if (not (null? tal)) + (loop (car tal)(cdr tal) reruns)) + (loop (car newtal)(cdr newtal) reruns))) ;; an issue with prereqs not yet met? ((and (not (null? fails))(eq? testmode 'normal)) (debug:print 1 "INFO: test " hed " (mode=" testmode ") has failed prerequisite(s); " (string-intersperse (map (lambda (t)(conc (db:test-get-testname t) ":" (db:test-get-state t)"/"(db:test-get-status t))) fails) ", ") ", removing it from to-do list") (if (not (null? tal)) Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -27,10 +27,12 @@ cd simplerun;cp ../../*_records.scm .;perl -pi.bak -e 's/define-inline/define/' *_records.scm cd simplerun;echo '(load "../tests.scm")' | $(MEGATEST) -repl -debug $(DEBUG) test2 : fullprep cd fullrun;$(MEGATEST) -runtests ez_pass,runfirst/a/% -reqtarg ubuntu/nfs/none :runname $(RUNNAME) $(SERVER) -debug $(DEBUG) $(LOGGING) + cd fullrun;megatest -runall -target ubunut/nfs/none :runname $(RUNNAME)_01 -testpatt %/,%/ai -debug $(DEBUG) + cd fullrun;megatest -runtests %/,%/ai -target ubunut/nfs/none :runname $(RUNAME)_02 -debug $(DEBUG) sleep 40;cd fullrun;megatest -target ubuntu/nfs/none :runname $(RUNNAME) -set-state-status COMPLETED,FORCED :state COMPLETED :status PASS -testpatt ez_p%s,runfirst/ -debug $(DEBUG) $(LOGGING) test3 : fullprep cd fullrun;$(MEGATEST) -runtests runfirst -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b $(SERVER) -debug 10 Index: tests/tests.scm ================================================================== --- tests/tests.scm +++ tests/tests.scm @@ -38,14 +38,14 @@ (for-each (lambda (patterns testname itempath expected) (test (conc patterns " " testname "/" itempath "=>" expected) expected (tests:match patterns testname itempath))) - (list "abc" "abc/%" "ab%/c%" "~abc/c%" "abc/~c%" "a,b/c,%/d") - (list "abc" "abc" "abcd" "abc" "abc" "a" ) - (list "" "" "cde" "cde" "cde" "" ) - (list #t #t #t #f #f #t)) + (list "abc" "abc/%" "ab%/c%" "~abc/c%" "abc/~c%" "a,b/c,%/d" "%/,%/a" "%/,%/a" "%/,%/a") + (list "abc" "abc" "abcd" "abc" "abc" "a" "abc" "def" "ghi" ) + (list "" "" "cde" "cde" "cde" "" "" "a" "b" ) + (list #t #t #t #f #f #t #t #t #f )) ;; db:patt->like (test #f "testname LIKE 't%'" (db:patt->like "testname" "t%" comparator: " AND ")) (test #f "testname LIKE 't%' AND testname LIKE '%t'" (db:patt->like "testname" "t%,%t" comparator: " AND ")) (test #f "item_path GLOB ''" (db:patt->like "item_path" ""))