Index: mtut.scm ================================================================== --- mtut.scm +++ mtut.scm @@ -19,42 +19,24 @@ (declare (uses common)) (declare (uses megatest-version)) (declare (uses margs)) (declare (uses configf)) -;; (declare (uses runs)) -;; (declare (uses launch)) -;; (declare (uses server)) -;; (declare (uses client)) -;; (declare (uses tests)) -;; (declare (uses genexample)) -;; (declare (uses daemon)) -;; (declare (uses db)) -;; ;; (declare (uses dcommon)) -;; -;; (declare (uses tdb)) -;; (declare (uses mt)) -;; (declare (uses api)) -;; (declare (uses tasks)) ;; only used for debugging. -;; (declare (uses env)) -;; (declare (uses diff-report)) -;; -;; (define *db* #f) ;; this is only for the repl, do not use in general!!!! - -;; (include "common_records.scm") -;; (include "key_records.scm") -;; (include "db_records.scm") -;; (include "run_records.scm") + (include "megatest-fossil-hash.scm") (let ((debugcontrolf (conc (get-environment-variable "HOME") "/.mtutilrc"))) (if (file-exists? debugcontrolf) (load debugcontrolf))) ;; Disabled help items ;; -rollup : (currently disabled) fill run (set by :runname) with latest test(s) ;; from prior runs with same keys +;; Contour actions +;; import : import pkts +;; dispatch : dispatch queued run jobs from imported pkts +;; rungen : look at input sense list in [rungen] and generate run pkts (define help (conc " mtutil, part of the Megatest tool suite, documentation at http://www.kiatoa.com/fossils/megatest version " megatest-version " license GPL, Copyright Matt Welland 2006-2017 @@ -71,13 +53,10 @@ set-ss : set state/status archive : compress and move test data to archive disk kill : stop tests or entire runs Contour actions: - import : import pkts - dispatch : dispatch queued run jobs from imported pkts - rungen : look at input sense list in [rungen] and generate run pkts process : runs import, rungen and dispatch Selectors -immediate : apply this action immediately, default is to queue up actions -area areapatt1,area2... : apply this action only to the specified areas @@ -379,10 +358,22 @@ ;; get the timestamp for when that run started and pass it ;; to the rule logic here where "ruletype" will be applied ;; if it comes back "changed" then proceed to register the runs (case (string->symbol ruletype) + ((scheduled) + (if (not (eq? (length valparts) 6)) + (print "ERROR: bad sense spec \"" (string-intersperse sense " ") "\"") + (let* ((run-name (car valparts)) + (crontab (string-intersperse (cdr valparts))) + (last-run (if (null? starttimes) ;; never run + 0 + (apply max (map cdr starttimes)))) + (need-run (common:cron-event crontab #f last-run))) + (print "last-run: " last-run " need-run: " need-run) + (if need-run + (configf:section-var-set! torun contour runkey `(,(conc ruletype ":" (string-intersperse (cdr valparts) "-")) ,runname)))))) ((file file-or) ;; one or more files must be newer than the reference (let* ((file-globs (cdr valparts)) (youngestdat (common:get-youngest file-globs)) (youngestmod (car youngestdat))) ;; (print "youngestmod: " youngestmod " starttimes: " starttimes) @@ -462,11 +453,11 @@ ;; (define (dispatch-commands mtconf toppath) (with-queue-db mtconf (lambda (pktsdirs pktsdir pdb) - (let* ((rgconfdat (find-and-read-config (conc toppath "/rungen.config"))) + (let* ((rgconfdat (find-and-read-config (conc toppath "/runconfigs.config"))) (rgconf (car rgconfdat)) (areas (configf:get-section mtconf "areas")) (contours (configf:get-section mtconf "contours")) (pkts (find-pkts pdb '(cmd) '())) (torun (make-hash-table)) ;; target => ( ... info ... ) Index: runconfigs.config ================================================================== --- runconfigs.config +++ runconfigs.config @@ -14,5 +14,6 @@ # month 1-12 (or names, see below) # day of week 0-7 (0 or 7 is Sun, or use names) # every friday at midnight run all all:scheduled auto 0 0 0 0 5 +quick:scheduled auto 39 22 * * * DELETED rungen.config Index: rungen.config ================================================================== --- rungen.config +++ /dev/null @@ -1,18 +0,0 @@ -[v1.63/tip/dev] -# file: files changes since last run trigger new run -# script: script is called with unix seconds as last parameter (other parameters are preserved) -# -# contour:sensetype runname params -quick:file auto *.scm -quick:script auto checkfossil.sh v1.63 - -# field allowed values -# ----- -------------- -# minute 0-59 -# hour 0-23 -# day of month 1-31 -# month 1-12 (or names, see below) -# day of week 0-7 (0 or 7 is Sun, or use names) - -# every friday at midnight run all -all:scheduled auto 0 0 0 0 5