Megatest

Check-in [77d7beefe0]
Login
Overview
Comment:Created a focused and simpler testconfig reader for use from disk getting routine
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | v1.64-defered-rundir
Files: files | file ages | folders
SHA1: 77d7beefe06995b0ae12f3a381258b5514a69b1f
User & Date: matt on 2017-07-27 00:56:25
Other Links: branch diff | manifest | tags
Context
2017-07-27
00:56
Created a focused and simpler testconfig reader for use from disk getting routine Closed-Leaf check-in: 77d7beefe0 user: matt tags: v1.64-defered-rundir
00:09
Getting closer but tconfdisks still fails check-in: a6c0fbe346 user: matt tags: v1.64-defered-rundir
Changes

Modified launch.scm from [ed1263a48b] to [54995d9835].

1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
;; 
;; All log file links should be stored relative to the top of link path
;;  
;; <target> - <testname> [ - <itempath> ] 
;;
(define (create-work-area run-id run-info target test-id test-src-path disk-path-in test-name itemdat #!key (tconfig #f)(remtries 2)(tregistery #f))
  (let* ((item-path (if (string? itemdat) itemdat (item-list->path itemdat))) ;; if pass in string - just use it
	 (testconf  (or tconfig (tests:get-testconfig test-name item-path (or tregistery (make-hash-table)) #t force-create: #t)))
	 (disk-path (if disk-path-in disk-path-in (get-best-disk *configdat* tconfig))) ;; NOTE: You'd better have tconfig defined!
	 (runname   (if (string? run-info) ;; if we pass in a string as run-info use it as run-name.
			run-info
			(db:get-value-by-header (db:get-rows run-info)
						(db:get-header run-info)
						"runname")))
	 (contour   #f) ;; NOT READY FOR THIS (args:get-arg "-contour"))







|







1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
;; 
;; All log file links should be stored relative to the top of link path
;;  
;; <target> - <testname> [ - <itempath> ] 
;;
(define (create-work-area run-id run-info target test-id test-src-path disk-path-in test-name itemdat #!key (tconfig #f)(remtries 2)(tregistery #f))
  (let* ((item-path (if (string? itemdat) itemdat (item-list->path itemdat))) ;; if pass in string - just use it
	 (testconf  (or tconfig (tests:forced-get-testconfig test-name item-path))) ;; (tests:get-testconfig test-name item-path (or tregistery (make-hash-table)) #t force-create: #t)))
	 (disk-path (if disk-path-in disk-path-in (get-best-disk *configdat* tconfig))) ;; NOTE: You'd better have tconfig defined!
	 (runname   (if (string? run-info) ;; if we pass in a string as run-info use it as run-name.
			run-info
			(db:get-value-by-header (db:get-rows run-info)
						(db:get-header run-info)
						"runname")))
	 (contour   #f) ;; NOT READY FOR THIS (args:get-arg "-contour"))

Modified tests.scm from [7ecf995af8] to [b3a1138ee1].

1205
1206
1207
1208
1209
1210
1211
1212




























1213
1214
1215
1216
1217
1218
1219
			 cache-file
			 (file-write-access? cache-path))
		    (let ((tpath (conc cache-path "/.testconfig")))
		      (debug:print-info 1 *default-log-port* "Caching testconfig for " test-name " in " tpath)
                      (if (not (common:in-running-test?))
                          (configf:write-alist tcfg tpath))))
		tcfg))))))
  




























;; sort tests by priority and waiton
;; Move test specific stuff to a test unit FIXME one of these days
(define (tests:sort-by-priority-and-waiton test-records)
  (if (eq? (hash-table-size test-records) 0)
      '()
      (let* ((mungepriority (lambda (priority)
			      (if priority







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







1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
			 cache-file
			 (file-write-access? cache-path))
		    (let ((tpath (conc cache-path "/.testconfig")))
		      (debug:print-info 1 *default-log-port* "Caching testconfig for " test-name " in " tpath)
                      (if (not (common:in-running-test?))
                          (configf:write-alist tcfg tpath))))
		tcfg))))))

;; forced read and write of cache of testconfig for the exection of the test
;;
(define (tests:forced-get-testconfig  test-name item-path)
  (let* ((cache-path   (tests:get-test-path-from-environment))
	 (cache-file   (and cache-path (conc cache-path "/.testconfig")))
	 (test-full-name (if (and item-path (not (string-null? item-path)))
                             (conc test-name "/" item-path)
                             test-name)))
    ;; no cached data available
    (let* ((treg         (tests:get-all)) ;; we need the tests info from all the possible tests paths
	   (test-path    (or (hash-table-ref/default treg test-name #f)
			     (conc *toppath* "/tests/" test-name)))
	   (test-configf (conc test-path "/testconfig"))
	   (testexists   (file-read-access? test-configf))
	   (tcfg         (if testexists
			     (read-config test-configf #f #t ;; system-allowed
					  environ-patt: "pre-launch-env-vars"
					  )
			     #f)))
      (if tcfg (hash-table-set! tcfg "have fulldata" #t)) ;; mark this as fully read data
      (if tcfg (hash-table-set! *testconfigs* test-full-name tcfg))
      (if (and testexists
	       (file-write-access? cache-path))
	  (let ((tpath (conc cache-path "/.testconfig")))
	    (debug:print-info 1 *default-log-port* "Caching testconfig for " test-name " in " tpath)
	    (configf:write-alist tcfg tpath)))
      tcfg)))

;; sort tests by priority and waiton
;; Move test specific stuff to a test unit FIXME one of these days
(define (tests:sort-by-priority-and-waiton test-records)
  (if (eq? (hash-table-size test-records) 0)
      '()
      (let* ((mungepriority (lambda (priority)
			      (if priority