Megatest

Diff
Login

Differences From Artifact [170ba13932]:

To Artifact [bd9e9c775d]:


341
342
343
344
345
346
347

348
349
350
351
352
353
354
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355







+







			"-var"
			"-dumpmode"
			"-run-id"
			"-ping"
			"-refdb2dat"
			"-o"
			"-log"
                        "-sync-log"
			"-since"
			"-fields"
			"-recover-test" ;; run-id,test-id - used internally to recover a test stuck in RUNNING state
			"-sort"
			"-target-db"
			"-source-db"
			"-prefix-target"
2291
2292
2293
2294
2295
2296
2297





2298
2299
2300
2301









2302
2303
2304
2305
2306
2307
2308
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303




2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319







+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+







       'adj-testids
       'old2new
       ;; 'new2old
       )
      (set! *didsomething* #t)))

(if (args:get-arg "-sync-to-megatest.db")
    (let* ((dbstruct (db:setup #f))
	   (tmpdbpth (cdr (dbr:dbstruct-tmpdb dbstruct)))
	   (lockfile (conc tmpdbpth ".lock"))
	   (locked   (common:simple-file-lock lockfile)) 
	   (res      (if locked
    (let ((res (db:multi-db-sync 
                (db:setup #f)
                'new2old)))
      (print "Synced " res " records to megatest.db")
			 (db:multi-db-sync 
			  dbstruct
			  'new2old)
			 #f)))
      (if res
	  (begin
	    (common:simple-file-release-lock lockfile)
	    (print "Synced " res " records to megatest.db"))
	  (print "Skipping sync, there is a sync in progress."))
      (set! *didsomething* #t)))

(if (args:get-arg "-sync-to")
    (let ((toppath (launch:setup)))
      (tasks:sync-to-postgres *configdat* (args:get-arg "-sync-to"))
      (set! *didsomething* #t)))