Megatest

Check-in [95351f9ba6]
Login
Overview
Comment:xor looking good; still need to fixup slider lock issue
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | xor-two-runs
Files: files | file ages | folders
SHA1: 95351f9ba65b6a93ba8f8a4c29ba7077011129cb
User & Date: bjbarcla on 2016-09-06 12:58:47
Other Links: branch diff | manifest | tags
Context
2016-09-06
16:14
fixed slider; tweaked some diff state colors check-in: 81a014242f user: bjbarcla tags: xor-two-runs
12:58
xor looking good; still need to fixup slider lock issue check-in: 95351f9ba6 user: bjbarcla tags: xor-two-runs
2016-09-02
18:10
wip check-in: 26c23ee62d user: bjbarcla tags: xor-two-runs
Changes

Modified dashboard.scm from [6533588be6] to [36f4a3ef63].

1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
      ;; (print "one-run-updater, changed: " changed " pass-num: " pass-num)
      (if changed (iup:attribute-set! run-matrix "REDRAW" "ALL")))))




(define (dashboard:xor-two-runs-updater commondat tabdat tb cell-lookup run-matrix )
  (print "BB> HeLLooo from xor-two-runs-updater")
  (let* ((runs-dat     (rmt:get-runs-by-patt (dboard:tabdat-keys tabdat) "%" #f #f #f #f))
	 (runs-header  (vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records
         (prev-run-id       (dboard:tabdat-prev-run-id tabdat))
	 (curr-run-id       (dboard:tabdat-curr-run-id tabdat))
	 (last-update  0) ;; fix me - have to create and store a rundat record for this
	 (dest-tests-dat    (dboard:get-tests-dat tabdat curr-run-id last-update)) ;; does query to get run info
         (src-tests-dat    (dboard:get-tests-dat tabdat prev-run-id last-update)) ;; does query to get run info







<







1499
1500
1501
1502
1503
1504
1505

1506
1507
1508
1509
1510
1511
1512
      ;; (print "one-run-updater, changed: " changed " pass-num: " pass-num)
      (if changed (iup:attribute-set! run-matrix "REDRAW" "ALL")))))




(define (dashboard:xor-two-runs-updater commondat tabdat tb cell-lookup run-matrix )

  (let* ((runs-dat     (rmt:get-runs-by-patt (dboard:tabdat-keys tabdat) "%" #f #f #f #f))
	 (runs-header  (vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records
         (prev-run-id       (dboard:tabdat-prev-run-id tabdat))
	 (curr-run-id       (dboard:tabdat-curr-run-id tabdat))
	 (last-update  0) ;; fix me - have to create and store a rundat record for this
	 (dest-tests-dat    (dboard:get-tests-dat tabdat curr-run-id last-update)) ;; does query to get run info
         (src-tests-dat    (dboard:get-tests-dat tabdat prev-run-id last-update)) ;; does query to get run info

Modified dcommon.scm from [7e012ba591] to [88138cb2b1].

273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
      '()
      (let loop ((hed (car tests-dat))
		 (tal (cdr tests-dat))
		 (res '()))
	(let* ((test-id    (db:test-get-id hed)) ;; look at the tests-dat spec for locations
	       (test-name  (db:test-get-testname hed))
	       (item-path  (db:test-get-item-path hed))
	       (state      (db:test-get-status hed))
	       (status     (db:test-get-status hed))
	       (newitem    (list test-name item-path (list test-id state status))))
	  (if (null? tal)
	      (reverse (cons newitem res))
	      (loop (car tal)(cdr tal)(cons newitem res)))))))









|







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
      '()
      (let loop ((hed (car tests-dat))
		 (tal (cdr tests-dat))
		 (res '()))
	(let* ((test-id    (db:test-get-id hed)) ;; look at the tests-dat spec for locations
	       (test-name  (db:test-get-testname hed))
	       (item-path  (db:test-get-item-path hed))
	       (state      (db:test-get-state hed))
	       (status     (db:test-get-status hed))
	       (newitem    (list test-name item-path (list test-id state status))))
	  (if (null? tal)
	      (reverse (cons newitem res))
	      (loop (car tal)(cdr tal)(cons newitem res)))))))


312
313
314
315
316
317
318
319
320
321

322

323
324

325

326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
     ((> (length mem1) (length mem2)) 1)
     (else -1))))
     
(define (dcommon:xor-tests-mindat src-tests-mindat dest-tests-mindat)
  (let* ((src-hash (dcommon:tests-mindat->hash src-tests-mindat))
         (dest-hash (dcommon:tests-mindat->hash dest-tests-mindat))
         (all-keys
          (sort 
           (delete-duplicates
            (append (hash-table-keys src-hash) (hash-table-keys dest-hash)))

           (lambda (a b)

             (if (= -1 (string-compare3 (car a) (car b)))
                 #t

                 (if (= -1 (string-compare3 (cdr a) (cdr b)))

                     #t
                     #f))))))
    (pretty-print all-keys)
    (map ;; TODO: rename xor to delta globally in dcommon and dashboard
     (lambda (key)
       (let* ((test-name (car key))
              (item-path (cdr key))

              (dest-value (hash-table-ref/default dest-hash key #f)) ;; (list test-id state status)
              (dest-test-id  (if dest-value (list-ref dest-value 0) #f))
              (dest-state    (if dest-value (list-ref dest-value 1) #f))
              (dest-status   (if dest-value (list-ref dest-value 2) #f))

              (src-value     (hash-table-ref/default src-hash key #f))   ;; (list test-id state status)
              (src-test-id   (if src-value (list-ref src-value 0) #f))
              (src-state     (if src-value (list-ref src-value 1) #f))
              (src-status    (if src-value (list-ref src-value 2) #f))

              (incomplete-statuses '("DELETED" "INCOMPLETE" "STUCK/DEAD" "N/A")) ;; if any of these statuses apply, treat test as incomplete

              (dest-complete
               (and dest-value dest-state dest-status
                    (equal? dest-state "COMPLETE")
                    (not (member dest-status incomplete-statuses))))
              (src-complete
               (and src-value src-state src-status
                    (equal? src-state "COMPLETE")
                    (not (member src-status incomplete-statuses))))
              (status-compare-result (dcommon:status-compare3 src-status dest-status))
              (xor-new-item
               (cond
                ;; complete, for this case means: state=compelte AND status not in ( deleted uncomplete stuck/dead n/a )
                ;; neither complete -> bad

                ;; src !complete, dest complete -> better
                ((and (not dest-complete) (not src-complete))
                 (list dest-test-id "BOTH-BAD" "BOTH-INCOMPLETE"))
                ((not dest-complete)
                 (list src-test-id "DIFF-MISSING" "DEST-INCOMPLETE"))  
                ((not src-complete)
                 (list dest-test-id "DIFF-NEW" "SRC-INCOMPLETE"))      
                ((and
                  (equal? src-state dest-state)
                  (equal? src-status dest-status))
                 (list dest-test-id  dest-state (conc "CLEAN:" dest-status) )) 
                ;;    better or worse: pass > warn > waived > skip > fail > abort
                ;;     pass > warn > waived > skip > fail > abort
                
                ((= 1 status-compare-result) ;; src is better, dest is worse
                 (list dest-test-id "DIRTY-WORSE" (conc src-status "->" dest-status)))
                (else
                 (list dest-test-id "DIRTY-BETTER" (conc src-status "->" dest-status)))







|


>
|
>
|
<
>
|
>
|
|
<



















|



|

















|







312
313
314
315
316
317
318
319
320
321
322
323
324
325

326
327
328
329
330

331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
     ((> (length mem1) (length mem2)) 1)
     (else -1))))
     
(define (dcommon:xor-tests-mindat src-tests-mindat dest-tests-mindat)
  (let* ((src-hash (dcommon:tests-mindat->hash src-tests-mindat))
         (dest-hash (dcommon:tests-mindat->hash dest-tests-mindat))
         (all-keys
          (reverse (sort 
           (delete-duplicates
            (append (hash-table-keys src-hash) (hash-table-keys dest-hash)))

           (lambda (a b) 
             (cond
              ((< 0 (string-compare3 (car a) (car b))) #t)

              ((> 0 (string-compare3 (car a) (car b))) #f)
              ((< 0 (string-compare3 (cdr a) (cdr b))) #t)
              (else #f)))

           ))))

    (map ;; TODO: rename xor to delta globally in dcommon and dashboard
     (lambda (key)
       (let* ((test-name (car key))
              (item-path (cdr key))

              (dest-value (hash-table-ref/default dest-hash key #f)) ;; (list test-id state status)
              (dest-test-id  (if dest-value (list-ref dest-value 0) #f))
              (dest-state    (if dest-value (list-ref dest-value 1) #f))
              (dest-status   (if dest-value (list-ref dest-value 2) #f))

              (src-value     (hash-table-ref/default src-hash key #f))   ;; (list test-id state status)
              (src-test-id   (if src-value (list-ref src-value 0) #f))
              (src-state     (if src-value (list-ref src-value 1) #f))
              (src-status    (if src-value (list-ref src-value 2) #f))

              (incomplete-statuses '("DELETED" "INCOMPLETE" "STUCK/DEAD" "N/A")) ;; if any of these statuses apply, treat test as incomplete

              (dest-complete
               (and dest-value dest-state dest-status
                    (equal? dest-state "COMPLETED")
                    (not (member dest-status incomplete-statuses))))
              (src-complete
               (and src-value src-state src-status
                    (equal? src-state "COMPLETED")
                    (not (member src-status incomplete-statuses))))
              (status-compare-result (dcommon:status-compare3 src-status dest-status))
              (xor-new-item
               (cond
                ;; complete, for this case means: state=compelte AND status not in ( deleted uncomplete stuck/dead n/a )
                ;; neither complete -> bad

                ;; src !complete, dest complete -> better
                ((and (not dest-complete) (not src-complete))
                 (list dest-test-id "BOTH-BAD" "BOTH-INCOMPLETE"))
                ((not dest-complete)
                 (list src-test-id "DIFF-MISSING" "DEST-INCOMPLETE"))  
                ((not src-complete)
                 (list dest-test-id "DIFF-NEW" "SRC-INCOMPLETE"))      
                ((and
                  (equal? src-state dest-state)
                  (equal? src-status dest-status))
                 (list dest-test-id  (conc "CLEAN") (conc "CLEAN-" dest-status) )) 
                ;;    better or worse: pass > warn > waived > skip > fail > abort
                ;;     pass > warn > waived > skip > fail > abort
                
                ((= 1 status-compare-result) ;; src is better, dest is worse
                 (list dest-test-id "DIRTY-WORSE" (conc src-status "->" dest-status)))
                (else
                 (list dest-test-id "DIRTY-BETTER" (conc src-status "->" dest-status)))

Modified gutils.scm from [628c78d614] to [8c2f334f02].

39
40
41
42
43
44
45





46
47
48
49
50
51
52
       (else (list "180 33 49" status))))
    ;;      (if (equal? status "PASS")
    ;;	  '("70 249 73" "PASS")
    ;;	  (if (or (equal? status "WARN")
    ;;		  (equal? status "WAIVED"))
    ;;	      (list "255 172 13" status)
    ;;	      (list "223 33 49"  status)))) ;; greenish orangeish redish





    ((LAUNCHED)         (list "101 123 142"  state))
    ((CHECK)            (list "255 100 50"   state))
    ((REMOTEHOSTSTART)  (list "50 130 195"   state))
    ((RUNNING)          (list "9 131 232"    state))
    ((KILLREQ)          (list "39 82 206"    state))
    ((KILLED)           (list "234 101 17"   state))
    ((NOT_STARTED)      (list "240 240 240"  state))







>
>
>
>
>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
       (else (list "180 33 49" status))))
    ;;      (if (equal? status "PASS")
    ;;	  '("70 249 73" "PASS")
    ;;	  (if (or (equal? status "WARN")
    ;;		  (equal? status "WAIVED"))
    ;;	      (list "255 172 13" status)
    ;;	      (list "223 33 49"  status)))) ;; greenish orangeish redish

    ((CLEAN)       (list "60  235 63" status))
    ((DIRTY-BETTER)     (list "160  255 153" status))
    ((DIRTY-WORSE)      (list "165 42  42" status))
    ((BOTH-BAD)         (list "253 33 49" state))
    ((LAUNCHED)         (list "101 123 142"  state))
    ((CHECK)            (list "255 100 50"   state))
    ((REMOTEHOSTSTART)  (list "50 130 195"   state))
    ((RUNNING)          (list "9 131 232"    state))
    ((KILLREQ)          (list "39 82 206"    state))
    ((KILLED)           (list "234 101 17"   state))
    ((NOT_STARTED)      (list "240 240 240"  state))