summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-08-23 09:16:03 +0000
committerBenny Prijono <bennylp@teluu.com>2010-08-23 09:16:03 +0000
commitaff4573bdb7add7ce04f52025a6791330646d88f (patch)
tree7f1898c95b1e297698410324a7c86a850c354867 /tests
parent7c2f5930bcca47c70d498b095fc6a97fca8e6320 (diff)
re #1111 (more on automated tests): added delay option in run_continuous.py to prevent more than one scripts from running simultaneously on a single host
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3289 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests')
-rwxr-xr-xtests/automated/run_continuous.py55
1 files changed, 43 insertions, 12 deletions
diff --git a/tests/automated/run_continuous.py b/tests/automated/run_continuous.py
index f3bef0a1..fa4b3d4b 100755
--- a/tests/automated/run_continuous.py
+++ b/tests/automated/run_continuous.py
@@ -6,6 +6,7 @@ import datetime
import ccdash
INTERVAL = 300
+DELAY = 0
def run_scenarios(scenarios, group):
# Run each scenario
@@ -23,22 +24,52 @@ def run_scenarios(scenarios, group):
return rc
+def usage():
+ print """Periodically monitor working directory for Continuous and Nightly builds
+
+Usage:
+ run_continuous.py [options] scenario1.xml [scenario2.xml ...]
+
+options:
+ These are options which will be processed by run_continuous.py:
+
+ --delay MIN Delay both Continuous and Nightly builds by MIN minutes.
+ This is useful to coordinate the build with other build
+ machines. By default, Continuous build will be done right
+ after changes are detected, and Nightly build will be done
+ at 00:00 GMT. MIN is a float number.
+
+"""
+ sys.exit(1)
+
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 ...]"
- print ""
- sys.exit(1)
+ if len(sys.argv)<=1 or sys.argv[1]=="-h" or sys.argv[1]=="--h" or sys.argv[1]=="--help" or sys.argv[1]=="/h":
+ usage()
# Splice list
- scenarios = sys.argv[1:]
+ scenarios = []
+ i = 1
+ while i < len(sys.argv):
+ if sys.argv[i]=="--delay":
+ i = i + 1
+ if i >= len(sys.argv):
+ print "Error: missing argument"
+ sys.exit(1)
+ DELAY = float(sys.argv[i]) * 60
+ print "Delay is set to %f minute(s)" % (DELAY / 60)
+ else:
+ # Check if scenario exists
+ scenario = sys.argv[i]
+ if not os.path.exists(scenario):
+ print "Error: file " + scenario + " does not exist"
+ sys.exit(1)
+ scenario.append(scenario)
+ print "Scenario %s added" % (scenario)
+ i = i + 1
- # Check if scenario exists
- for scenario in scenarios:
- if not os.path.exists(scenario):
- print "Error: file " + scenario + " does not exist"
- sys.exit(1)
+ if len(scenarios) < 1:
+ print "Error: scenario is required"
+ sys.exit(1)
# Current date
utc = time.gmtime(None)