Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -119,11 +119,11 @@ (let ((num (any->number val))) (if num num val))) (define (patt-list-match item patts) (debug:print-info 8 "patt-list-match item=" item " patts=" patts) - (if (and item patts) ;; here we are filtering for matches with -itempatt + (if (and item patts) ;; here we are filtering for matches with item patterns (let ((res #f)) ;; look through all the item-patts if defined, format is patt1,patt2,patt3 ... wildcard is % (for-each (lambda (patt) (let ((modpatt (string-substitute "%" ".*" patt #t))) (debug:print-info 10 "patt " patt " modpatt " modpatt) Index: dashboard-guimonitor.scm ================================================================== --- dashboard-guimonitor.scm +++ dashboard-guimonitor.scm @@ -54,11 +54,11 @@ (map (lambda (var) (iup:hbox (iup:label var #:size "60x15") (iup:textbox #:expand "HORIZONTAL" #:action (lambda (obj a val) (hash-table-set! var-params var val))))) - (list "runname" "testpatts" "itempatts" "params"))))) + (list "runname" "testpatts" "params"))))) (controls (iup:frame #:title "Controls" (iup:hbox (iup:frame #:title "Runs" Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -741,12 +741,10 @@ (lambda (a . b) ;; id run-id testname state status event-time host cpuload diskfree uname rundir item-path run-duration final-logf comment) (set! res (cons (apply vector a b) res))) ;; id run-id testname state status event-time host cpuload diskfree uname rundir item-path run-duration final-logf comment) res))) db qry run-id - ;; (if testpatt testpatt "%") - ;; (if itempatt itempatt "%")) ) (debug:print-info 11 "db:get-tests-for-run START run-id=" run-id ", testpatt=" testpatt ", states=" states ", statuses=" statuses ", not-in=" not-in ", sort-by=" sort-by) res)) ;; this one is a bit broken BUG FIXME @@ -1050,58 +1048,10 @@ (car newres) (if (null? tal) #f (loop (car tal)(cdr tal)))))))))) - -(define (db:test-get-test-records-matching db keynames target) - (let* ((res '()) - (itempatt (if (args:get-arg "-itempatt")(args:get-arg "-itempatt") "%")) - (testpatt (if (args:get-arg "-testpatt")(args:get-arg "-testpatt") "%")) - (statepatt (if (args:get-arg ":state") (args:get-arg ":state") "%")) - (statuspatt (if (args:get-arg ":status") (args:get-arg ":status") "%")) - (runname (if (args:get-arg ":runname") (args:get-arg ":runname") "%")) - (keystr (string-intersperse - (map (lambda (key val) - (conc "r." key " like '" val "'")) - keynames - (string-split target "/")) - " AND ")) - (qrystr (conc "SELECT - t.id - t.run_id - t.testname - t.host - t.cpuload - t.diskfree - t.uname - t.rundir - t.shortdir - t.item_path - t.state - t.status - t.attemptnum - t.final_logf - t.logdat - t.run_duratio - t.comment - t.event_time - t.fail_count - t.pass_count - t.archived - FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.id WHERE " - keystr " AND r.runname LIKE '" runname "' AND item_path LIKE '" itempatt "' AND testname LIKE '" - testpatt "' AND t.state LIKE '" statepatt "' AND t.status LIKE '" statuspatt - "'ORDER BY t.event_time ASC;"))) - (debug:print 3 "qrystr: " qrystr) - (sqlite3:for-each-row - (lambda (p) - (set! res (cons p res))) - db - qrystr) - res)) - ;;====================================================================== ;; QUEUE UP META, TEST STATUS AND STEPS REMOTE ACCESS ;;====================================================================== ;; db:updater is run in a thread to write out the cached data periodically Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -142,11 +142,10 @@ ":runname" ":state" ":status" "-list-runs" "-testpatt" - "-itempatt" "-setlog" "-set-toplog" "-runstep" "-logpro" "-m" @@ -236,35 +235,10 @@ (if (args:get-arg "-logging")(set! *logging* #t)) (if (debug:debug-mode 3) ;; we are obviously debugging (set! open-run-close open-run-close-no-exception-handling)) -;; a,b,c % => a/%,b/%,c/% -(define (tack-on-patt srcstr patt) - (let ((strlst (string-split srcstr ","))) - (string-intersperse - (map (lambda (str) - (if (not (substring-index "/" str)) - (conc str "/" patt) - str)) - strlst) - ","))) - -;; to try and not burden Kim too much... -(if (args:get-arg "-itempatt") - (let ((old-testpatt (args:get-arg "-testpatt"))) - ;; (debug:print 0 "ERROR: parameter \"-itempatt\" has been deprecated. For now I will tweak your -testpatt for you") - (if (args:get-arg "-testpatt") - (hash-table-set! args:arg-hash "-testpatt" (tack-on-patt old-testpatt (args:get-arg "-itempatt")))) - ;; (debug:print 0 " old: " old-testpatt ", new: " (args:get-arg "-testpatt")) - (if (args:get-arg "-runtests") - (begin - ;; (debug:print 0 "NOTE: Also modifying -runtests") - (hash-table-set! args:arg-hash "-runtests" (tack-on-patt (args:get-arg "-runtests") - (args:get-arg "-itempatt"))))) - )) - ;;====================================================================== ;; Misc general calls ;;====================================================================== (if (args:get-arg "-env2file") @@ -574,11 +548,11 @@ user)))) ;;====================================================================== ;; Get paths to tests ;;====================================================================== -;; Get test paths matching target, runname, testpatt, and itempatt +;; Get test paths matching target, runname, and testpatt (if (or (args:get-arg "-test-files")(args:get-arg "-test-paths")) ;; if we are in a test use the MT_CMDINFO data (if (getenv "MT_CMDINFO") (let* ((startingdir (current-directory)) (cmdinfo (read (open-input-string (base64:base64-decode (getenv "MT_CMDINFO"))))) @@ -615,20 +589,19 @@ (general-run-call "-test-files" "Get paths to test" (lambda (target runname keys keynames keyvallst) (let* ((db #f) - (itempatt (args:get-arg "-itempatt")) (paths (open-run-close db:test-get-paths-matching db keynames target (args:get-arg "-test-files")))) (for-each (lambda (path) (print path)) paths)))))) ;;====================================================================== ;; Archive tests ;;====================================================================== -;; Archive tests matching target, runname, testpatt, and itempatt +;; Archive tests matching target, runname, and testpatt (if (args:get-arg "-archive") ;; if we are in a test use the MT_CMDINFO data (if (getenv "MT_CMDINFO") (let* ((startingdir (current-directory)) (cmdinfo (read (open-input-string (base64:base64-decode (getenv "MT_CMDINFO"))))) @@ -651,12 +624,11 @@ (exit 1))) (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, giving up on -archive, exiting") (exit 1))) - (let* ((itempatt (args:get-arg "-itempatt")) - (keys (open-run-close db:get-keys db)) + (let* ((keys (open-run-close db:get-keys db)) (keynames (map key:get-fieldname keys)) (paths (open-run-close db:test-get-paths-matching db keynames target))) (set! *didsomething* #t) (for-each (lambda (path) (print path)) @@ -665,11 +637,10 @@ (general-run-call "-test-paths" "Get paths to tests" (lambda (target runname keys keynames keyvallst) (let* ((db #f) - (itempatt (args:get-arg "-itempatt")) (paths (open-run-close db:test-get-paths-matching db keynames target))) (for-each (lambda (path) (print path)) paths)))))) Index: tasks.scm ================================================================== --- tasks.scm +++ tasks.scm @@ -334,13 +334,12 @@ (define (tasks:add-from-params mdb action keys key-params var-params) (let ((target (keys:key-vals-hash->target keys key-params)) (owner (car (user-information (current-user-id)))) (runname (hash-table-ref/default var-params "runname" #f)) (testpatts (hash-table-ref/default var-params "testpatts" "%")) - (itempatts (hash-table-ref/default var-params "itempatts" "%")) (params (hash-table-ref/default var-params "params" ""))) - (tasks:add mdb action owner target runname testpatts itempatts params))) + (tasks:add mdb action owner target runname testpatts params))) ;; return one task from those who are 'new' OR 'waiting' AND more than 10sec old ;; (define (tasks:snag-a-task mdb) (let ((res #f) @@ -444,12 +443,12 @@ "SELECT id,pid,strftime('%m/%d/%Y %H:%M',datetime(start_time,'unixepoch'),'localtime'),strftime('%m/%d/%Y %H:%M:%S',datetime(last_update,'unixepoch'),'localtime'),hostname,username FROM monitors ORDER BY last_update ASC;") (reverse res) )) (define (tasks:tasks->text tasks) - (let ((fmtstr "~10a~10a~10a~12a~20a~12a~12a~12a~10a")) - (conc (format #f fmtstr "id" "action" "owner" "state" "target" "runname" "testpatts" "itempatts" "params") "\n" + (let ((fmtstr "~10a~10a~10a~12a~20a~12a~12a~10a")) + (conc (format #f fmtstr "id" "action" "owner" "state" "target" "runname" "testpatts" "params") "\n" (string-intersperse (map (lambda (task) (format #f fmtstr (tasks:task-get-id task) (tasks:task-get-action task) @@ -456,11 +455,11 @@ (tasks:task-get-owner task) (tasks:task-get-state task) (tasks:task-get-target task) (tasks:task-get-name task) (tasks:task-get-test task) - (tasks:task-get-item task) + ;; (tasks:task-get-item task) (tasks:task-get-params task))) tasks) "\n")))) (define (tasks:monitors->text-table monitors) (let ((fmtstr "~4a~8a~20a~20a~10a~10a"))