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
|
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
|
-
+
-
-
-
-
-
+
-
-
-
-
+
-
-
-
-
-
+
-
+
-
-
-
-
+
-
-
-
-
-
|
;; T E S T S
;;======================================================================
(define (rmt:get-test-id run-id testname item-path)
(rmt:send-receive 'get-test-id (list run-id testname item-path)))
(define (rmt:get-test-info-by-id test-id)
(let ((res (rmt:send-receive 'get-test-info-by-id (list test-id))))
(rmt:send-receive 'get-test-info-by-id (list test-id)))
(if (list? res)
(list->vector res)
res)))
(define (rmt:test-get-rundir-from-test-id test-id)
(rmt:send-receive 'test-get-rundir-from-test-id (list test-id)))
(define (rmt:open-test-db-by-test-id test-id #!key (work-area #f))
(let* ((test-path (if (string? work-area)
work-area
(rmt:test-get-rundir-from-test-id test-id))))
(debug:print 3 "TEST PATH: " test-path)
(open-test-db test-path)))
;; WARNING: This currently bypasses the transaction wrapped writes system
(define (rmt:test-set-state-status-by-id test-id newstate newstatus newcomment)
(rmt:send-receive 'test-set-state-status-by-id (list test-id newstate newstatus newcomment)))
(define (rmt:set-tests-state-status run-id testnames currstate currstatus newstate newstatus)
(rmt:send-receive 'set-tests-state-status (list run-id testnames currstate currstatus newstate newstatus)))
(define (rmt:get-tests-for-run run-id testpatt states statuses offset limit not-in sort-by sort-order qryvals)
(let ((res (rmt:send-receive 'get-tests-for-run (list run-id testpatt states statuses offset limit not-in sort-by sort-order qryvals))))
(rmt:send-receive 'get-tests-for-run (list run-id testpatt states statuses offset limit not-in sort-by sort-order qryvals)))
(if (list? res)
(map list->vector res)
res)))
(define (rmt:get-tests-for-runs-mindata run-ids testpatt states status not-in)
(let ((res (rmt:send-receive 'get-tests-for-runs-mindata (list run-ids testpatt states status not-in))))
(rmt:send-receive 'get-tests-for-runs-mindata (list run-ids testpatt states status not-in)))
(cond
((list? res)(map list->vector res))
(else res))))
(define (rmt:delete-test-records test-id)
(rmt:send-receive 'delete-test-records (list test-id)))
(define (rmt:test-set-status-state test-id status state msg)
(rmt:send-receive 'test-set-status-state (list test-id status state msg)))
(define (rmt:get-previous-test-run-record run-id test-name item-path)
(rmt:send-receive 'get-previous-test-run-record (list run-id test-name item-path)))
(define (rmt:get-matching-previous-test-run-records run-id test-name item-path)
(map list->vector
(rmt:send-receive 'get-matching-previous-test-run-records (list run-id test-name item-path))))
(rmt:send-receive 'get-matching-previous-test-run-records (list run-id test-name item-path)))
(define (rmt:test-get-logfile-info run-id test-name)
(rmt:send-receive 'test-get-logfile-info (list run-id test-name)))
(define (rmt:test-get-records-for-index-file run-id test-name)
(rmt:send-receive 'test-get-records-for-index-file (list run-id test-name)))
(define (rmt:get-testinfo-state-status test-id)
(let ((res (rmt:send-receive 'get-testinfo-state-status (list test-id))))
(rmt:send-receive 'get-testinfo-state-status (list test-id)))
(if (list? res)
(list->vector res)
res)))
(define (rmt:test-set-log! test-id logf)
(if (string? logf)(rmt:general-call 'test-set-log logf test-id)))
(define (rmt:test-get-paths-matching-keynames-target-new keynames target res testpatt statepatt statuspatt runname)
(rmt:send-receive 'test-get-paths-matching-keynames-target-new (list keynames target res testpatt statepatt statuspatt runname)))
(define (rmt:get-prereqs-not-met run-id waitons ref-item-path #!key (mode 'normal))
(let ((res (rmt:send-receive 'get-prereqs-not-met (list run-id waitons ref-item-path mode))))
(rmt:send-receive 'get-prereqs-not-met (list run-id waitons ref-item-path mode)))
(map (lambda (x)
(if (list? x)
(list->vector x)
x))
res)))
(define (rmt:get-count-tests-running-for-run-id run-id)
(rmt:send-receive 'get-count-tests-running-for-run-id (list run-id)))
;; Statistical queries
(define (rmt:get-count-tests-running)
|
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
|
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
|
-
+
-
-
-
+
-
-
-
-
+
-
-
-
|
(rmt:general-call 'update-fail-pass-counts run-id test-name run-id test-name run-id test-name))
;;======================================================================
;; R U N S
;;======================================================================
(define (rmt:get-run-info run-id)
(let ((res (rmt:send-receive 'get-run-info (list run-id))))
(rmt:send-receive 'get-run-info (list run-id)))
(vector (car res)
(list->vector (cadr res)))))
(define (rmt:register-run keyvals runname state status user)
(rmt:send-receive 'register-run (list keyvals runname state status user)))
(define (rmt:get-run-name-from-id run-id)
(rmt:send-receive 'get-run-name-from-id (list run-id)))
(define (rmt:delete-run run-id)
(rmt:send-receive 'delete-run (list run-id)))
(define (rmt:delete-old-deleted-test-records)
(rmt:send-receive 'delete-old-deleted-test-records '()))
(define (rmt:get-runs runpatt count offset keypatts)
(let* ((res (rmt:send-receive 'get-runs (list runpatt count offset keypatts)))
(rmt:send-receive 'get-runs (list runpatt count offset keypatts)))
(hedr (car res))
(data (cadr res)))
(vector hedr (map list->vector data))))
(define (rmt:get-runs-by-patt keys runnamepatt targpatt offset limit)
(let* ((res (rmt:send-receive 'get-runs-by-patt (list keys runnamepatt targpatt offset limit)))
(rmt:send-receive 'get-runs-by-patt (list keys runnamepatt targpatt offset limit)))
(hedr (car res))
(data (cadr res)))
(vector hedr (map list->vector data))))
(define (rmt:lock/unlock-run run-id lock unlock user)
(rmt:send-receive 'lock/unlock-run (list run-id lock unlock user)))
(define (rmt:update-run-event_time run-id)
(rmt:send-receive 'update-run-event_time (list run-id)))
|
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
239
240
241
242
243
244
245
246
247
248
249
|
-
+
-
-
-
|
(tdb:read-test-data tdb test-id categorypatt)
'())))
(define (rmt:testmeta-add-record testname)
(rmt:send-receive 'testmeta-add-record (list testname)))
(define (rmt:testmeta-get-record testname)
(let ((res (rmt:send-receive 'testmeta-get-record (list testname))))
(rmt:send-receive 'testmeta-get-record (list testname)))
(if (list? res)
(list->vector res)
res)))
(define (rmt:testmeta-update-field test-name fld val)
(rmt:send-receive 'testmeta-update-field (list test-name fld val)))
|