Megatest

Diff
Login

Differences From Artifact [9b3f9a0905]:

To Artifact [ab3d898579]:


28
29
30
31
32
33
34





































































































































































































35













36































37
38
39
40
41
42
43
(declare (uses csv-xml))
(declare (uses keysmod))
(declare (uses mtmod))
(declare (uses pkts))
(declare (uses dbi))

(module dbmod





































































































































































































	*













	































(import scheme
	(prefix sqlite3 sqlite3:)
	chicken.base
	chicken.condition
	chicken.eval
	chicken.file
	chicken.file.posix







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







28
29
30
31
32
33
34
35
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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
(declare (uses csv-xml))
(declare (uses keysmod))
(declare (uses mtmod))
(declare (uses pkts))
(declare (uses dbi))

(module dbmod
	   (
dbr:dbstruct-get-dbdat
dbr:dbstruct-dbdat-put!
db:run-id->first-num
db:run-id->path
db:dbname->path
db:run-id->dbname
db:get-dbdat
db:get-inmem
db:get-ddb
db:open-dbdat
db:open-run-db
db:open-inmem-db
db:setup
db:get-main-lock
db:with-lock-db
db:get-iam-server-lock
db:get-locker
db:take-lock
db:release-lock
db:general-sqlite-error-dump
db:first-result-default
db:generic-error-printout
db:with-db
db:set-sync
db:get-last-update-time
db:sync-inmem->disk
db:sync-main-list
db:sync-all-tables-list
db:move-and-recreate-db
db:repair-db
db:sync-one-table
db:sync-tables
db:patch-schema-rundb
db:patch-schema-maindb
db:adj-target
db:get-access-mode
db:dispatch-query
db:create-all-triggers
db:create-triggers
db:drop-all-triggers
db:is-trigger-dropped
db:drop-triggers
db:initialize-db
db:archive-get-allocations
db:archive-register-disk
db:archive-register-block-name
db:test-set-archive-block-id
db:test-get-archive-block-info
open-logging-db
db:log-local-event
db:log-event
db:have-incompletes?
db:get-status-from-final-status-file
db:find-and-mark-incomplete
db:top-test-set-per-pf-counts
db:clean-up
db:clean-up-rundb
db:get-var
db:inc-var
db:dec-var
db:set-var
db:add-var
db:del-var
db:open-no-sync-db
db:no-sync-db
db:no-sync-set
db:no-sync-del!
db:no-sync-get/default
db:no-sync-get-lock
db:get-keys
db:get-index-by-header
db:get-value-by-header
db:get-header
db:get-rows
db:get-run-times
db:get-run-name-from-id
db:get-run-key-val
runs:get-std-run-fields
db:register-run
db:insert-run
db:get-runs
db:simple-get-runs
db:get-changed-run-ids
db:get-targets
db:get-num-runs
db:get-runs-cnt-by-patt
db:get-raw-run-stats
db:update-run-stats
db:get-main-run-stats
db:print-current-query-stats
db:get-all-run-ids
db:get-run-stats
db:get-runs-by-patt
db:get-run-info
db:set-comment-for-run
db:delete-run
db:update-run-event_time
db:lock/unlock-run
db:set-run-status
db:set-run-state-status
db:get-run-status
db:get-run-state
db:get-key-val-pairs
db:get-key-vals
db:get-target
db:get-prev-run-ids
db:get-tests-for-run
db:test-short-record->norm
db:get-tests-for-run-state-status
db:get-testinfo-state-status
db:get-tests-for-run-mindata
db:get-tests-for-runs
db:delete-test-records
db:delete-old-deleted-test-records
db:set-tests-state-status
db:test-set-state-status
db:get-count-tests-running
db:get-count-tests-actually-running
db:get-count-tests-running-for-run-id
db:get-count-tests-running-for-testname
db:get-not-completed-cnt
db:get-count-tests-running-in-jobgroup
db:estimated-tests-remaining
db:get-test-id
db:test-set-top-process-pid
db:test-get-top-process-pid
db:field->number
db:update-tesdata-on-repilcate-db
db:get-all-tests-info-by-run-id
db:replace-test-records
db:get-test-info-by-id
db:get-test-info-by-ids
db:get-test-info
db:test-get-rundir-from-test-id
db:get-test-times
db:teststep-set-status!
db:delete-steps-for-test!
db:get-steps-for-test
db:get-steps-data
db:get-data-info-by-id
db:test-data-rollup
db:logpro-dat->csv
db:csv->test-data
db:read-test-data
db:read-test-data-varpatt
db:get-run-ids-matching-target
db:test-get-paths-matching-keynames-target-new
db:test-toplevel-num-items
db:obj->string
db:string->obj
db:set-state-status-and-roll-up-items
db:roll-up-rules
db:set-state-status-and-roll-up-run
db:get-all-state-status-counts-for-run
db:get-all-state-status-counts-for-test
db:test-get-logfile-info
db:lookup-query
db:login
db:general-call
db:get-state-status-summary
db:get-latest-host-load
db:set-top-level-from-items
db:get-matching-previous-test-run-records
db:test-get-records-for-index-file
db:get-tests-tags
db:testmeta-get-record
db:testmeta-add-record
db:testmeta-update-field
db:testmeta-get-all
db:compare-itempaths
db:convert-test-itempath
db:multi-pattern-apply
db:get-prereqs-not-met
db:get-run-record-ids
db:get-changed-record-ids
tdb:read-test-data
tdb:get-prev-tol-for-test
tdb:step-get-time-as-string
tdb:get-steps-table
tdb:get-steps-table-list
tdb:get-compressed-steps
mt:run-trigger
mt:process-triggers
mt:lazy-read-test-config
mt:get-run-stats
server:reply
common:with-queue-db
common:load-pkts-to-db
db:hoh-set!
db:hoh-get
db:get-cache-stmth
db:register-server
db:deregister-server
db:get-server-info
db:get-count-servers
db:get-steps-info-by-id

make-dbr:dbdat
dbr:dbdat-db
dbr:dbdat-inmem
dbr:dbdat-last-sync
dbr:dbdat-last-write
dbr:dbdat-run-id
dbr:dbdat-fname
dbr:dbdat-db-set!
dbr:dbdat-inmem-set!
dbr:dbdat-last-sync-set!
dbr:dbdat-last-write-set!
dbr:dbdat-run-id-set!
dbr:dbdat-fname-set!

make-dbr:dbstruct
dbr:dbstruct-mtdb
dbr:dbstruct-dbdats
dbr:dbstruct-read-only
dbr:dbstruct-stmt-cache
dbr:dbstruct-mtdb-set!
dbr:dbstruct-dbdats-set!
dbr:dbstruct-read-only-set!
dbr:dbstruct-stmt-cache-set!

make-simple-run
simple-run-target
simple-run-id
simple-run-runname
simple-run-state
simple-run-status
simple-run-owner
simple-run-event_time
simple-run-target-set!
simple-run-id-set!
simple-run-runname-set!
simple-run-state-set!
simple-run-status-set!
simple-run-owner-set!
simple-run-event_time-set!

;; fix naming on these ones
db:test-record-fields
db:test-record-qry-selector
)

(import scheme
	(prefix sqlite3 sqlite3:)
	chicken.base
	chicken.condition
	chicken.eval
	chicken.file
	chicken.file.posix
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
	(lambda (id test-id stepname state status event-time logfile comment)
	  (set! res (cons (vector id test-id stepname state status event-time (if (string? logfile) logfile "") comment) res)))
	db
	"SELECT id,test_id,stepname,state,status,event_time,logfile,comment FROM test_steps WHERE status != 'DELETED' AND test_id=? ORDER BY id ASC;" ;; event_time DESC,id ASC;
	test-id)
       (reverse res)))))

 (define (db:get-steps-info-by-id dbstruct  test-step-id)
   (db:with-db
    dbstruct
    #f 
    #f
    (lambda (db)
      (let* ((res (vector #f #f #f #f #f #f #f #f #f)))
        (sqlite3:for-each-row 
       (lambda (id test-id stepname state status event-time logfile comment last-update)
         (set! res (vector id test-id stepname state status event-time (if (string? logfile) logfile "") comment last-update)))
       db
       "SELECT id,test_id,stepname,state,status,event_time,logfile,comment,last_update FROM test_steps WHERE id=? ORDER BY id ASC;" ;; event_time DESC,id ASC;
       test-step-id)
        res))))

(define (db:get-steps-data dbstruct run-id test-id)
  (db:with-db
   dbstruct
   run-id
   #f
   (lambda (db)







|
|
|
|
|
|
|
|
|
|
|
|
|
|







3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
	(lambda (id test-id stepname state status event-time logfile comment)
	  (set! res (cons (vector id test-id stepname state status event-time (if (string? logfile) logfile "") comment) res)))
	db
	"SELECT id,test_id,stepname,state,status,event_time,logfile,comment FROM test_steps WHERE status != 'DELETED' AND test_id=? ORDER BY id ASC;" ;; event_time DESC,id ASC;
	test-id)
       (reverse res)))))

(define (db:get-steps-info-by-id dbstruct  test-step-id)
  (db:with-db
   dbstruct
   #f 
   #f
   (lambda (db)
     (let* ((res (vector #f #f #f #f #f #f #f #f #f)))
       (sqlite3:for-each-row 
	(lambda (id test-id stepname state status event-time logfile comment last-update)
	  (set! res (vector id test-id stepname state status event-time (if (string? logfile) logfile "") comment last-update)))
	db
	"SELECT id,test_id,stepname,state,status,event_time,logfile,comment,last_update FROM test_steps WHERE id=? ORDER BY id ASC;" ;; event_time DESC,id ASC;
	test-step-id)
       res))))

(define (db:get-steps-data dbstruct run-id test-id)
  (db:with-db
   dbstruct
   run-id
   #f
   (lambda (db)