Megatest

Check-in [326c8c2840]
Login
Overview
Comment:Started adding json support for list runs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | list-runs-json
Files: files | file ages | folders
SHA1: 326c8c284032a2cbcf1154f61e8a90d8dc48c832
User & Date: mrwellan on 2015-03-12 16:04:41
Other Links: branch diff | manifest | tags
Context
2015-03-12
16:04
Started adding json support for list runs Closed-Leaf check-in: 326c8c2840 user: mrwellan tags: list-runs-json
2015-03-11
23:31
Moved loading of format module later to avoid strange crashes in read-only areas check-in: eb760222b4 user: matt tags: v1.60
Changes

Modified megatest.scm from [eecae44588] to [a5b2922c14].

889
890
891
892
893
894
895



896
897
898
899
900
901
902
903
904
905
906
907





908
909
910
911



912
913
914
915
916
917
918
	       ;; (runsdat  (db:get-runs dbstruct runpatt #f #f '()))
	       (runsdat  (db:get-runs-by-patt dbstruct keys (or runpatt "%") (common:args-get-target)
					 #f #f))
		;; (cdb:remote-run db:get-runs #f runpatt #f #f '()))
	       (runs     (db:get-rows runsdat))
	       (header   (db:get-header runsdat))
	       (db-targets (args:get-arg "-list-db-targets"))



	       (seen     (make-hash-table)))
	  ;; Each run
	  (for-each 
	   (lambda (run)
	     (let ((targetstr (string-intersperse (map (lambda (x)
							 (db:get-value-by-header run header x))
						       keys) "/")))
	       (if db-targets
		   (if (not (hash-table-ref/default seen targetstr #f))
		       (begin
			 (hash-table-set! seen targetstr #t)
			 ;; (print "[" targetstr "]"))))





			 (print targetstr))))
	       (if (not db-targets)
		   (let* ((run-id (db:get-value-by-header run header "id"))
			  (tests  (db:get-tests-for-run dbstruct run-id testpatt '() '() #f #f #f 'testname 'asc #f)))



		     (print "Run: " targetstr "/" (db:get-value-by-header run header "runname") 
			    " status: " (db:get-value-by-header run header "state")
			    " run-id: " run-id ", number tests: " (length tests))
		     (for-each 
		      (lambda (test)
			(handle-exceptions
			 exn







>
>
>
|











>
>
>
>
>
|
<

|
>
>
>







889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916

917
918
919
920
921
922
923
924
925
926
927
928
	       ;; (runsdat  (db:get-runs dbstruct runpatt #f #f '()))
	       (runsdat  (db:get-runs-by-patt dbstruct keys (or runpatt "%") (common:args-get-target)
					 #f #f))
		;; (cdb:remote-run db:get-runs #f runpatt #f #f '()))
	       (runs     (db:get-rows runsdat))
	       (header   (db:get-header runsdat))
	       (db-targets (args:get-arg "-list-db-targets"))
	       (mode       (let ((dmode (args:get-arg "-dumpmode")))
			     (if dmode (string->symbol dmode) #f)))
	       (seen       (make-hash-table))
	       (data       (make-hash-table))) ;; target -> 
	  ;; Each run
	  (for-each 
	   (lambda (run)
	     (let ((targetstr (string-intersperse (map (lambda (x)
							 (db:get-value-by-header run header x))
						       keys) "/")))
	       (if db-targets
		   (if (not (hash-table-ref/default seen targetstr #f))
		       (begin
			 (hash-table-set! seen targetstr #t)
			 ;; (print "[" targetstr "]"))))
			 (case mode
			   ((json)
			    (hash-table-set! data targetstr
					     (or (hash-table-ref/default data targetstr #f)(make-hash-table))))
			   (else 
			    (print targetstr)))))

		   (let* ((run-id (db:get-value-by-header run header "id"))
			  (tests    (db:get-tests-for-run dbstruct run-id testpatt '() '() #f #f #f 'testname 'asc #f))
			  (run-data (hash-table-set! 
		     (case mode
		       ((json)
		     (print "Run: " targetstr "/" (db:get-value-by-header run header "runname") 
			    " status: " (db:get-value-by-header run header "state")
			    " run-id: " run-id ", number tests: " (length tests))
		     (for-each 
		      (lambda (test)
			(handle-exceptions
			 exn