@@ -178,15 +178,16 @@ Misc -start-dir path : switch to this directory before running megatest -contour cname : add a level of hierarcy to the linktree and run paths -area-tag tagname : add a tag to an area while syncking to pgdb - -rebuild-db : bring the database schema up to date -cleanup-db : remove any orphan records, vacuum the db -import-megatest.db : push data from megatest.db to cache db files in /tmp/$USER -sync-to-megatest.db : pull data from cache files in /tmp/$USER to megatest.db -sync-to dest : sync to new postgresql central style database + -reduce-records : move old records to megatest_additional.db, respects selectors + -restore-records : bring records back to megatest.db, respects selectors -update-meta : update the tests metadata for all tests -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these are overwritten by values set in config files. -server -|hostname : start the server (reduces contention on megatest.db), use - to automatically figure out hostname @@ -308,10 +309,12 @@ "-env2file" "-envcap" "-envdelta" "-setvars" "-set-state-status" + "-reduce-records" + "-restore-records" ;; move runs stuff here "-remove-keep" "-set-run-status" "-age" @@ -1684,31 +1687,10 @@ ;; - step completed, exit status, timestamp ;; 6. test phone home ;; - if test run time > allowed run time then kill job ;; - if cannot access db > allowed disconnect time then kill job -;; == duplicated == (if (or (args:get-arg "-run")(args:get-arg "-runtests")) -;; == duplicated == (general-run-call -;; == duplicated == "-runtests" -;; == duplicated == "run a test" -;; == duplicated == (lambda (target runname keys keyvals) -;; == duplicated == ;; -;; == duplicated == ;; May or may not implement it this way ... -;; == duplicated == ;; -;; == duplicated == ;; Insert this run into the tasks queue -;; == duplicated == ;; (open-run-close tasks:add tasks:open-db -;; == duplicated == ;; "runtests" -;; == duplicated == ;; user -;; == duplicated == ;; target -;; == duplicated == ;; runname -;; == duplicated == ;; (args:get-arg "-runtests") -;; == duplicated == ;; #f)))) -;; == duplicated == (runs:run-tests target -;; == duplicated == runname -;; == duplicated == (common:args-get-testpatt #f) ;; (args:get-arg "-runtests") -;; == duplicated == user -;; == duplicated == args:arg-hash)))) ;;====================================================================== ;; Rollup into a run ;;====================================================================== @@ -1797,10 +1779,28 @@ (general-run-call "-archive" "Archive" (lambda (target runname keys keyvals) (operate-on 'archive)))) + +;; reduce-records and restore-records are similar to archiving +;; +(if (args:get-arg "-reduce-records") + (general-run-call + "-reduce-records" + "reduce records" + (lambda (target runname keys keyvals) + (operate-on 'reduce-records) + ))) + +(if (args:get-arg "-restore-records") + (general-run-call + "-reduce-records" + "reduce records" + (lambda (target runname keys keyvals) + (operate-on 'restore-records) + ))) ;;====================================================================== ;; Extract a spreadsheet from the runs database ;;======================================================================