Megatest

Changes On Branch 9a2d3e30d13b9214
Login

Changes In Branch blocking-on-FAIL-fix Through [9a2d3e30d1] Excluding Merge-Ins

This is equivalent to a diff from 47a6a72664 to 9a2d3e30d1

2012-05-03
13:52
Merging blocking fix to trunk check-in: 41ef747b91 user: mrwellan tags: trunk
2012-05-02
00:04
Merged v1.43 into blocking fix check-in: ad39e0084c user: matt tags: blocking-on-FAIL-fix
2012-05-01
23:47
Bug fix for blocking tests where prereq is FAIL check-in: 9a2d3e30d1 user: matt tags: blocking-on-FAIL-fix
2012-04-30
14:43
Merging fix to tests for config file includes check-in: be7c0017bf user: mrwellan tags: v1.43
00:06
Corrected wrong include structure in refactored tests check-in: 47a6a72664 user: matt tags: trunk
2012-04-27
11:18
Adding test for the broken config include check-in: feb0168376 user: mrwellan tags: trunk

Modified db.scm from [685f5a2010] to [3009875fb4].

1039
1040
1041
1042
1043
1044
1045
1046
1047
1048

1049
1050
1051
1052
1053
1054
1055
		    (set! parent-waiton-met #t))
		   ((and same-itempath
			 is-completed
			 is-ok)
		    (set! item-waiton-met #t)))))
	      tests)
	     (if (not (or parent-waiton-met item-waiton-met))
		 (set! result (cons waitontest-name result)))
	     ;; if the test is not found then clearly the waiton is not met...
	     (if (not ever-seen)(set! result (cons waitontest-name result)))))

	waitons)
      (delete-duplicates result))))

(define (db:teststep-set-status! db test-id teststep-name state-in status-in item-path comment logfile)
  (debug:print 4 "test-id: " test-id " teststep-name: " teststep-name)
  (let* ((state     (check-valid-items "state" state-in))
	 (status    (check-valid-items "status" status-in)))







|

|
>







1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
		    (set! parent-waiton-met #t))
		   ((and same-itempath
			 is-completed
			 is-ok)
		    (set! item-waiton-met #t)))))
	      tests)
	     (if (not (or parent-waiton-met item-waiton-met))
		 (set! result (append tests result)))
	     ;; if the test is not found then clearly the waiton is not met...
	     ;; (if (not ever-seen)(set! result (cons waitontest-name result)))))
	     (if (not ever-seen)(set! result (append tests result)))))
	waitons)
      (delete-duplicates result))))

(define (db:teststep-set-status! db test-id teststep-name state-in status-in item-path comment logfile)
  (debug:print 4 "test-id: " test-id " teststep-name: " teststep-name)
  (let* ((state     (check-valid-items "state" state-in))
	 (status    (check-valid-items "status" status-in)))

Modified runs.scm from [002df5e7fd] to [6158fe06e1].

296
297
298
299
300
301
302
303








304
305
306



307
308
309
310
311
312
313
		(if (and have-resources
			 (null? prereqs-not-met))
		    ;; no loop - drop though and use the loop at the bottom 
		    (if (patt-list-match item-path item-patts)
			(run:test db run-id runname keyvallst test-record flags #f)
			(debug:print 1 "INFO: Skipping " (tests:testqueue-get-testname test-record) " " item-path " as it doesn't match " item-patts))
		    ;; else the run is stuck, temporarily or permanently
		    (let ((newtal (append tal (list hed))))








		      ;; couldn't run, take a breather
		      (thread-sleep! 0.1) ;; long sleep here - no resources, may as well be patient
		      (loop (car newtal)(cdr newtal))))))



	     
	     ;; case where an items came in as a list been processed
	     ((and (list? items)     ;; thus we know our items are already calculated
		   (not   itemdat)) ;; and not yet expanded into the list of things to be done
	      (if (and (>= *verbosity* 1)
		       (> (length items) 0)
		       (> (length (car items)) 0))







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







296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
		(if (and have-resources
			 (null? prereqs-not-met))
		    ;; no loop - drop though and use the loop at the bottom 
		    (if (patt-list-match item-path item-patts)
			(run:test db run-id runname keyvallst test-record flags #f)
			(debug:print 1 "INFO: Skipping " (tests:testqueue-get-testname test-record) " " item-path " as it doesn't match " item-patts))
		    ;; else the run is stuck, temporarily or permanently
		    (let ((newtal (append tal (list hed)))
			  (fails  (filter (lambda (test)(not (member (db:test-get-status test)
								     '("PASS" "WARN" "CHECK" "WAIVED"))))
					  prereqs-not-met)))
		      (debug:print 4 "FAILS: " fails)
		      ;; If one or more of the prereqs-not-met are FAIL then we can issue
		      ;; a message and drop hed from the items to be processed.
		      (if (null? fails)
			  (begin
			    ;; couldn't run, take a breather
			    (thread-sleep! 0.1) ;; long sleep here - no resources, may as well be patient
			    (loop (car newtal)(cdr newtal)))
			  ;; the waiton is FAIL so no point in trying to run hed
			  (if (not (null? tal))
			      (loop (car tal)(cdr tal))))))))
	     
	     ;; case where an items came in as a list been processed
	     ((and (list? items)     ;; thus we know our items are already calculated
		   (not   itemdat)) ;; and not yet expanded into the list of things to be done
	      (if (and (>= *verbosity* 1)
		       (> (length items) 0)
		       (> (length (car items)) 0))
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
	       items)
	      (if (not (null? tal))
		  (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
	     ((or (procedure? items)(eq? items 'have-procedure))
	      (if (and (runs:can-run-more-tests db test-record)
		       (null? (db:get-prereqs-not-met db run-id waitons item-path)))

		  (let ((test-name (tests:testqueue-get-testname test-record)))
		    (setenv "MT_TEST_NAME" test-name) ;; 
		    (setenv "MT_RUNNAME"   runname)
		    (set-megatest-env-vars db run-id) ;; these may be needed by the launching process
		    (let ((items-list (items:get-items-from-config tconfig)))
		      (if (list? items-list)
			  (begin
			    (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! 0.1) ;; may as well wait a while for resources to free up
		    (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))))
	  
	  ;; we get here on "drop through" - loop for next test in queue







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







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
377
378
379
380
381
382
383
384
385
386
387
	       items)
	      (if (not (null? tal))
		  (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
	     ((or (procedure? items)(eq? items 'have-procedure))
	      (let ((can-run-more    (runs:can-run-more-tests db test-record))
		    (prereqs-not-met (db:get-prereqs-not-met db run-id waitons item-path)))
		(if (and can-run-more (null? prereqs-not-met))
		    (let ((test-name (tests:testqueue-get-testname test-record)))
		      (setenv "MT_TEST_NAME" test-name) ;; 
		      (setenv "MT_RUNNAME"   runname)
		      (set-megatest-env-vars db run-id) ;; these may be needed by the launching process
		      (let ((items-list (items:get-items-from-config tconfig)))
			(if (list? items-list)
			    (begin
			      (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)))
			  (fails  (filter (lambda (test)(not (member (db:test-get-status test)
								     '("PASS" "WARN" "CHECK" "WAIVED"))))
					  prereqs-not-met)))
		      ;; if can't run more tests, lets take a breather
		      (debug:print 4 "FAILS: " fails)
		      ;; If one or more of the prereqs-not-met are FAIL then we can issue
		      ;; a message and drop hed from the items to be processed.
		      (if (null? fails)
			  (begin
			    ;; couldn't run, take a breather
			    (thread-sleep! 0.1) ;; long sleep here - no resources, may as well be patient
			    (loop (car newtal)(cdr newtal)))
			  ;; the waiton is FAIL so no point in trying to run hed
			  (if (not (null? tal))
			      (loop (car tal)(cdr tal))))))))

	     ;; 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))))
	  
	  ;; we get here on "drop through" - loop for next test in queue

Modified tests/tests.scm from [d03a123d61] to [26b52b3cda].

108
109
110
111
112
113
114


115

116
117
118
119
120
121
122
(define test-id #f)

;; force keepgoing
; (hash-table-set! args:arg-hash "-keepgoing" #t)
(hash-table-set! args:arg-hash "-itempatt" "%")
(hash-table-set! args:arg-hash "-testpatt" "%")
(test "Setup for a run"       #t (begin (setup-for-run) #t))


(test "Remove the rollup run" #t (begin (remove-runs) #t))

(test "Run a test" #t (general-run-call 
		       "-runtests" 
		       "run a test" 
		       (lambda (db keys keynames keyvallst)
			 (let ((test-names '("runfirst")))
			   (run-tests db test-names)))))








>
>
|
>







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
(define test-id #f)

;; force keepgoing
; (hash-table-set! args:arg-hash "-keepgoing" #t)
(hash-table-set! args:arg-hash "-itempatt" "%")
(hash-table-set! args:arg-hash "-testpatt" "%")
(test "Setup for a run"       #t (begin (setup-for-run) #t))


;; (test "Remove the rollup run" #t (begin (remove-runs) #t))

(test "Run a test" #t (general-run-call 
		       "-runtests" 
		       "run a test" 
		       (lambda (db keys keynames keyvallst)
			 (let ((test-names '("runfirst")))
			   (run-tests db test-names)))))