Megatest

Check-in [5eaf98203f]
Login
Overview
Comment:Fixed couple issues with -list-runs created by additon of fields filters
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: 5eaf98203f782fd17b06c3265980da2ef9e198f7
User & Date: matt on 2015-06-04 01:30:48
Other Links: branch diff | manifest | tags
Context
2015-06-04
09:45
Bumped version. check-in: f902be8c4a user: mrwellan tags: v1.60
01:30
Fixed couple issues with -list-runs created by additon of fields filters check-in: 5eaf98203f user: matt tags: v1.60
01:09
Added filtering by field for dumpmode check-in: a3ca55343e user: matt tags: v1.60
Changes

Modified megatest.scm from [1a94be3f21] to [47275c3c75].

943
944
945
946
947
948
949
950
951
952

953



954
955
956
957
958
959
960
961
	       (seen        (make-hash-table))
	       (dmode       (let ((d (args:get-arg "-dumpmode")))
			      (if d (string->symbol d) #f)))
	       (data        (make-hash-table))
	       (fields-spec (if (args:get-arg "-fields")
				(extract-fields-constraints (args:get-arg "-fields"))
				'(("runs"  "id" "target"   "runname")
				  ("tests" "id" "testname" "test_path")
				  ("steps" "id" "stepname"))))
	       (runs-spec   (alist-ref "runs"  fields-spec equal?))

	       (tests-spec  (alist-ref "tests" fields-spec equal?))



	       (adj-tests-spec (delete-duplicates (cons "id" tests-spec)))
	       (steps-spec  (alist-ref "steps" fields-spec equal?))
	       (test-field-index (make-hash-table)))
	  (if (and tests-spec (not (null? tests-spec))) ;; do some validation and processing of the test-spec
	      (let ((invalid-tests-spec (filter (lambda (x)(not (member x db:test-record-fields))) tests-spec)))
		(if (null? invalid-tests-spec)
		    ;; generate the lookup map test-field-name => index-number
		    (let loop ((hed (car adj-tests-spec))







|

|
>
|
>
>
>
|







943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
	       (seen        (make-hash-table))
	       (dmode       (let ((d (args:get-arg "-dumpmode")))
			      (if d (string->symbol d) #f)))
	       (data        (make-hash-table))
	       (fields-spec (if (args:get-arg "-fields")
				(extract-fields-constraints (args:get-arg "-fields"))
				'(("runs"  "id" "target"   "runname")
				  (cons "tests"  db:test-record-fields) ;; "id" "testname" "test_path")
				  ("steps" "id" "stepname"))))
	       (runs-spec   (let ((r (alist-ref "runs"  fields-spec equal?)))
			      (if (and r (not (null? r))) r (list "id"))))
	       (tests-spec  (let ((t (alist-ref "tests" fields-spec equal?)))
			      (if (and t (null? t)) ;; all fields
				  db:test-record-fields
				  t)))
	       (adj-tests-spec (delete-duplicates (if tests-spec (cons "id" tests-spec) db:test-record-fields))) ;; '("id"))))
	       (steps-spec  (alist-ref "steps" fields-spec equal?))
	       (test-field-index (make-hash-table)))
	  (if (and tests-spec (not (null? tests-spec))) ;; do some validation and processing of the test-spec
	      (let ((invalid-tests-spec (filter (lambda (x)(not (member x db:test-record-fields))) tests-spec)))
		(if (null? invalid-tests-spec)
		    ;; generate the lookup map test-field-name => index-number
		    (let loop ((hed (car adj-tests-spec))
983
984
985
986
987
988
989

990
991
992
993
994
995
996
		   (let* ((run-id  (db:get-value-by-header run header "id"))
			  (runname (db:get-value-by-header run header "runname")) 
			  (tests   (if tests-spec
				       (db:get-tests-for-run dbstruct run-id testpatt '() '() #f #f #f 'testname 'asc 
							     ;; use qryvals if test-spec provided
							     (if tests-spec
								 (string-intersperse adj-tests-spec ",")

								 #f))
				       '())))
		     (case dmode
		       ((json)
			(if runs-spec
			    (for-each 
			     (lambda (field-name)







>







987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
		   (let* ((run-id  (db:get-value-by-header run header "id"))
			  (runname (db:get-value-by-header run header "runname")) 
			  (tests   (if tests-spec
				       (db:get-tests-for-run dbstruct run-id testpatt '() '() #f #f #f 'testname 'asc 
							     ;; use qryvals if test-spec provided
							     (if tests-spec
								 (string-intersperse adj-tests-spec ",")
								 ;; db:test-record-fields
								 #f))
				       '())))
		     (case dmode
		       ((json)
			(if runs-spec
			    (for-each 
			     (lambda (field-name)