Megatest

Diff
Login

Differences From Artifact [134d7dd741]:

To Artifact [3bcf86d151]:


125
126
127
128
129
130
131

132
133
134
135
136
137
138
  -list-db-targets        : list the target combinations used in the db
  -show-config            : dump the internal representation of the megatest.config file
  -show-runconfig         : dump the internal representation of the runconfigs.config file
  -dumpmode json          : dump in json format instead of sexpr
  -show-cmdinfo           : dump the command info for a test (run in test environment)
  -section sectionName
  -var varName            : for config and runconfig lookup value for sectionName varName


Misc 
  -start-dir path         : switch to this directory before running megatest
  -rebuild-db             : bring the database schema up to date
  -cleanup-db             : remove any orphan records, vacuum the db
  -import-megatest.db     : migrate a database from v1.55 series to v1.60 series
  -sync-to-megatest.db    : migrate data back to megatest.db







>







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
  -list-db-targets        : list the target combinations used in the db
  -show-config            : dump the internal representation of the megatest.config file
  -show-runconfig         : dump the internal representation of the runconfigs.config file
  -dumpmode json          : dump in json format instead of sexpr
  -show-cmdinfo           : dump the command info for a test (run in test environment)
  -section sectionName
  -var varName            : for config and runconfig lookup value for sectionName varName
  -changed-runs-since N   : get list of runs changed since time N (Unix seconds)

Misc 
  -start-dir path         : switch to this directory before running megatest
  -rebuild-db             : bring the database schema up to date
  -cleanup-db             : remove any orphan records, vacuum the db
  -import-megatest.db     : migrate a database from v1.55 series to v1.60 series
  -sync-to-megatest.db    : migrate data back to megatest.db
241
242
243
244
245
246
247

248
249
250
251
252
253
254
			"-dumpmode"
			"-run-id"
			"-ping"
			"-refdb2dat"
			"-o"
			"-log"
			"-archive"

			) 
		 (list  "-h" "-help" "--help"
			"-version"
		        "-force"
		        "-xterm"
		        "-showkeys"
		        "-show-keys"







>







242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
			"-dumpmode"
			"-run-id"
			"-ping"
			"-refdb2dat"
			"-o"
			"-log"
			"-archive"
			"-changed-runs-since"
			) 
		 (list  "-h" "-help" "--help"
			"-version"
		        "-force"
		        "-xterm"
		        "-showkeys"
		        "-show-keys"
985
986
987
988
989
990
991






















992
993
994
995
996
997
998
						 (tdb:step-get-event_time step)))
				       steps)))))))))
		      tests)))))
	   runs)
	  (if (eq? dmode 'json)(json-write data))
	  (set! *didsomething* #t))))























;;======================================================================
;; full run
;;======================================================================

;; get lock in db for full run for this directory
;; for all tests with deps
;;   walk tree of tests to find head tasks







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
						 (tdb:step-get-event_time step)))
				       steps)))))))))
		      tests)))))
	   runs)
	  (if (eq? dmode 'json)(json-write data))
	  (set! *didsomething* #t))))

(if (and (args:get-arg "-changed-runs-since")
	 (launch:setup-for-run))
    (let* ((since-time (string->number (args:get-arg "-changed-runs-since")))
	   (dbdir      (db:dbfile-path #f)) ;; (configf:lookup *configdat* "setup" "dbdir"))
	   (alldbs     (glob (conc dbdir "/[0-9]*.db")))
	   (changed    (filter (lambda (dbfile)
				 (> (file-modification-time dbfile) since-time))
			       alldbs))
	   (run-ids    (delete-duplicates
			(map (lambda (dbfile)
			       (let* ((res (string-match ".*\\/(\\d)*\\.db" dbfile)))
				 (if res
				     (string->number (cadr res))
				     (begin
				       (debug:print 2 "ERROR: Failed to process " dbfile " for run-id")
				       0))))
			     changed))))
      ;; (rmt:get-tests-for-runs-mindata run-ids testpatt states status not-in)
      (print (sort run-ids <))
      (set! *didsomething* #t)))
      
      
;;======================================================================
;; full run
;;======================================================================

;; get lock in db for full run for this directory
;; for all tests with deps
;;   walk tree of tests to find head tasks