Megatest

Changes On Branch 24c163e8960da543
Login

Changes In Branch defstruct-srehman Through [24c163e896] Excluding Merge-Ins

This is equivalent to a diff from 5178c56168 to 24c163e896

2016-09-16
17:28
Start of rebase of runs-summary-contexts-menu to v1.62 check-in: 8c0fc4736d user: mrwellan tags: rebase-runs-summary-contexts-menu
2016-09-15
17:07
fixed var names check-in: 759d0eca16 user: srehman tags: defstruct-srehman
2016-09-14
14:17
added usage for typed-records check-in: 24c163e896 user: srehman tags: defstruct-srehman
13:50
fixed syntax for defstruct declaration check-in: 2abc692fe0 user: srehman tags: defstruct-srehman
2016-09-13
18:13
v1.62 now has all new features of xor-two-runs branch check-in: 9558941541 user: bjbarcla tags: v1.62
16:48
Create new branch named "defstruct-srehman" check-in: d6d6338dd1 user: srehman tags: defstruct-srehman
15:36
adding mode selector logic to runs-summary tab; added xor mode elements check-in: 5178c56168 user: bjbarcla tags: v1.62
2016-09-12
13:53
merged in latest fixes from v1.61 check-in: 485ad7daba user: bjbarcla tags: v1.62

Modified db.scm from [1c6bc853bb] to [2012e2597e].

2282
2283
2284
2285
2286
2287
2288
2289

2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302

2303
2304
2305
2306
2307
2308
2309
				(if tests-match-qry (conc " AND (" tests-match-qry ") ") ""))))
    (debug:print-info 8 *default-log-port* "db:get-tests-for-run qry=" qry)
    (db:with-db dbstruct run-id #f
		(lambda (db)
		  (sqlite3:for-each-row
		   (lambda (id testname item-path state status)
		     ;;                      id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment
		     (set! res (cons (vector id run-id testname state status -1         ""     -1      -1       ""    "-"  item-path -1           "-"         "-") res)))

		   db 
		   qry
		   run-id)))
    res))

(define (db:get-testinfo-state-status dbstruct run-id test-id)
  (let ((res            #f))
    (db:with-db dbstruct run-id #f
		(lambda (db)
		  (sqlite3:for-each-row
		   (lambda (run-id testname item-path state status)
		     ;; id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment
		     (set! res (vector test-id run-id testname state status -1 "" -1 -1 "" "-" item-path -1 "-" "-")))

		   db 
		   "SELECT run_id,testname,item_path,state,status FROM tests WHERE id=?;" 
		   test-id)))
    res))

;; get a useful subset of the tests data (used in dashboard
;; use db:mintest-get-{id ,run_id,testname ...}







|
>






|





|
>







2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
				(if tests-match-qry (conc " AND (" tests-match-qry ") ") ""))))
    (debug:print-info 8 *default-log-port* "db:get-tests-for-run qry=" qry)
    (db:with-db dbstruct run-id #f
		(lambda (db)
		  (sqlite3:for-each-row
		   (lambda (id testname item-path state status)
		     ;;                      id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment
		     ;;(set! res (cons (vector id run-id testname state status -1         ""     -1      -1       ""    "-"  item-path -1           "-"         "-") res)))
		     (cons (make-db:test-rec id: id testname: testname item-path: item-path state: state status: status) res))
		   db 
		   qry
		   run-id)))
    res))

(define (db:get-testinfo-state-status dbstruct run-id test-id)
  (let ((res            '()))
    (db:with-db dbstruct run-id #f
		(lambda (db)
		  (sqlite3:for-each-row
		   (lambda (run-id testname item-path state status)
		     ;; id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment
		     ;;(set! res (vector test-id run-id testname state status -1 "" -1 -1 "" "-" item-path -1 "-" "-")))
		     (cons (make-db:test-rec run_id: run-id testname: testname item-path: item-path state: state status: status) res))
		   db 
		   "SELECT run_id,testname,item_path,state,status FROM tests WHERE id=?;" 
		   test-id)))
    res))

;; get a useful subset of the tests data (used in dashboard
;; use db:mintest-get-{id ,run_id,testname ...}

Modified db_records.scm from [f90e27c50c] to [d8fe3f2cf4].

61
62
63
64
65
66
67


















68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

(define (dbr:dbstruct-get-localdb v run-id)
  (hash-table-ref/default (dbr:dbstruct-get-locdbs v) run-id #f))

(define (dbr:dbstruct-set-localdb! v run-id db)
  (hash-table-set! (dbr:dbstruct-get-locdbs v) run-id db))




















(define (make-db:test)(make-vector 20))
(define-inline (db:test-get-id           vec) (vector-ref vec 0))
(define-inline (db:test-get-run_id       vec) (vector-ref vec 1))
(define-inline (db:test-get-testname     vec) (vector-ref vec 2))
(define-inline (db:test-get-state        vec) (vector-ref vec 3))
(define-inline (db:test-get-status       vec) (vector-ref vec 4))
(define-inline (db:test-get-event_time   vec) (vector-ref vec 5))
(define-inline (db:test-get-host         vec) (vector-ref vec 6))
(define-inline (db:test-get-cpuload      vec) (vector-ref vec 7))
(define-inline (db:test-get-diskfree     vec) (vector-ref vec 8))
(define-inline (db:test-get-uname        vec) (vector-ref vec 9))
;; (define-inline (db:test-get-rundir       vec) (sdb:qry 'getstr (vector-ref vec 10)))
(define-inline (db:test-get-rundir       vec) (vector-ref vec 10))
(define-inline (db:test-get-item-path    vec) (vector-ref vec 11))
(define-inline (db:test-get-run_duration vec) (vector-ref vec 12))
(define-inline (db:test-get-final_logf   vec) (vector-ref vec 13))
(define-inline (db:test-get-comment      vec) (vector-ref vec 14))
(define-inline (db:test-get-process_id   vec) (vector-ref vec 16))
(define-inline (db:test-get-archived     vec) (vector-ref vec 17))

;; (define-inline (db:test-get-pass_count   vec) (vector-ref vec 15))
;; (define-inline (db:test-get-fail_count   vec) (vector-ref vec 16))
(define-inline (db:test-get-fullname     vec)
  (conc (db:test-get-testname vec) "/" (db:test-get-item-path vec)))

;; replace runs:make-full-test-name with this routine







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

<
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104
105
106
107
108
109
110

(define (dbr:dbstruct-get-localdb v run-id)
  (hash-table-ref/default (dbr:dbstruct-get-locdbs v) run-id #f))

(define (dbr:dbstruct-set-localdb! v run-id db)
  (hash-table-set! (dbr:dbstruct-get-locdbs v) run-id db))

(require-extension typed-records)
(defstruct db:test-rec ((id -1) : number)
					((run_id -1) : number) 
					((testname "") : string)
					((state "") : string)
					((status "") : string)
					((event_time -1) : number)
					((host "") : string)
					((cpuload -1) : number)
					((diskfree -1) : number)
					((uname "") : string)
					((rundir "") : string)
					((item-path "") : string)
					((run_duration -1) : number)
					((final_log "") : string)
					((comment "") : string)
					((process_id -1) : number)
					((archived #f) : boolean))


(define db:test-get-id 			  db:test-rec-id)
(define db:test-get-run_id 		  db:test-rec-run_id)
(define db:test-get-testname      db:test-rec-testname)
(define db:test-get-state         db:test-rec-state)
(define db:test-get-status        db:test-rec-status)
(define db:test-get-event_time    db:test-rec-event_time)
(define db:test-get-host          db:test-rec-host)
(define db:test-get-cpuload       db:test-rec-cpuload)
(define db:test-get-diskfree      db:test-rec-diskfree)
(define db:test-get-uname         db:test-rec-uname)

(define db:test-get-rundir        db:test-rec-rundir)
(define db:test-get-item-path     db:test-rec-itempath)
(define db:test-get-run_duration  db:test-rec-run_duration)
(define db:test-get-final_logf    db:test-rec-final_log)
(define db:test-get-comment       db:test-rec-comment)
(define db:test-get-process_id    db:test-rec-process_id)
(define db:test-get-archived      db:test-rec-archived)

;; (define-inline (db:test-get-pass_count   vec) (vector-ref vec 15))
;; (define-inline (db:test-get-fail_count   vec) (vector-ref vec 16))
(define-inline (db:test-get-fullname     vec)
  (conc (db:test-get-testname vec) "/" (db:test-get-item-path vec)))

;; replace runs:make-full-test-name with this routine