Index: dashboard-tests.scm ================================================================== --- dashboard-tests.scm +++ dashboard-tests.scm @@ -430,12 +430,17 @@ (sort (hash-table-values comprsteps) (lambda (a b) (let ((time-a (vector-ref a 1)) (time-b (vector-ref b 1))) (if (and (number? time-a)(number? time-b)) - (< time-a time-b) - #t)))))) + (if (< time-a time-b) + #t + (if (eq? time-a time-b) + (string (conc (vector-ref a 2)) + (conc (vector-ref b 2))) + #f)) + (string (conc time-a)(conc time-b)))))))) "\n"))) (if (not (equal? currval newval)) (iup:attribute-set! stepsdat "VALUE" newval ))))) ;; "TITLE" newval))))) stepsdat)) ;; populate the Test Data panel Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1598,14 +1598,15 @@ "\nstate: " (db:step-get-state step) "\nstatus: " (db:step-get-status step) "\ntime: " (db:step-get-event_time step)))) ;; (else (vector-set! record 1 (db:step-get-event_time step))) (sort steps (lambda (a b) - - (< (db:step-get-event_time a)(db:step-get-event_time b)) - - ))) + (cond + ((< (db:step-get-event_time a)(db:step-get-event_time b)) #t) + ((eq? (db:step-get-event_time a)(db:step-get-event_time b)) + (< (db:step-get-id a) (db:step-get-id b))) + (else #f))))) res))) ;;====================================================================== ;; M I S C M A N A G E M E N T I T E M S ;;====================================================================== Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -53,11 +53,11 @@ (define (launch:execute encoded-cmd) (let* ((cmdinfo (read (open-input-string (base64:base64-decode encoded-cmd))))) (setenv "MT_CMDINFO" encoded-cmd) (if (list? cmdinfo) ;; ((testpath /tmp/mrwellan/jazzmind/src/example_run/tests/sqlitespeed) ;; (test-name sqlitespeed) (runscript runscript.rb) (db-host localhost) (run-id 1)) - (let* ((testpath (assoc/default 'testpath cmdinfo)) + (let* ((testpath (assoc/default 'testpath cmdinfo)) ;; How is testpath different from work-area ?? (top-path (assoc/default 'toppath cmdinfo)) (work-area (assoc/default 'work-area cmdinfo)) (test-name (assoc/default 'test-name cmdinfo)) (runscript (assoc/default 'runscript cmdinfo)) (ezsteps (assoc/default 'ezsteps cmdinfo)) @@ -69,11 +69,19 @@ (env-ovrd (assoc/default 'env-ovrd cmdinfo)) (set-vars (assoc/default 'set-vars cmdinfo)) ;; pre-overrides from -setvar (runname (assoc/default 'runname cmdinfo)) (megatest (assoc/default 'megatest cmdinfo)) (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) - (fullrunscript (if runscript (conc testpath "/" runscript) #f)) + (fullrunscript (if (not runscript) + #f + (if (substring-index "/" runscript) + runscript ;; use unadultered if contains slashes + (let ((fulln (conc testpath "/" runscript))) + (if (and (file-exists? fulln) + (file-execute-access? fulln)) + fulln + runscript))))) ;; assume it is on the path (rollup-status 0)) (debug:print 2 "Exectuing " test-name " (id: " test-id ") on " (get-host-name)) ;; apply pre-overrides before other variables. The pre-override vars must not ;; clobbers things from the official sources such as megatest.config and runconfigs.config Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -116,11 +116,11 @@ # Get test path, use '.' to get a single path or a specific path/file pattern megatest -test-files 'logs/*.log' -target ubuntu/n%/no% :runname w49% -testpatt test_mt% Called as " (string-intersperse (argv) " ") " -Built from " megatest-fossil-hash )) +Version " megatest-version ", built from " megatest-fossil-hash )) ;; -gui : start a gui interface ;; -config fname : override the runconfig file with fname ;; -kill-server host:port|pid : kill server specified by host:port or pid @@ -471,13 +471,12 @@ "-runall" "run all tests" (lambda (target runname keys keynames keyvallst) (runs:run-tests target runname - (if (args:get-arg "-testpatt") - (args:get-arg "-testpatt") - "%/%") + "%" + (args:get-arg "-testpatt") user args:arg-hash)))) ;;====================================================================== ;; run one test @@ -502,10 +501,11 @@ "run a test" (lambda (target runname keys keynames keyvallst) (runs:run-tests target runname (args:get-arg "-runtests") + (args:get-arg "-testpatt") user args:arg-hash)))) ;;====================================================================== ;; Rollup into a run Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -193,20 +193,24 @@ (begin (debug:print 0 "ERROR: Called without all necessary keys") #f)))) ;; This is a duplicate of run-tests (which has been deprecated). Use this one instead of run tests. -;; keyvals -(define (runs:run-tests target runname test-patts user flags) +;; keyvals. +;; +;; test-names: Comma separated patterns same as test-patts but used in selection +;; of tests to run. The item portions are not respected. +;; FIXME: error out if /patt specified +;; +(define (runs:run-tests target runname test-names test-patts user flags) (let* ((db #f) (keys (cdb:remote-run db:get-keys #f)) (keyvallst (keys:target->keyval keys target)) (run-id (cdb:remote-run runs:register-run #f keys keyvallst runname "new" "n/a" user)) ;; test-name))) (deferred '()) ;; delay running these since they have a waiton clause ;; keepgoing is the defacto modality now, will add hit-n-run a bit later ;; (keepgoing (hash-table-ref/default flags "-keepgoing" #f)) - (test-names '()) (runconfigf (conc *toppath* "/runconfigs.config")) (required-tests '()) (test-records (make-hash-table))) (set-megatest-env-vars run-id) ;; these may be needed by the launching process @@ -216,11 +220,11 @@ (debug:print 0 "WARNING: You do not have a run config file: " runconfigf)) ;; look up all tests matching the comma separated list of globs in ;; test-patts (using % as wildcard) - (set! test-names (tests:get-valid-tests *toppath* test-patts test-names: test-names)) + (set! test-names (tests:get-valid-tests *toppath* test-names)) (set! test-names (delete-duplicates test-names)) (debug:print-info 0 "test names " test-names) ;; on the first pass or call to run-tests set FAILS to NOT_STARTED if Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -27,20 +27,19 @@ (include "key_records.scm") (include "db_records.scm") (include "run_records.scm") (include "test_records.scm") -(define (tests:get-valid-tests testsdir test-patts #!key (test-names '())) +(define (tests:get-valid-tests testsdir test-patts) ;; #!key (test-names '())) (let ((tests (glob (conc testsdir "/tests/*")))) ;; " (string-translate patt "%" "*"))))) (set! tests (filter (lambda (test)(file-exists? (conc test "/testconfig"))) tests)) (delete-duplicates - (append test-names - (filter (lambda (testname) - (tests:match test-patts testname #f)) - (map (lambda (testp) - (last (string-split testp "/"))) - tests)))))) + (filter (lambda (testname) + (tests:match test-patts testname #f)) + (map (lambda (testp) + (last (string-split testp "/"))) + tests))))) ;; tests:glob-like-match (define (tests:glob-like-match patt str) (let ((like (substring-index "%" patt))) (let* ((notpatt (equal? (substring-index "~" patt) 0)) @@ -305,11 +304,11 @@ (let ((oup (open-output-file outputfilename)) (counts (make-hash-table)) (statecounts (make-hash-table)) (outtxt "") (tot 0) - (testdat (cdb:remote-run db:test-get-records-for-index-file run-id test-name))) + (testdat (cdb:remote-run db:test-get-records-for-index-file #f run-id test-name))) (with-output-to-port oup (lambda () (set! outtxt (conc outtxt "