Megatest

Diff
Login

Differences From Artifact [302c3da708]:

To Artifact [9bf54c5489]:


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  license GPL, Copyright Matt Welland 2006-2012

Usage: megatest [options]
  -h                      : this help
  -version                : print megatest version (currently " megatest-version ")

Launching and managing runs
  -runall                 : run all tests that are not state COMPLETED and status PASS, 
                            CHECK or KILLED
  -runtests tst1,tst2 ... : run tests
  -remove-runs            : remove the data for a run, requires :runname and -testpatt
                            Optionally use :state and :status
  -set-state-status X,Y   : set state to X and status to Y, requires controls per -remove-runs
  -rerun FAIL,WARN...     : force re-run for tests with specificed status(s)
  -rollup                 : (currently disabled) fill run (set by :runname)  with latest test(s)
                            from prior runs with same keys
  -lock                   : lock run specified by target and runname







|
|
<







38
39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
  license GPL, Copyright Matt Welland 2006-2012

Usage: megatest [options]
  -h                      : this help
  -version                : print megatest version (currently " megatest-version ")

Launching and managing runs
  -run testpatt[/itempatt] : run all tests that are not state COMPLETED and status PASS, 
                            CHECK or KILLED, matching pattern testpatt...

  -remove-runs            : remove the data for a run, requires :runname and -testpatt
                            Optionally use :state and :status
  -set-state-status X,Y   : set state to X and status to Y, requires controls per -remove-runs
  -rerun FAIL,WARN...     : force re-run for tests with specificed status(s)
  -rollup                 : (currently disabled) fill run (set by :runname)  with latest test(s)
                            from prior runs with same keys
  -lock                   : lock run specified by target and runname
166
167
168
169
170
171
172

173
174
175
176
177
178
179
			"-env2file"
			"-setvars"
			"-set-state-status"
			"-debug" ;; for *verbosity* > 2
			"-gen-megatest-test"
			"-override-timeout"
			"-test-files"  ;; -test-paths is for listing all

			) 
		 (list  "-h"
			"-version"
		        "-force"
		        "-xterm"
		        "-showkeys"
		        "-test-status"







>







165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
			"-env2file"
			"-setvars"
			"-set-state-status"
			"-debug" ;; for *verbosity* > 2
			"-gen-megatest-test"
			"-override-timeout"
			"-test-files"  ;; -test-paths is for listing all
			"-run"
			) 
		 (list  "-h"
			"-version"
		        "-force"
		        "-xterm"
		        "-showkeys"
		        "-test-status"
509
510
511
512
513
514
515












516





517
518
519
520
521
522
523



524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
;;     launch task
;;   else
;;     put task in deferred queue
;; if still ok to run tasks
;;   process deferred tasks per above steps

;; run all tests are are Not COMPLETED and PASS or CHECK












(if (args:get-arg "-runall")





    (general-run-call 
     "-runall"
     "run all tests"
     (lambda (target runname keys keynames keyvallst)
       (runs:run-tests target
		       runname
		       "%"



		       (args:get-arg "-testpatt")
		       user
		       args:arg-hash))))

;;======================================================================
;; run one test
;;======================================================================

;; 1. find the config file
;; 2. change to the test directory
;; 3. update the db with "test started" status, set running host
;; 4. process launch the test
;;    - monitor the process, update stats in the db every 2^n minutes
;; 5. as the test proceeds internally it calls megatest as each step is
;;    started and completed
;;    - step started, timestamp
;;    - 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

(if (args:get-arg "-runtests")
  (general-run-call 
   "-runtests" 
   "run a test" 
   (lambda (target runname keys keynames keyvallst)
     (runs:run-tests target
		     runname
		     (args:get-arg "-runtests")
		     (args:get-arg "-testpatt")
		     user
		     args:arg-hash))))

;;======================================================================
;; Rollup into a run
;;======================================================================

(if (args:get-arg "-rollup")
    (begin







>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
|
|
|
|
|
|
<
>
>
>
|
|
|


















|
|
|
|
|
|
|
|
|
|
|







509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539

540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
;;     launch task
;;   else
;;     put task in deferred queue
;; if still ok to run tasks
;;   process deferred tasks per above steps

;; run all tests are are Not COMPLETED and PASS or CHECK
(if (or (args:get-arg "-runall") ;; deprecated
	(args:get-arg "-run")
	(args:get-arg "-runtests"))
    (begin
      (if (args:get-arg "-testpatt")
	  (begin
	    (debug:print 0 "ERROR:-testpatt is deprecated, use -run patt1,patt2... instead, your pattern " (args:get-arg "-testpatt") " will be ignored")
	    (sleep 3)))
      (if (args:get-arg "-itempatt")
	  (begin
	    (debug:print 0 "ERROR: -itempatt is not used with -run, your pattern " (args:get-arg "-itempatt") " will be ignored")
	    (sleep 3)))
      (if (args:get-arg "-runall")
	  (begin
	    (debug:print 0 "ERROR: -runall is deprecated, use -run patt1,patt2 ... instead")
	    (sleep 3)))
      (if (args:get-arg "-runtests")
	  (debug:print 0 "WARNING: -runtests is deprecated, use -run patt1,patt2 ... instead"))
      (general-run-call 
       "-run"
       "run tests"
       (lambda (target runname keys keynames keyvallst)
	 (runs:run-tests target
			 runname

			 '()
			 (or (args:get-arg "-run")
			     (args:get-arg "-runtests")
			     (args:get-arg "-testpatt"))
			 user
			 args:arg-hash)))))

;;======================================================================
;; run one test
;;======================================================================

;; 1. find the config file
;; 2. change to the test directory
;; 3. update the db with "test started" status, set running host
;; 4. process launch the test
;;    - monitor the process, update stats in the db every 2^n minutes
;; 5. as the test proceeds internally it calls megatest as each step is
;;    started and completed
;;    - step started, timestamp
;;    - 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

;; (if (args:get-arg "-runtests")
;;   (general-run-call 
;;    "-runtests" 
;;    "run a test" 
;;    (lambda (target runname keys keynames keyvallst)
;;      (runs:run-tests target
;; 		     runname
;; 		     (args:get-arg "-runtests")
;; 		     (args:get-arg "-testpatt")
;; 		     user
;; 		     args:arg-hash))))

;;======================================================================
;; Rollup into a run
;;======================================================================

(if (args:get-arg "-rollup")
    (begin