Megatest

Check-in [adda285a75]
Login
Overview
Comment:Added a flexible targer mapper mechanism
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.64
Files: files | file ages | folders
SHA1: adda285a75796fc856e04147adeb03a0501c5bdc
User & Date: matt on 2017-02-25 16:07:11
Other Links: branch diff | manifest | tags
Context
2017-02-25
21:10
Cleaned up schema for common postgres db check-in: 5574ded5f0 user: matt tags: v1.64
16:07
Added a flexible targer mapper mechanism check-in: adda285a75 user: matt tags: v1.64
2017-02-23
19:11
Brought v1.64 up to date with v1.63 check-in: 995f56ced6 user: matt tags: v1.64
Changes

Added .mtutil.scm version [487da879e0].

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8

;; example of how to set up and write target mappers
;;
(define *target-mappers*
  `((prefix-contour . ,(lambda (target run-name area area-path reason contour mode-patt)
			 (conc contour "/" target)))))

;; (print "Yep, got here!")

Modified megatest.config from [e3366df1e1] to [0612ef3804].

1
2
3
4
5
6
7
8
9
10
11
12
13
[setup]
pktsdirs /tmp/pkts /some/other/source

[areas]
#         path-to-area   map-target-script(future, optional)
fullrun   tests/fullrun
ext-tests ext-tests

[contours]
#     mode-patt/tag-expr
quick quick/QUICKPATT
full  all/MAXPATT quick/QUICKPATT






|







1
2
3
4
5
6
7
8
9
10
11
12
13
[setup]
pktsdirs /tmp/pkts /some/other/source

[areas]
#         path-to-area   map-target-script(future, optional)
fullrun   tests/fullrun  prefix-contour
ext-tests ext-tests

[contours]
#     mode-patt/tag-expr
quick quick/QUICKPATT
full  all/MAXPATT quick/QUICKPATT

Modified mtut.scm from [d1c899006f] to [6641ed3af1].

25
26
27
28
29
30
31












32
33
34
35
36
37
38

(include "megatest-fossil-hash.scm")

(let ((debugcontrolf (conc (get-environment-variable "HOME") "/.mtutilrc")))
  (if (file-exists? debugcontrolf)
      (load debugcontrolf)))













;; Disabled help items
;;  -rollup                 : (currently disabled) fill run (set by :runname)  with latest test(s)
;;                            from prior runs with same keys
;; Contour actions
;;    import                  : import pkts
;;    dispatch                : dispatch queued run jobs from imported pkts
;;    rungen                  : look at input sense list in [rungen] and generate run pkts







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







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

(include "megatest-fossil-hash.scm")

(let ((debugcontrolf (conc (get-environment-variable "HOME") "/.mtutilrc")))
  (if (file-exists? debugcontrolf)
      (load debugcontrolf)))

;; this needs some thought regarding security implications.
;;
;;   i. Check that owner of the file and calling user are same?
;;  ii. Check that we are in a legal megatest area?
;; iii. Have some form of authentication or record of the md5sum or similar of the file?
;;
(if (file-exists? "megatest.config")
    (if (file-exists? ".mtutil.so")
	(load ".mtutil.so")
	(if (file-exists? ".mtutil.scm")
	(load ".mtutil.scm"))))

;; Disabled help items
;;  -rollup                 : (currently disabled) fill run (set by :runname)  with latest test(s)
;;                            from prior runs with same keys
;; Contour actions
;;    import                  : import pkts
;;    dispatch                : dispatch queued run jobs from imported pkts
;;    rungen                  : look at input sense list in [rungen] and generate run pkts
297
298
299
300
301
302
303
304

















305
306
307
308
309
310
311
312
313
314
315
316

;; NEED TIMESTAMP ON PKTS for efficient loading of packets into db.


;; make a run request pkt from basic data
;;
(define (create-run-pkt mtconf area runkey runname mode-patt tag-expr pktsdir reason contour sched) 
  (let ((area-path (configf:lookup mtconf "areas" area)))

















    (let-values (((uuid pkt)
		  (command-line->pkt
		   "run"
		   (append 
		    `(("-target"     . ,runkey)
		      ("-run-name"   . ,runname)
		      ("-start-dir"  . ,area-path)
		      ("-msg"        . ,reason)
		      ("-contour"    . ,contour))
		    (if mode-patt
			`(("-mode-patt"  . ,mode-patt))
			'())







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




|







309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345

;; NEED TIMESTAMP ON PKTS for efficient loading of packets into db.


;; make a run request pkt from basic data
;;
(define (create-run-pkt mtconf area runkey runname mode-patt tag-expr pktsdir reason contour sched) 
  (let* ((area-dat   (string-split (or (configf:lookup mtconf "areas" area) "")))
	 (area-path  (car area-dat))
	 (area-xlatr (if (eq? (length area-dat) 2)(cadr area-dat) #f))
	 (new-target (if area-xlatr
			 (let ((xlatr-key (string->symbol area-xlatr)))
			   (if (alist-ref xlatr-key *target-mappers*)
			       (begin
				 (print "Using target mapper: " area-xlatr)
				 (handle-exceptions
				     exn
				     (begin
				       (print "FAILED TO RUN TARGET MAPPER FOR " area ", called " area-xlatr)
				       (print "   function is: " (alist-ref xlatr-key *target-mappers*))
				       (print " message: " ((condition-property-accessor 'exn 'message) exn))
				       runkey)
				   ((alist-ref xlatr-key *target-mappers*)
				    runkey runname area area-path reason contour mode-patt)))))
			 runkey)))
    (let-values (((uuid pkt)
		  (command-line->pkt
		   "run"
		   (append 
		    `(("-target"     . ,new-target)
		      ("-run-name"   . ,runname)
		      ("-start-dir"  . ,area-path)
		      ("-msg"        . ,reason)
		      ("-contour"    . ,contour))
		    (if mode-patt
			`(("-mode-patt"  . ,mode-patt))
			'())

Modified runconfigs.config from [798bc88af4] to [e79409fd75].

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
quick:script:run           run-name=auto;script=checkfossil.sh v1.63

# field          allowed values
# -----          --------------
# minute         0-59
# hour           0-23
# day of month   1-31
# month          1-12 (or names, see below)
# day of week    0-7 (0 or 7 is Sun, or use names)

# actions:
#  run     - run a testsuite
#  clean   - clear out runs
#  archive - archive runs

quick:scheduled:run     cron=47  * * * * ;run-name=auto







|
|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
quick:script:run           run-name=auto;script=checkfossil.sh v1.63

# field          allowed values
# -----          --------------
# minute         0-59
# hour           0-23
# day of month   1-31
# month          1-12 (or names, future development)
# day of week    0-7 (0 or 7 is Sun, or, future development, use names)

# actions:
#  run     - run a testsuite
#  clean   - clear out runs
#  archive - archive runs

quick:scheduled:run     cron=47  * * * * ;run-name=auto