Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -116,11 +116,11 @@ -set-state-status X,Y : set state to X and status to Y, requires controls per -remove-runs -rerun FAIL,WARN... : force re-run for tests with specificed status(s) -rerun-clean : set all tests not COMPLETED+PASS,WARN,WAIVED to NOT_STARTED,n/a and then run the specified testpatt with -preclean -rerun-all : set all tests to NOT_STARTED,n/a and run with -preclean - -redo-logpro : do not rerun tests, but reapply logpro rules (ez-step flavor tests only) + -redo-logpro : do not rerun tests, but reapply logpro rules (ez-step flavor tests only; runs all tests unless -testpatt specified) -lock : lock run specified by target and runname -unlock : unlock run specified by target and runname -set-run-status status : sets status for run to status, requires -target and -runname -get-run-status : gets status for run specified by target and runname -run-wait : wait on run specified by target and runname @@ -293,11 +293,11 @@ "-set-toplog" "-runstep" "-logpro" "-m" "-rerun" - "-redo-logpro" + "-days" "-rename-run" "-to" ;; values and messages ":category" @@ -405,10 +405,11 @@ ;; queries "-test-paths" ;; get path(s) to a test, ordered by youngest first "-runall" ;; run all tests, respects -testpatt, defaults to % "-run" ;; alias for -runall + "-redo-logpro" "-remove-runs" "-keep-records" ;; use with -remove-runs to remove only the run data "-rebuild-db" "-cleanup-db" "-rollup" @@ -574,11 +575,11 @@ (process:children #f)) (original-exit exit-code))))) ;; for some switches always print the command to stderr ;; -(if (args:any? "-run" "-runall" "-remove-runs" "-set-state-status") +(if (args:any? "-run" "-runall" "-remove-runs" "-set-state-status" "-redo-logpro") (debug:print 0 *default-log-port* (string-intersperse (argv) " "))) ;; some switches imply homehost. Exit here if not on homehost ;; (let ((homehost-required (list "-cleanup-db" "-server"))) @@ -1093,10 +1094,17 @@ "-set-state-status" "set state and status" (lambda (target runname keys keyvals) (operate-on 'set-state-status)))) +(if (args:get-arg "-redo-logpro") + (general-run-call + "-redo-logpro" + "rerun logpro in ezsteps" + (lambda (target runname keys keyvals) + (operate-on 'redo-logpro)))) + (if (or (args:get-arg "-set-run-status") (args:get-arg "-get-run-status")) (general-run-call "-set-run-status" "set run status" @@ -1247,21 +1255,10 @@ (set! *didsomething* #t) (set! *time-to-exit* #t)) -;; redo logpro -(if (args:get-arg "-redo-logpro") - (let* ((result (redo-logpro:redo-logpro))) - (set! *didsomething* #t) - (set! *time-to-exit* #t) - (cond - ((not result) - - (exit 1)) - (else - #t)))) ;; NOTE: list-runs and list-db-targets operate on local db!!! ;; ;; IDEA: megatest list -runname blah% ... Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -2023,11 +2023,11 @@ (state-status (if (string? new-state-status) (string-split new-state-status ",") '(#f #f))) (rp-mutex (make-mutex)) (bup-mutex (make-mutex)) (keep-records (args:get-arg "-keep-records"))) ;; used in conjunction with -remove-runs to keep the records, TODO: consolidate this with "mode". - (let* ((write-access-actions '(remove-runs set-state-status archive run-wait)) + (let* ((write-access-actions '(remove-runs set-state-status archive run-wait redo-logpro)) (dbfile (conc *toppath* "/megatest.db")) (readonly-mode (not (file-write-access? dbfile)))) (when (and readonly-mode (member action write-access-actions)) (debug:print-error 0 *default-log-port* "megatest.db is readonly. Cannot proceed with action ["action"] in which write-access isrequired .") @@ -2068,10 +2068,12 @@ ;; (if (equal? testpatt "%") (tasks:kill-runner target run-name testpatt) ;; (debug:print 0 *default-log-port* "not attempting to kill any run launcher processes as testpatt is " testpatt)) (debug:print 1 *default-log-port* "Removing tests for run: " runkey " " (db:get-value-by-header run header "runname"))) + ((redo-logpro) + (debug:print 1 *default-log-port* "Re-applying new logpro rules without rerun for tests for run: " runkey " " (db:get-value-by-header run header "runname"))) ((set-state-status) ;; (if (tasks:need-server run-id)(tasks:start-and-wait-for-server tdbdat run-id 10)) (debug:print 1 *default-log-port* "Modifying state and staus for tests for run: " runkey " " (db:get-value-by-header run header "runname"))) ((print-run) (debug:print 1 *default-log-port* "Printing info for run " runkey ", run=" run ", tests=" tests ", header=" header) @@ -2132,10 +2134,11 @@ (test-state (db:test-get-state new-test-dat)) (test-fulln (db:test-get-fullname new-test-dat)) (uname (db:test-get-uname new-test-dat)) (toplevel-with-children (and (db:test-get-is-toplevel test) (> (rmt:test-toplevel-num-items run-id test-name) 0)))) + (BB> "arrived here 2") (case action ((remove-runs) ;; if the test is a toplevel-with-children issue an error and do not remove (cond (toplevel-with-children @@ -2202,10 +2205,11 @@ ) ; end case rem-status ) ; end let ); end cond has-subrun (else + (BB> "arrived 1") ;; BB - TODO - consider backgrounding to threads to delete tests (work below) (debug:print-info 0 *default-log-port* "test: " test-name " itest-state: " test-state) (if (member test-state (list "RUNNING" "LAUNCHED" "REMOTEHOSTSTART" "KILLREQ")) (begin (if (not (hash-table-ref/default test-retry-time test-fulln #f)) @@ -2230,10 +2234,14 @@ (begin (runs:remove-test-directory new-test-dat mode) ;; 'remove-all) (if (not (null? tal)) (loop (car tal)(cdr tal))))))) (rmt:update-run-stats run-id (rmt:get-raw-run-stats run-id))) + ((redo-logpro) + (debug:print-error 0 "redo-logpro unimplemented") + ;;(exit 1) + ) ((set-state-status) (let* ((new-state (car state-status)) (new-status (cadr state-status)) (test-id (db:test-get-id test)) (test-run-dir (db:test-get-rundir new-test-dat))