Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -266,14 +266,15 @@ ;; (print "max-concurrent-jobs: " max-concurrent-jobs ", num-running: " num-running) (if (or (not max-concurrent-jobs) (and max-concurrent-jobs (string->number max-concurrent-jobs) (not (>= num-running (string->number max-concurrent-jobs))))) - (run-one-test db run-id test-name keyvallst) + (run-one-test db run-id test-name keyvallst) (print "WARNING: Max running jobs exceeded, current number running: " num-running ", max_concurrent_jobs: \"" max-concurrent-jobs "\"")))) test-names) + (run-waiting-tests db) (if (args:get-arg "-keepgoing") (let ((estrem (db:estimated-tests-remaining db run-id))) (if (> estrem 0) (begin (print "Keep going, estimated " estrem " tests remaining to run, will continue in 10 seconds ...") @@ -281,11 +282,10 @@ ;; (run-waiting-tests db) (loop (+ numtimes 1))))))))) ;; VERY INEFFICIENT! Move stuff that should be done once up to calling proc (define (run-one-test db run-id test-name keyvallst) - (run-waiting-tests db) (print "Launching test " test-name) ;; All these vars might be referenced by the testconfig file reader (setenv "MT_TEST_NAME" test-name) ;; (setenv "MT_RUNNAME" (args:get-arg ":runname")) (set-megatest-env-vars db run-id) ;; these may be needed by the launching process @@ -320,11 +320,13 @@ (new-test-path (string-intersperse (cons test-path (map cadr itemdat)) "/")) (new-test-name (if (equal? item-path "") test-name (conc test-name "/" item-path))) ;; just need it to be unique (testdat #f) (num-running (db:get-count-tests-running db)) (max-concurrent-jobs (config-lookup *configdat* "setup" "max_concurrent_jobs")) - (parent-test (and (null? items)(equal? item-path "")))) + (parent-test (and (not (null? items))(equal? item-path ""))) + (single-test (and (null? items) (equal? item-path ""))) + (item-test (not (equal? item-path "")))) ;; (print "max-concurrent-jobs: " max-concurrent-jobs ", num-running: " num-running) (if (not (or (not max-concurrent-jobs) (and max-concurrent-jobs (string->number max-concurrent-jobs) (not (>= num-running (string->number max-concurrent-jobs)))))) @@ -361,11 +363,12 @@ (print "ERROR: Failed to insert the record into the db")) ((NOT_STARTED COMPLETED) ;; (print "Got here, " (test:get-state testdat)) (let ((runflag #f)) (cond - (parent-test ;; i.e. this is the parent test to a suite of items + ;; i.e. this is the parent test to a suite of items, never "run" it + (parent-test (set! runflag #f)) ;; -force, run no matter what ((args:get-arg "-force")(set! runflag #t)) ;; NOT_STARTED, run no matter what ((equal? (test:get-state testdat) "NOT_STARTED")(set! runflag #t)) ADDED tests/tests/singletest/main.sh Index: tests/tests/singletest/main.sh ================================================================== --- /dev/null +++ tests/tests/singletest/main.sh @@ -0,0 +1,9 @@ +#!/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 $? + +$MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 20;echo all done eh?" -m "This is a test step comment" + +$MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level comment" -set-toplog the_top_log.html ADDED tests/tests/singletest/testconfig Index: tests/tests/singletest/testconfig ================================================================== --- /dev/null +++ tests/tests/singletest/testconfig @@ -0,0 +1,13 @@ +[setup] +runscript main.sh + +[requirements] +diskspace 1M +memory 1G + +[pre-launch-env-vars] +# These are set before the test is launched on the originating +# host. This can be used to control remote launch tools, e.g. to +# to choose the target host, select the launch tool etc. +SPECIAL_ENV_VAR override with everything after the first space. + ADDED tests/tests/singletest/wasting_time.logpro Index: tests/tests/singletest/wasting_time.logpro ================================================================== --- /dev/null +++ tests/tests/singletest/wasting_time.logpro @@ -0,0 +1,15 @@ +;; put stuff here + +;; NOTE: This is not legit logpro code!!! + +;; Test for 0=PASS, 1=WARN, >2 = FAIL + +;; (define season (get-environment-variable "SEASON")) +;; +;; (exit +;; (case (string->symbol season) +;; ((summer) 0) +;; ((winter) 1) +;; ((fall) 2) +;; (else 0))) +