Megatest

Check-in [e11e64e7e3]
Login
Overview
Comment:Added event_time to runs and tests json output
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | v1.55
Files: files | file ages | folders
SHA1: e11e64e7e3719ae93d8e36a38cfb18bde4d0e34a
User & Date: matt on 2015-03-19 21:57:02
Other Links: branch diff | manifest | tags
Context
2015-03-19
21:57
Added event_time to runs and tests json output Leaf check-in: e11e64e7e3 user: matt tags: v1.55
2015-03-13
00:43
Fixed ordering in calls to hierhash set. check-in: 6b1328601d user: matt tags: v1.55
Changes

Modified megatest.scm from [8c134a36ba] to [ddd946f937].

700
701
702
703
704
705
706
707
708
709


710
711
712
713
714
715
716
717
718
719
720
721
722

723
724
725
726
727

728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
			 ;; (print "[" targetstr "]"))))
			 (if (not dmode)(print targetstr))))
		   (let* ((run-id  (db:get-value-by-header run header "id"))
			  (runname (db:get-value-by-header run header "runname")) 
			  (tests   (mt:get-tests-for-run run-id testpatt '() '())))
		     (case dmode
		       ((json)
			(mutils:hierhash-set! data (db:get-value-by-header run header "status"  ) targetstr runname "meta" "status")
			(mutils:hierhash-set! data (db:get-value-by-header run header "state"   ) targetstr runname "meta" "state" )
			(mutils:hierhash-set! data (conc (db:get-value-by-header run header "id") targetstr runname "meta" "id"    )))


		       (else
			(print "Run: " targetstr "/" runname 
			       " status: " (db:get-value-by-header run header "state")
			       " run-id: " run-id ", number tests: " (length tests))))
		     (for-each 
		      (lambda (test)
			(let ((test-id  (db:test-get-id test))
			      (fullname (conc (db:test-get-testname test)
					      (if (equal? (db:test-get-item-path test) "")
						  "" 
						  (conc "(" (db:test-get-item-path test) ")"))))
			      (tstate   (db:test-get-state test))
			      (tstatus  (db:test-get-status test)))

			  (case dmode
			    ((json)
			     (mutils:hierhash-set! data fullname targetstr runname "data" (conc test-id) "tname")
			     (mutils:hierhash-set! data tstate   targetstr runname "data" (conc test-id) "state")
			     (mutils:hierhash-set! data tstatus  targetstr runname "data" (conc test-id) "status"))

			    (else
			     (format #t
				     "  Test: ~25a State: ~15a Status: ~15a Runtime: ~5@as Time: ~22a Host: ~10a\n"
				     fullname
				     tstate
				     tstatus
				     (db:test-get-run_duration test)
				     (db:test-get-event_time test)
				     (db:test-get-host test))
			     (if (not (or (equal? (db:test-get-status test) "PASS")
					  (equal? (db:test-get-status test) "WARN")
					  (equal? (db:test-get-state test)  "NOT_STARTED")))
				 (begin
				   (print "         cpuload:  " (db:test-get-cpuload test)
					  "\n         diskfree: " (db:test-get-diskfree test)







|
|
|
>
>












|
>


|
|
|
>







|







700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
			 ;; (print "[" targetstr "]"))))
			 (if (not dmode)(print targetstr))))
		   (let* ((run-id  (db:get-value-by-header run header "id"))
			  (runname (db:get-value-by-header run header "runname")) 
			  (tests   (mt:get-tests-for-run run-id testpatt '() '())))
		     (case dmode
		       ((json)
			(mutils:hierhash-set! data (db:get-value-by-header run header "status"  )   targetstr runname "meta" "status")
			(mutils:hierhash-set! data (db:get-value-by-header run header "state"   )   targetstr runname "meta" "state" )
			(mutils:hierhash-set! data (conc (db:get-value-by-header run header "id")   targetstr runname "meta" "id"    ))
			(mutils:hierhash-set! data (db:get-value-by-header run header "event_time") targetstr runname "meta" "event_time")
			)
		       (else
			(print "Run: " targetstr "/" runname 
			       " status: " (db:get-value-by-header run header "state")
			       " run-id: " run-id ", number tests: " (length tests))))
		     (for-each 
		      (lambda (test)
			(let ((test-id  (db:test-get-id test))
			      (fullname (conc (db:test-get-testname test)
					      (if (equal? (db:test-get-item-path test) "")
						  "" 
						  (conc "(" (db:test-get-item-path test) ")"))))
			      (tstate   (db:test-get-state test))
			      (tstatus  (db:test-get-status test))
                              (event-time (db:test-get-event_time test)))
			  (case dmode
			    ((json)
			     (mutils:hierhash-set! data fullname   targetstr runname "data" (conc test-id) "tname")
			     (mutils:hierhash-set! data tstate     targetstr runname "data" (conc test-id) "state")
			     (mutils:hierhash-set! data tstatus    targetstr runname "data" (conc test-id) "status")
			     (mutils:hierhash-set! data event-time targetstr runname "data" (conc test-id) "event_time"))
			    (else
			     (format #t
				     "  Test: ~25a State: ~15a Status: ~15a Runtime: ~5@as Time: ~22a Host: ~10a\n"
				     fullname
				     tstate
				     tstatus
				     (db:test-get-run_duration test)
				     event-time
				     (db:test-get-host test))
			     (if (not (or (equal? (db:test-get-status test) "PASS")
					  (equal? (db:test-get-status test) "WARN")
					  (equal? (db:test-get-state test)  "NOT_STARTED")))
				 (begin
				   (print "         cpuload:  " (db:test-get-cpuload test)
					  "\n         diskfree: " (db:test-get-diskfree test)