Megatest

Diff
Login

Differences From Artifact [3c2896b4ca]:

To Artifact [7594703fba]:


873
874
875
876
877
878
879


880
881
882
883
884
































885
886
887
888
889
890
891
873
874
875
876
877
878
879
880
881





882
883
884
885
886
887
888
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







+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







;; S U M M A R Y 
;;======================================================================
;;
;; General info about the run(s) and megatest area
(define (dashboard:summary)
  (let ((rawconfig        (read-config (conc *toppath* "/megatest.config") #f 'return-string)))
    (iup:vbox
     (iup:split
      ;; #:value 500
     (iup:frame 
      #:title "General Info"
      (iup:hbox 
       (dcommon:general-info)
       (dcommon:keys-matrix rawconfig)))
      (iup:frame 
       #:title "General Info"
       (iup:hbox 
	(dcommon:keys-matrix rawconfig)
	(dcommon:general-info)
	))
      (iup:frame
       #:title "Server"
       (iup:vbox
	(iup:hbox
	 (iup:button "Start"
		      #:size "50x"
		      #:action (lambda (obj)
				(let ((cmd (conc "xterm -geometry 180x20 -e \""
						 "megatest -server -"
						 ";echo Press any key to continue;bash -c 'read -n 1 -s'\" &")))
				  (system cmd))))
	 (iup:button "Stop"
		      #:size "50x"
		      #:action (lambda (obj)
				(let ((cmd (conc "xterm -geometry 180x20 -e \""
						 "megatest -stop-server 0"
						 ";echo Press any key to continue;bash -c 'read -n 1 -s'\" &")))
				  (system cmd))))
	 (iup:button "Restart"
		      #:size "50x"
		      #:action (lambda (obj)
				(let ((cmd (conc "xterm -geometry 180x20 -e \""
						 "megatest -stop-server 0;megatest -server -"
						 ";echo Press any key to continue;bash -c 'read -n 1 -s'\" &")))
				  (system cmd))))
	 ))))
     (iup:frame 
      #:title "Megatest config settings"
      (iup:hbox
       (dcommon:section-matrix rawconfig "setup" "Varname" "Value")
       (iup:vbox
	(dcommon:section-matrix rawconfig "server" "Varname" "Value")
	;; (iup:frame
930
931
932
933
934
935
936
937







938
939
940
941
942
943


944
945
946
947
948
949
950
959
960
961
962
963
964
965

966
967
968
969
970
971
972
973
974
975
976


977
978
979
980
981
982
983
984
985







-
+
+
+
+
+
+
+




-
-
+
+







	 (updater  (lambda ()
		     (let* ((runs-dat     (mt:get-runs-by-patt *keys* "%" #f))
			    (runs-header  (vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records
			    (run-id       (dboard:data-get-curr-run-id *data*))
			    (tests-dat    (let ((tdat (mt:get-tests-for-run run-id "%" '() '()
									    qryvals: "id,testname,item_path,state,status"))) ;; get 'em all
					    (sort tdat (lambda (a b)
							 (string<= (vector-ref a 2)(vector-ref b 2))))))
							 (let* ((aval (vector-ref a 2))
								(bval (vector-ref b 2))
								(anum (string->number aval))
								(bnum (string->number bval)))
							   (if (and anum bnum)
							       (< anum bnum)
							       (string<= aval bval)))))))
			    (tests-mindat (dcommon:minimize-test-data tests-dat))
			    (indices      (common:sparse-list-generate-index tests-mindat)) ;;  proc: set-cell))
			    (row-indices  (cadr indices))
			    (col-indices  (car indices))
			    (max-row      (if (null? row-indices) 1 (apply max (map cadr row-indices))))
			    (max-col      (if (null? col-indices) 1 (apply max (map cadr col-indices))))
			    (max-row      (if (null? row-indices) 1 (common:max (map cadr row-indices))))
			    (max-col      (if (null? col-indices) 1 (common:max (map cadr col-indices))))
			    (max-visible  (max (- *num-tests* 15) 3)) ;; *num-tests* is proportional to the size of the window
			    (numrows      1)
			    (numcols      1)
			    (changed      #f)
			    (runs-hash    (let ((ht (make-hash-table)))
					    (for-each (lambda (run)
							(hash-table-set! ht (db:get-value-by-header run runs-header "id") run))