|
209 | 209 | (if (not (null? test-names))
|
210 | 210 | (let loop ((hed (car test-names))
|
211 | 211 | (tal (cdr test-names))) ;; 'return-procs tells the config reader to prep running system but return a proc
|
212 |
| - (let* ((config (test:get-testconfig hed 'return-procs)) |
| 212 | + (let* ((config (tests:get-testconfig hed 'return-procs)) |
213 | 213 | (waitons (string-split (let ((w (config-lookup config "requirements" "waiton")))
|
214 | 214 | (if w w "")))))
|
215 | 215 | ;; (items (items:get-items-from-config config)))
|
|
244 | 244 | (items:get-items-from-config config))
|
245 | 245 | (else #f))) ;; not iterated
|
246 | 246 | #f ;; itemsdat 5
|
247 |
| - ;; #f ;; spare |
| 247 | + #f ;; spare - used for item-path |
248 | 248 | )))
|
249 | 249 | (for-each
|
250 | 250 | (lambda (waiton)
|
|
264 | 264 | (if *rpc:listener* (server:keep-running db))
|
265 | 265 | (debug:print 4 "INFO: All done by here")))
|
266 | 266 |
|
| 267 | +;; test-records is a hash table testname:item_path => vector < testname testconfig waitons priority items-info ... > |
267 | 268 | (define (runs:run-tests-queue db run-id runname test-records keyvallst flags)
|
268 | 269 | ;; At this point the list of parent tests is expanded
|
269 | 270 | ;; NB// Should expand items here and then insert into the run queue.
|
|
277 | 278 | (tconfig (tests:testqueue-get-testconfig test-record))
|
278 | 279 | (waitons (tests:testqueue-get-waitons test-record))
|
279 | 280 | (priority (tests:testqueue-get-priority test-record))
|
280 |
| - (itemdat (tests:testqueue-get-itemdat test-record)) |
| 281 | + (itemdat (tests:testqueue-get-itemdat test-record)) ;; itemdat can be a string, list or #f |
281 | 282 | (items (tests:testqueue-get-items test-record))
|
282 | 283 | (item-path (item-list->path itemdat)))
|
283 | 284 | (debug:print 6
|
|
297 | 298 | ;; else the run is stuck, temporarily or permanently
|
298 | 299 | (let ((newtal (append tal (list hed))))
|
299 | 300 | ;; couldn't run, take a breather
|
300 |
| - (thread-sleep! 4) |
| 301 | + (thread-sleep! 0.5) |
301 | 302 | (loop (car newtal)(cdr newtal))))))
|
302 | 303 |
|
303 | 304 | ;; case where an items came in as a list been processed
|
|
314 | 315 | (vector-copy! test-record newrec)
|
315 | 316 | newrec))
|
316 | 317 | (my-item-path (item-list->path my-itemdat))
|
| 318 | + |
| 319 | + ;; 3/25/2012 - this match is *always* returning true I believe. Or is it the tests that are not being handled? |
| 320 | + ;; |
317 | 321 | (item-matches (if item-patts ;; here we are filtering for matches with -itempatt
|
318 | 322 | (let ((res #f)) ;; look through all the item-patts if defined, format is patt1,patt2,patt3 ... wildcard is %
|
319 | 323 | (for-each
|
|
326 | 330 | res)
|
327 | 331 | #t)))
|
328 | 332 | (if item-matches ;; yes, we want to process this item
|
329 |
| - (let ((newtestname (conc hed "/" my-item-path))) |
330 |
| - (tests:testqueue-set-items! new-test-record #f) |
331 |
| - (tests:testqueue-set-itemdat! new-test-record my-itemdat) |
| 333 | + (let ((newtestname (conc hed "/" my-item-path))) ;; test names are unique on testname/item-path |
| 334 | + (tests:testqueue-set-items! new-test-record #f) |
| 335 | + (tests:testqueue-set-itemdat! new-test-record my-itemdat) |
| 336 | + (tests:testqueue-set-item_path! new-test-record my-item-path) |
332 | 337 | (hash-table-set! test-records newtestname new-test-record)
|
333 | 338 | (set! tal (cons newtestname tal)))))) ;; since these are itemized create new test names testname/itempath
|
334 | 339 | items)
|
|
353 | 358 | (exit 1)))))
|
354 | 359 | (let ((newtal (append tal (list hed))))
|
355 | 360 | ;; if can't run more tests, lets take a breather
|
356 |
| - (thread-sleep! 1) |
| 361 | + (thread-sleep! 0.5) |
357 | 362 | (loop (car newtal)(cdr newtal)))))
|
358 | 363 |
|
359 | 364 | ;; this case should not happen, added to help catch any bugs
|
|
366 | 371 | (begin
|
367 | 372 | ;; FIXME!!!! THIS SHOULD NOT REQUIRE AN EXIT!!!!!!!
|
368 | 373 | (debug:print 1 "INFO: All tests launched")
|
369 |
| - ;; (exit 0) |
370 |
| - ) |
371 |
| - (loop (car tal)(cdr tal)))))) |
| 374 | + (thread-sleep! 0.5) |
| 375 | + ;; FIXME! This harsh exit should not be necessary.... |
| 376 | + (if (not *runremote*)(exit)) ;; |
| 377 | + #f) ;; return a #f as a hint that we are done |
| 378 | + ;; Here we need to check that all the tests remaining to be run are eligible to run |
| 379 | + ;; and are not blocked by failed |
| 380 | + (let ((newlst (tests:filter-non-runnable db run-id tal test-records))) ;; i.e. not FAIL, WAIVED, INCOMPLETE, PASS, KILLED, |
| 381 | + (thread-sleep! 0.5) |
| 382 | + (if (not (null? newlst)) |
| 383 | + (loop (car newlst)(cdr newlst)))))))) |
372 | 384 |
|
373 | 385 | ;; parent-test is there as a placeholder for when parent-tests can be run as a setup step
|
374 | 386 | (define (run:test db run-id runname keyvallst test-record flags parent-test)
|
|
377 | 389 | (test-waitons (tests:testqueue-get-waitons test-record))
|
378 | 390 | (test-conf (tests:testqueue-get-testconfig test-record))
|
379 | 391 | (itemdat (tests:testqueue-get-itemdat test-record))
|
380 |
| - (test-path (conc *toppath* "/tests/" test-name)) ;; could use test:get-testconfig here ... |
| 392 | + (test-path (conc *toppath* "/tests/" test-name)) ;; could use tests:get-testconfig here ... |
381 | 393 | (force (hash-table-ref/default flags "-force" #f))
|
382 | 394 | (rerun (hash-table-ref/default flags "-rerun" #f))
|
383 | 395 | (keepgoing (hash-table-ref/default flags "-keepgoing" #f))
|
|
0 commit comments