Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -429,5 +429,6 @@ ;; (not (hash-table-ref/default non-completed (db:test-get-testname x) #f))) ;; tests))) ;; (pre-dep-names (map db:test-get-testname completed-tests)) ;; (result (lset-difference string=? waiton pre-dep-names))) ;; (print "pre-dep-names: " pre-dep-names " waiton: " waiton " result: " result) + Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -54,10 +54,13 @@ -keepgoing : continue running until no jobs are \"LAUNCHED\" or \"NOT_STARTED\" -rerun FAIL,WARN... : re-run if called on a test that previously ran (nullified if -keepgoing is also specified) -rebuild-db : bring the database schema up to date + -rollup N : fill run (set by :runname) with latest test(s) from + past N days, requires keys + -rename-run : rename run (set by :runname) to , requires keys Helpers -runstep stepname ... : take remaining params as comand and execute as stepname log will be in stepname.log. Best to put command in quotes -logpro file : with -exec apply logpro file to stepname.log, creates @@ -88,10 +91,13 @@ "-set-toplog" "-runstep" "-logpro" "-m" "-rerun" + "-days" + "-rename-run" + "-to" "-debug" ;; for *verbosity* > 2 ) (list "-h" "-force" "-xterm" @@ -102,10 +108,11 @@ "-runall" ;; run all tests "-remove-runs" "-keepgoing" "-usequeue" "-rebuild-db" + "-rollup" "-v" ;; verbose 2, more than normal (normal is 1) "-q" ;; quiet 0, errors/warnings only ) args:arg-hash 0)) @@ -279,10 +286,15 @@ (debug:print 1 " " (string-intersperse test-names ",")) (run-tests db test-names))) ;; (run-waiting-tests db) (sqlite3:finalize! db) (set! *didsomething* #t)))) + +;;====================================================================== +;; Rollup into a run +;;====================================================================== +(if (args:get-arg "-rollup") ;;====================================================================== ;; run one test ;;====================================================================== Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -633,5 +633,18 @@ ;; (debug:print 1 "Removing run dir " runpath) ;; (system (conc "rmdir -p " runpath)))) )))) )) runs))) + +;;====================================================================== +;; Routines for manipulating runs +;;====================================================================== + +(define (runs:rollup-run db keys n) + (let* ((new-run-id (register-run db keys)) + (similar-runs (db:get-similar-runs db keys)) + (tests-n-days (db:get-tests-n-days db similar-runs))) + (for-each + (lambda (test-id) + (db:rollup-test db run-id test-id)) + tests-n-days)))