Megatest

Diff
Login

Differences From Artifact [5d6b4a68c6]:

To Artifact [bceb20a8e4]:


36
37
38
39
40
41
42
43
44
45



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;; 
;; A single data structure for all the data used in a dashboard for
;; all areas tracked.
;;


(define-record dboard:data
  cfgdat            ;; data from ~/.megatest/<group>.dat
  areas             ;; hash of areaname -> area-rec
  current-window-id



  )

(define-record dboard:area
  tree
  matrix
  area-dat  ;; the one-structure (one day dbstruct will be put in here)
  view-path ;; <target/path>/<runname>/...
  view-type ;; standard, etc.
  matrix    ;; the spreadsheet 
  controls  ;; the controls
  data      ;; all the data kept in sync with db
  filters   ;; user filters 
  run-id    ;; the current run-id
  test-ids  ;; the current test id hash, run-id => test-id
  command   ;; the command from the entry field
  )







|
|
|
>
>
>


|

|



<







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
;; 
;; A single data structure for all the data used in a dashboard for
;; all areas tracked.
;;


(define-record dboard:data
  cfgdat             ;; data from ~/.megatest/<group>.dat
  areas              ;; hash of areaname -> area-rec
  current-window-id  ;; 
  current-tab-id     ;; 
  update-needed      ;; flag to indicate that the tab pointed to by current tab id needs refreshing immediately
  tab-ids            ;; hash of tab-id -> areaname
  )

(define-record dboard:tab
  tree
  matrix    ;; the spreadsheet 
  area-dat  ;; the one-structure (one day dbstruct will be put in here)
  view-path ;; <target/path>/<runname>/...
  view-type ;; standard, etc.

  controls  ;; the controls
  data      ;; all the data kept in sync with db
  filters   ;; user filters 
  run-id    ;; the current run-id
  test-ids  ;; the current test id hash, run-id => test-id
  command   ;; the command from the entry field
  )
145
146
147
148
149
150
151
152
153






154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170



171
172
173
174
175
176
177
178
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
;; TO-DO
;;  1. Make "data" hash-table hierarchial store of all displayed data
;;  2. Update synchash to understand "get-runs", "get-tests" etc.
;;  3. Add extraction of filters to synchash calls
;;
;; Mode is 'full or 'incremental for full refresh or incremental refresh
(define (dcommon:run-update data)
  (thread-sleep! 0.25))







;;  (let* (;; count and offset => #f so not used
;; 	 ;; the synchash calls modify the "data" hash
;; 	 (get-runs-sig    (conc (client:get-signature) " get-runs"))
;; 	 (get-tests-sig   (conc (client:get-signature) " get-tests"))
;; 	 (get-details-sig (conc (client:get-signature) " get-test-details"))
;; 
;; 	 ;; test-ids to get and display are indexed on window-id in curr-test-ids hash
;; 	 (test-ids        (hash-table-values (dboard:data-get-curr-test-ids *data*)))
;; 	 ;; run-id is #f in next line to send the query to server 0
;;  	 (run-changes     (synchash:client-get *area-dat* 'db:get-runs get-runs-sig (length keypatts) data #f runname #f #f keypatts))
;; 	 (tests-detail-changes (if (not (null? test-ids))
;; 				   (synchash:client-get *area-dat* 'db:get-test-info-by-ids get-details-sig 0  data #f test-ids)
;; 				   '()))
;; 
;; 	 ;; Now can calculate the run-ids
;; 	 (run-hash    (hash-table-ref/default data get-runs-sig #f))
;; 	 (run-ids     (if run-hash (filter number? (hash-table-keys run-hash)) '()))



;; 
;; 	 (all-test-changes (let ((res (make-hash-table)))
;; 			     (for-each (lambda (run-id)
;; 					 (if (> run-id 0)
;; 					     (hash-table-set! res run-id (synchash:client-get *area-dat* 'db:get-tests-for-run-mindata get-tests-sig 0 data run-id 1 testpatt states statuses #f))))
;; 				       run-ids)
;; 			     res))
;; 	 (runs-hash    (hash-table-ref/default data get-runs-sig #f))
;; 	 (header       (hash-table-ref/default runs-hash "header" #f))
;; 	 (run-ids      (sort (filter number? (hash-table-keys runs-hash))
;; 			     (lambda (a b)
;; 			       (let* ((record-a (hash-table-ref runs-hash a))
;; 				      (record-b (hash-table-ref runs-hash b))
;; 				      (time-a   (db:get-value-by-header record-a header "event_time"))
;; 				      (time-b   (db:get-value-by-header record-b header "event_time")))
;; 				 (> time-a time-b)))
;; 			     ))
;; 	 (runid-to-col    (hash-table-ref *cachedata* "runid-to-col"))
;; 	 (testname-to-row (hash-table-ref *cachedata* "testname-to-row")) 
;; 	 (colnum       1)
;; 	 (rownum       0)) ;; rownum = 0 is the header
;; ;; (debug:print 0 "test-ids " test-ids ", tests-detail-changes " tests-detail-changes)
;;     
;; 	 ;; tests related stuff
;; 	 ;; (all-testnames (delete-duplicates (map db:test-get-testname test-changes))))
;; 
;;     ;; Given a run-id and testname/item_path calculate a cell R:C
;; 
;;     ;; NOTE: Also build the test tree browser and look up table
;;     ;;
;;     ;; Each run is unique on its keys and runname or run-id, store in hash on colnum
;;     (for-each (lambda (run-id)
;; 		(let* ((run-record (hash-table-ref/default runs-hash run-id #f))
;; 		       (key-vals   (map (lambda (key)(db:get-value-by-header run-record header key))
;; 					keys))
;; 		       (run-name   (db:get-value-by-header run-record header "runname"))
;; 		       (col-name   (conc (string-intersperse key-vals "\n") "\n" run-name))
;; 		       (run-path   (append key-vals (list run-name))))







|
|
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
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
217
218
219
;; TO-DO
;;  1. Make "data" hash-table hierarchial store of all displayed data
;;  2. Update synchash to understand "get-runs", "get-tests" etc.
;;  3. Add extraction of filters to synchash calls
;;
;; Mode is 'full or 'incremental for full refresh or incremental refresh
(define (dcommon:run-update data)
  (let* ((current-tab-id  (dboard:data-current-tab-id data))
	 (area-name       (hash-table-ref (dboard:data-tab-ids data) current-tab-id))
	 (tab-dat         (hash-table-ref (dboard:data-areas   data) area-name))
	 (matrix          (dboard:tab-matrix tab-dat))
	 (tree            (dboard:tab-tree   tab-dat))
	 (area-dat        (dboard:tab-area-dat tab-dat))
	 (runpatt         "%")) ;; get from dboard:tab-filters
    (if (dboard:data-update-needed data)
	(let* (;; count and offset => #f so not used
	       ;; the synchash calls modify the "data" hash
	       ;; (get-runs-sig    (conc (client:get-signature) " get-runs"))
	       ;; (get-tests-sig   (conc (client:get-signature) " get-tests"))
	       ;; (get-details-sig (conc (client:get-signature) " get-test-details"))
 
	       ;; test-ids to get and display are indexed on window-id in curr-test-ids hash
	       ;; (test-ids        (hash-table-values (dboard:data-get-curr-test-ids *data*)))
	       ;; run-id is #f in next line to send the query to server 0
	       ;; (run-changes     (synchash:client-get *area-dat* 'db:get-runs get-runs-sig (length keypatts) data #f runname #f #f keypatts))
	       ;; (tests-detail-changes (if (not (null? test-ids))
	       ;;				 (synchash:client-get *area-dat* 'db:get-test-info-by-ids get-details-sig 0  data #f test-ids)
	       ;;				 '()))
 
	       ;; Now can calculate the run-ids
	       ;; (run-hash    (hash-table-ref/default data get-runs-sig #f))
	       ;; (run-ids     (if run-hash (filter number? (hash-table-keys run-hash)) '()))
	       (launch:setup-for-run area-dat)
	       (all-runs-dat   (rmt:get-runs runpatt #f #f '() area-dat)))
	  (print "all-runs-dat: " all-runs-dat)))))

	       ;; (all-test-changes (let ((res (make-hash-table)))
	       ;;  		       (for-each (lambda (run-id)
	       ;;  			            (if (> run-id 0)
	       ;;  				        (hash-table-set! res run-id (synchash:client-get *area-dat* 'db:get-tests-for-run-mindata get-tests-sig 0 data run-id 1 testpatt states statuses #f))))
	       ;;  			                run-ids)
 	       ;;  	                          res))
	       ;; (runs-hash    (hash-table-ref/default data get-runs-sig #f))
	       ;; (header       (hash-table-ref/default runs-hash "header" #f))
	       ;; (run-ids      (sort (filter number? (hash-table-keys runs-hash))
	       ;;  		   (lambda (a b)
	       ;;  		     (let* ((record-a (hash-table-ref runs-hash a))
	       ;;  			    (record-b (hash-table-ref runs-hash b))
	       ;;  			    (time-a   (db:get-value-by-header record-a header "event_time"))
	       ;;  			    (time-b   (db:get-value-by-header record-b header "event_time")))
	       ;;  		       (> time-a time-b)))
	       ;;  		   ))
	       ;; (runid-to-col    (hash-table-ref *cachedata* "runid-to-col"))
	       ;; (testname-to-row (hash-table-ref *cachedata* "testname-to-row")) 
	       ;; (colnum       1)
	       ;; (rownum       0)) ;; rownum = 0 is the header
	       ;; ;; (debug:print 0 "test-ids " test-ids ", tests-detail-changes " tests-detail-changes)
	       ;;     
	       ;; 	 ;; tests related stuff
	       ;; 	 ;; (all-testnames (delete-duplicates (map db:test-get-testname test-changes))))
	       ;; 
	       ;;     ;; Given a run-id and testname/item_path calculate a cell R:C
	       ;; 
	       ;;     ;; NOTE: Also build the test tree browser and look up table
	       ;;     ;;
	       ;;     ;; Each run is unique on its keys and runname or run-id, store in hash on colnum
;;     (for-each (lambda (run-id)
;; 		(let* ((run-record (hash-table-ref/default runs-hash run-id #f))
;; 		       (key-vals   (map (lambda (key)(db:get-value-by-header run-record header key))
;; 					keys))
;; 		       (run-name   (db:get-value-by-header run-record header "runname"))
;; 		       (col-name   (conc (string-intersperse key-vals "\n") "\n" run-name))
;; 		       (run-path   (append key-vals (list run-name))))