From 18456173c3ad2b6d133425117ad7596280bf832c Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 18 Aug 2010 03:18:24 +0000 Subject: Automated test (re #1111): modified run_continuous.py script to also do Nightly build every day at 00:00 GMT git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3278 74dad513-b988-da41-8d7b-12977e46ad98 --- tests/automated/run_continuous.py | 64 +++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 20 deletions(-) (limited to 'tests') diff --git a/tests/automated/run_continuous.py b/tests/automated/run_continuous.py index e7ba39cc..f3bef0a1 100755 --- a/tests/automated/run_continuous.py +++ b/tests/automated/run_continuous.py @@ -5,13 +5,31 @@ import time import datetime import ccdash -GROUP = "Continuous" INTERVAL = 300 +def run_scenarios(scenarios, group): + # Run each scenario + rc = 0 + for scenario in scenarios: + argv = [] + argv.append("ccdash.py") + argv.append("scenario") + argv.append(scenario) + argv.append("--group") + argv.append(group) + thisrc = ccdash.main(argv) + if rc==0 and thisrc: + rc = thisrc + return rc + + if __name__ == "__main__": if len(sys.argv)<=1 or sys.argv[1]=="-h" or sys.argv[1]=="--h" or sys.argv[1]=="/h": + print "This will run both Continuous and Nightly tests" + print "" print "Usage: run_continuous.py scenario1.xml [scenario2.xml ...]" - sys.exit(0) + print "" + sys.exit(1) # Splice list scenarios = sys.argv[1:] @@ -22,6 +40,10 @@ if __name__ == "__main__": print "Error: file " + scenario + " does not exist" sys.exit(1) + # Current date + utc = time.gmtime(None) + day = utc.tm_mday + # Loop foreva while True: argv = [] @@ -33,25 +55,27 @@ if __name__ == "__main__": argv.append("../..") rc = ccdash.main(argv) - if rc==0: + utc = time.gmtime(None) + + if utc.tm_mday != day or rc != 0: + group = "" + if utc.tm_mday != day: + day = utc.tm_mday + group = "Nightly" + elif rc != 0: + group = "Continuous" + else: + group = "Experimental" + rc = run_scenarios(scenarios, group) + # Sleep even if something does change + print str(datetime.datetime.now()) + \ + ": done running " + group + \ + "tests, will check again in " + str(INTERVAL) + "s.." + time.sleep(INTERVAL) + else: # Nothing changed - print str(datetime.datetime.now()) + ": No update, will check again in " + str(INTERVAL) + "s.." + print str(datetime.datetime.now()) + \ + ": No update, will check again in " + str(INTERVAL) + "s.." time.sleep(INTERVAL) - continue - # Run each scenario - for scenario in scenarios: - argv = [] - argv.append("ccdash.py") - argv.append("scenario") - argv.append(scenario) - argv.append("--group") - argv.append(GROUP) - thisrc = ccdash.main(argv) - if rc==0 and thisrc: - rc = thisrc - - # Sleep even if something does change - print str(datetime.datetime.now()) + ": done, will check again in " + str(INTERVAL) + "s.." - time.sleep(INTERVAL) -- cgit v1.2.3