Megatest

Check-in [92f8a89d60]
Login
Overview
Comment:Couple tweaks to toggles for hiding based on state and status; added more states/statuses
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 92f8a89d60980b8eca223fdc881960fd8096d39b
User & Date: mrwellan on 2011-10-10 11:00:51
Other Links: manifest | tags
Context
2011-10-10
15:40
Moved quit button to lower left check-in: 85c2621ab5 user: mrwellan tags: trunk
11:00
Couple tweaks to toggles for hiding based on state and status; added more states/statuses check-in: 92f8a89d60 user: mrwellan tags: trunk
2011-10-09
23:54
Added toggles to hide tests based on PASS, FAIL etc. check-in: e2c3e19524 user: matt tags: trunk
Changes

Modified dashboard.scm from [0dc69fbd79] to [fe2312dc60].

179
180
181
182
183
184
185
186
187
188
189
190
191
192

193
194
195
196
197
198
199
200
201
202

203
204
205
206

207
208
209
210
211
212
213
  (let* ((c1 (map string->number (string-split color1)))
	 (c2 (map string->number (string-split color2)))
	 (delta (map (lambda (a b)(abs (- a b))) c1 c2)))
    (null? (filter (lambda (x)(> x 3)) delta))))

;; keypatts: ( (KEY1 "abc%def")(KEY2 "%") )
(define (update-rundat runnamepatt numruns testnamepatt itemnamepatt keypatts)
  (let* ((allruns     (db:get-runs *db* runnamepatt numruns *start-run-offset* keypatts))
	 (header      (db:get-header allruns))
	 (runs        (db:get-rows   allruns))
	 (result      '())
	 (maxtests    0)
	 (states      (hash-table-keys *state-ignore-hash*))
	 (statuses    (hash-table-keys *status-ignore-hash*)))

    (if (> (+ *last-update* 300) (current-seconds)) ;; every five minutes
	(begin
	  (set! *last-update* (current-seconds))
	  (set! *tot-run-count* (db:get-num-runs *db* runnamepatt))))
    (for-each (lambda (run)
		(let* ((run-id   (db:get-value-by-header run header "id"))
		       (tests    (db-get-tests-for-run *db* run-id testnamepatt itemnamepatt states statuses))
		       (key-vals (get-key-vals *db* run-id)))
		  (if (> (length tests) maxtests)
		      (set! maxtests (length tests)))

		  (set! result (cons (vector run tests key-vals) result))))
	      runs)
    (set! *header*  header)
    (set! *allruns* result)

    maxtests))

(define *collapsed* (make-hash-table))
; (define *row-lookup* (make-hash-table)) ;; testname => (rownum lableobj)

(define (toggle-hide lnum) ; fulltestname)
  (let* ((btn (vector-ref (vector-ref uidat 0) lnum))







|






>
|
|
|
|






>
|



>







179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
  (let* ((c1 (map string->number (string-split color1)))
	 (c2 (map string->number (string-split color2)))
	 (delta (map (lambda (a b)(abs (- a b))) c1 c2)))
    (null? (filter (lambda (x)(> x 3)) delta))))

;; keypatts: ( (KEY1 "abc%def")(KEY2 "%") )
(define (update-rundat runnamepatt numruns testnamepatt itemnamepatt keypatts)
  (let* ((allruns     (db:get-runs *db* runnamepatt (+ numruns (/ numruns 2)) *start-run-offset* keypatts))
	 (header      (db:get-header allruns))
	 (runs        (db:get-rows   allruns))
	 (result      '())
	 (maxtests    0)
	 (states      (hash-table-keys *state-ignore-hash*))
	 (statuses    (hash-table-keys *status-ignore-hash*)))
    ;; Instead of this mechanism lets try setting number of runs based on "result" below
    ;; (if (> (+ *last-update* 300) (current-seconds)) ;; every five minutes
    ;;     (begin
    ;;       (set! *last-update* (current-seconds))
    ;;       (set! *tot-run-count* (db:get-num-runs *db* runnamepatt))))
    (for-each (lambda (run)
		(let* ((run-id   (db:get-value-by-header run header "id"))
		       (tests    (db-get-tests-for-run *db* run-id testnamepatt itemnamepatt states statuses))
		       (key-vals (get-key-vals *db* run-id)))
		  (if (> (length tests) maxtests)
		      (set! maxtests (length tests)))
		  (if (not (null? tests))
		      (set! result (cons (vector run tests key-vals) result)))))
	      runs)
    (set! *header*  header)
    (set! *allruns* result)
    (set! *tot-run-count* (+ 1 (length *allruns*)))
    maxtests))

(define *collapsed* (make-hash-table))
; (define *row-lookup* (make-hash-table)) ;; testname => (rownum lableobj)

(define (toggle-hide lnum) ; fulltestname)
  (let* ((btn (vector-ref (vector-ref uidat 0) lnum))
459
460
461
462
463
464
465
466





467
468
469
470
471
472
473
474
475












476
477
478
479
480
481
482
483
484
485
486

487
488
489
490
491
492
493
494
	      (iup:toggle "WARN"   #:action   (lambda (obj val)
						(if (eq? val 1)
						    (hash-table-set! *status-ignore-hash* "WARN" #t)
						    (hash-table-delete! *status-ignore-hash* "WARN"))))
	      (iup:toggle "WAIVED"   #:action   (lambda (obj val)
						  (if (eq? val 1)
						      (hash-table-set! *status-ignore-hash* "WAIVED" #t)
						      (hash-table-delete! *status-ignore-hash* "WAIVED")))))





	     (iup:hbox
	      (iup:toggle "RUNNING"   #:action   (lambda (obj val)
						   (if (eq? val 1)
						       (hash-table-set! *state-ignore-hash* "RUNNING" #t)
						       (hash-table-delete! *state-ignore-hash* "RUNNING"))))
	      (iup:toggle "COMPLETED"   #:action   (lambda (obj val)
						     (if (eq? val 1)
							 (hash-table-set! *state-ignore-hash* "COMPLETED" #t)
							 (hash-table-delete! *state-ignore-hash* "COMPLETED"))))












	      (iup:toggle "KILLED"   #:action   (lambda (obj val)
						  (if (eq? val 1)
						      (hash-table-set! *state-ignore-hash* "KILLED" #t)
						      (hash-table-delete! *state-ignore-hash* "KILLED")))))))
	   (iup:valuator #:valuechanged_cb (lambda (obj)
					     (let ((val (inexact->exact (round (string->number (iup:attribute obj "VALUE")))))
						   (maxruns  *tot-run-count*)) ;;; (+ *num-runs* (length *allruns*))))
					       (set! *start-run-offset* val)
					       (debug:print 3 "maxruns: " maxruns ", val: " val)
					       (iup:attribute-set! obj "MAX" maxruns)))
			 #:expand "YES"

			 #:max (+ *num-runs* (length *allruns*)))
	   ;(iup:button "inc rows" #:action (lambda (obj)(set! *num-tests* (+ *num-tests* 1))))
	   ;(iup:button "dec rows" #:action (lambda (obj)(set! *num-tests* (if (> *num-tests* 0)(- *num-tests* 1) 0))))
	   )
	  )
    
    ;; create the left most column for the run key names and the test names 
    (set! lftlst (list (iup:hbox







|
>
>
>
>
>









>
>
>
>
>
>
>
>
>
>
>
>





|





>
|







462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
	      (iup:toggle "WARN"   #:action   (lambda (obj val)
						(if (eq? val 1)
						    (hash-table-set! *status-ignore-hash* "WARN" #t)
						    (hash-table-delete! *status-ignore-hash* "WARN"))))
	      (iup:toggle "WAIVED"   #:action   (lambda (obj val)
						  (if (eq? val 1)
						      (hash-table-set! *status-ignore-hash* "WAIVED" #t)
						      (hash-table-delete! *status-ignore-hash* "WAIVED"))))
	      (iup:toggle "STUCK/DEAD"   #:action   (lambda (obj val)
						  (if (eq? val 1)
						      (hash-table-set! *status-ignore-hash* "STUCK/DEAD" #t)
						      (hash-table-delete! *status-ignore-hash* "STUCK/DEAD"))))
	      )
	     (iup:hbox
	      (iup:toggle "RUNNING"   #:action   (lambda (obj val)
						   (if (eq? val 1)
						       (hash-table-set! *state-ignore-hash* "RUNNING" #t)
						       (hash-table-delete! *state-ignore-hash* "RUNNING"))))
	      (iup:toggle "COMPLETED"   #:action   (lambda (obj val)
						     (if (eq? val 1)
							 (hash-table-set! *state-ignore-hash* "COMPLETED" #t)
							 (hash-table-delete! *state-ignore-hash* "COMPLETED"))))
	      (iup:toggle "INCOMPLETE"   #:action   (lambda (obj val)
						     (if (eq? val 1)
							 (hash-table-set! *state-ignore-hash* "INCOMPLETE" #t)
							 (hash-table-delete! *state-ignore-hash* "INCOMPLETE"))))
	      (iup:toggle "LAUNCHED"   #:action   (lambda (obj val)
						     (if (eq? val 1)
							 (hash-table-set! *state-ignore-hash* "LAUNCHED" #t)
							 (hash-table-delete! *state-ignore-hash* "LAUNCHED"))))
	      (iup:toggle "NOT_STARTED"   #:action   (lambda (obj val)
						     (if (eq? val 1)
							 (hash-table-set! *state-ignore-hash* "NOT_STARTED" #t)
							 (hash-table-delete! *state-ignore-hash* "NOT_STARTED"))))
	      (iup:toggle "KILLED"   #:action   (lambda (obj val)
						  (if (eq? val 1)
						      (hash-table-set! *state-ignore-hash* "KILLED" #t)
						      (hash-table-delete! *state-ignore-hash* "KILLED")))))))
	   (iup:valuator #:valuechanged_cb (lambda (obj)
					     (let ((val (inexact->exact (round (+ 0.5 (string->number (iup:attribute obj "VALUE"))))))
						   (maxruns  *tot-run-count*)) ;;; (+ *num-runs* (length *allruns*))))
					       (set! *start-run-offset* val)
					       (debug:print 3 "maxruns: " maxruns ", val: " val)
					       (iup:attribute-set! obj "MAX" maxruns)))
			 #:expand "YES"
			 #:max (+ ;; *num-runs*
				(length *allruns*)))
	   ;(iup:button "inc rows" #:action (lambda (obj)(set! *num-tests* (+ *num-tests* 1))))
	   ;(iup:button "dec rows" #:action (lambda (obj)(set! *num-tests* (if (> *num-tests* 0)(- *num-tests* 1) 0))))
	   )
	  )
    
    ;; create the left most column for the run key names and the test names 
    (set! lftlst (list (iup:hbox