diff options
author | Benny Prijono <bennylp@teluu.com> | 2011-08-16 06:26:15 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2011-08-16 06:26:15 +0000 |
commit | b7762bf185605d323b1204cd83d52e4e4a461636 (patch) | |
tree | ba4fb4609df126f9743a232f25a1efd67ddd13eb /tests/automated | |
parent | 2ea3b4fa1d315223aeeea2a76ac1c52b018088bc (diff) |
Re #1264 (automated testing for 1.x): enhanced run_continuous.py with: 1) custom group name suffix option 2) one time check option instead of loop 3) force option
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3702 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests/automated')
-rwxr-xr-x | tests/automated/run_continuous.py | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/tests/automated/run_continuous.py b/tests/automated/run_continuous.py index c26d8687..efa245fb 100755 --- a/tests/automated/run_continuous.py +++ b/tests/automated/run_continuous.py @@ -7,6 +7,9 @@ import ccdash INTERVAL = 300 DELAY = 0 +ONCE = False +SUFFIX = "" +FORCE = False def run_scenarios(scenarios, group): # Run each scenario @@ -39,6 +42,14 @@ options: after changes are detected, and Nightly build will be done at 00:00 GMT. MIN is a float number. + --once Just run one loop to see if anything needs to be done and + if so just do it once. Quit after that. + + --suffix SFX Set group suffix to SFX. For example, if SFX is "-2.x", then + tests will be submitted to "Nightly-2.x", "Continuous-2.x", + and "Experimental-2.x" + + --force Force running the test even when nothing has changed. """ sys.exit(1) @@ -57,6 +68,17 @@ if __name__ == "__main__": sys.exit(1) DELAY = float(sys.argv[i]) * 60 print "Delay is set to %f minute(s)" % (DELAY / 60) + elif sys.argv[i]=="--suffix": + i = i + 1 + if i >= len(sys.argv): + print "Error: missing argument" + sys.exit(1) + SUFFIX = sys.argv[i] + print "Suffix is set to %s" % (SUFFIX) + elif sys.argv[i]=="--once": + ONCE = True + elif sys.argv[i]=="--force": + FORCE = True else: # Check if scenario exists scenario = sys.argv[i] @@ -88,27 +110,31 @@ if __name__ == "__main__": utc = time.gmtime(None) - if utc.tm_mday != day or rc != 0: + if utc.tm_mday != day or rc != 0 or FORCE: group = "" if utc.tm_mday != day: day = utc.tm_mday - group = "Nightly" + group = "Nightly" + SUFFIX elif rc != 0: - group = "Continuous" + group = "Continuous" + SUFFIX else: - group = "Experimental" + group = "Experimental" + SUFFIX print "Will run %s after %f s.." % (group, DELAY) time.sleep(DELAY) rc = run_scenarios(scenarios, group) # Sleep even if something does change - print str(datetime.datetime.now()) + \ + msg = 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()) + \ + msg = str(datetime.datetime.now()) + \ ": No update, will check again in " + str(INTERVAL) + "s.." - time.sleep(INTERVAL) + if ONCE: + sys.exit(0) + + print msg + time.sleep(INTERVAL) + |