Megatest

Check-in [7bbcfa08c8]
Login
Overview
Comment:Partial fix, now all run but won't stop
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7bbcfa08c86fcb93adab2d43a43bd63d21bc531e
User & Date: matt on 2011-12-05 22:46:12
Other Links: manifest | tags
Context
2011-12-05
22:52
Brutally fixed refusal to exit with a call to exit :) check-in: 3c6e3ca6c4 user: matt tags: trunk
22:46
Partial fix, now all run but won't stop check-in: 7bbcfa08c8 user: matt tags: trunk
13:03
Only re-run if using the -rerun switch or -force switch (difference from old behaviour) check-in: 5b8b902667 user: mrwellan tags: trunk, waiton-broken-but-works
Changes

Modified runs.scm from [82d8e33935] to [08123e62ac].

231
232
233
234
235
236
237
238
239












240


241
242
243
244
245
246
247
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







-
-
+
+
+
+
+
+
+
+
+
+
+
+

+
+







					     (let ((items      (hash-table-ref/default config "items" #f)) ;; items 4
						   (itemstable (hash-table-ref/default config "itemstable" #f))) 
					       ;; if either items or items table is a proc return it so test running
					       ;; process can know to call items:get-items-from-config
					       ;; if either is a list and none is a proc go ahead and call get-items
					       ;; otherwise return #f - this is not an iterated test
					       (cond
						((procedure? items)      items)            ;; calc later
						((procedure? itemstable) itemstable)       ;; calc later
						((procedure? items)      
						 (debug:print 4 "INFO: items is a procedure, will calc later")
						 items)            ;; calc later
						((procedure? itemstable)
						 (debug:print 4 "INFO: itemstable is a procedure, will calc later")
						 itemstable)       ;; calc later
						((filter (lambda (x)
							   (let ((val (car x)))
							     (if (procedure? val) val #f)))
							 (append (if (list? items) items '())
								 (if (list? itemstable) itemstable '())))
						 'have-procedure)
						((or (list? items)(list? itemstable)) ;; calc now
						 (debug:print 4 "INFO: items and itemstable are lists, calc now\n"
							      "    items: " items " itemstable: " itemstable)
						 (items:get-items-from-config config))
						(else #f)))                           ;; not iterated
					     #f      ;; itemsdat 5
					     ;; #f      ;; spare
					     )))
	    (for-each 
	     (lambda (waiton)
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
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







-
+




-
+












-
+

-
-
-
-
+
+
+
+







		     (hash-table-set! test-records newtestname new-test-record)
		     (set! tal (cons newtestname tal)))))) ;; since these are itemized create new test names testname/itempath
	   items)
	  (loop (car tal)(cdr tal)))

	 ;; if items is a proc then need to run items:get-items-from-config, get the list and loop 
	 ;;    - but only do that if resources exist to kick off the job
	 ((procedure? items)
	 ((or (procedure? items)(eq? items 'have-procedure))
	  (if (runs:can-run-more-tests db test-record)
	      (let ((items-list (items:get-items-from-config tconfig)))
		(if (list? items-list)
		    (begin
		      (tests:testqueue-set-items test-record items-list)
		      (tests:testqueue-set-items! test-record items-list)
		      (loop hed tal))
		    (begin
		      (debug:print 0 "ERROR: The proc from reading the setup did not yield a list - please report this")
		      (exit 1))))
	      (let ((newtal (append tal (list hed))))
		;; if can't run more tests, lets take a breather
		(thread-sleep! 1)
		(loop (car newtal)(cdr newtal)))))

	 ;; this case should not happen, added to help catch any bugs
	 ((and (list? items) itemdat)
	  (debug:print 0 "ERROR: Should not have a list of items in a test and the itemspath set - please report this")
	  (exit 1)))
	  (exit 1))))
	
	;; we get here on "drop through" - loop for next test in queue
	(if (null? tal)
	    (debug:print 1 "INFO: All tests launched")
	    (loop (car tal)(cdr tal)))))))
      ;; we get here on "drop through" - loop for next test in queue
      (if (null? tal)
	  (debug:print 1 "INFO: All tests launched")
	  (loop (car tal)(cdr tal))))))

;; parent-test is there as a placeholder for when parent-tests can be run as a setup step
(define (run:test db run-id runname keyvallst test-record flags parent-test)
  ;; All these vars might be referenced by the testconfig file reader
  (let* ((test-name    (tests:testqueue-get-testname   test-record))
	 (test-waitons (tests:testqueue-get-waitons    test-record))
	 (test-conf    (tests:testqueue-get-testconfig test-record))

Modified tests/tests/runfirst/main.sh from [dcbeab62ba] to [e4be557feb].

1
2
3
4
5
6
7


8
9
10
11
12
13
14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16







+
+







#!/bin/bash

# megatest -step wasting_time :state start :status n/a -m "This is a test step comment"
# sleep 20
# megatest -step wasting_time :state end :status $?

touch ../I_was_here
mkdir -p $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME
echo 1 2 3 4 5 > $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/the_ans

$MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 8;echo all done eh?" -m "This is a test step comment"

$MT_MEGATEST -load-test-data << EOF
foo,bar,1.2,1.9,>
foo,rab,1.0e9,10e9,1e9
foo,bla,1.2,1.9,<

Added tests/tests/test_mt_vars/testconfig version [3b27a4617c].





















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[setup]

[ezsteps]
lookittmp   ls /tmp
lookithome  ls /home

[requirements]
waiton runfirst
priority 0

[items]
NUMNUM [system cat $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/the_ans]

[test_meta]
author matt
owner  bob
description This test runs a single ezstep which is expected to pass, no logpro file.

tags first,single
reviewed 09/10/2011, by Matt