- Timestamp:
- Aug 16, 2011 6:26:15 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x/tests/automated/run_continuous.py
r3296 r3702 8 8 INTERVAL = 300 9 9 DELAY = 0 10 ONCE = False 11 SUFFIX = "" 12 FORCE = False 10 13 11 14 def run_scenarios(scenarios, group): … … 40 43 at 00:00 GMT. MIN is a float number. 41 44 45 --once Just run one loop to see if anything needs to be done and 46 if so just do it once. Quit after that. 47 48 --suffix SFX Set group suffix to SFX. For example, if SFX is "-2.x", then 49 tests will be submitted to "Nightly-2.x", "Continuous-2.x", 50 and "Experimental-2.x" 51 52 --force Force running the test even when nothing has changed. 42 53 """ 43 54 sys.exit(1) … … 58 69 DELAY = float(sys.argv[i]) * 60 59 70 print "Delay is set to %f minute(s)" % (DELAY / 60) 71 elif sys.argv[i]=="--suffix": 72 i = i + 1 73 if i >= len(sys.argv): 74 print "Error: missing argument" 75 sys.exit(1) 76 SUFFIX = sys.argv[i] 77 print "Suffix is set to %s" % (SUFFIX) 78 elif sys.argv[i]=="--once": 79 ONCE = True 80 elif sys.argv[i]=="--force": 81 FORCE = True 60 82 else: 61 83 # Check if scenario exists … … 89 111 utc = time.gmtime(None) 90 112 91 if utc.tm_mday != day or rc != 0 :113 if utc.tm_mday != day or rc != 0 or FORCE: 92 114 group = "" 93 115 if utc.tm_mday != day: 94 116 day = utc.tm_mday 95 group = "Nightly" 117 group = "Nightly" + SUFFIX 96 118 elif rc != 0: 97 group = "Continuous" 119 group = "Continuous" + SUFFIX 98 120 else: 99 group = "Experimental" 121 group = "Experimental" + SUFFIX 100 122 print "Will run %s after %f s.." % (group, DELAY) 101 123 time.sleep(DELAY) 102 124 rc = run_scenarios(scenarios, group) 103 125 # Sleep even if something does change 104 printstr(datetime.datetime.now()) + \126 msg = str(datetime.datetime.now()) + \ 105 127 ": done running " + group + \ 106 128 "tests, will check again in " + str(INTERVAL) + "s.." 107 time.sleep(INTERVAL)108 129 else: 109 130 # Nothing changed 110 printstr(datetime.datetime.now()) + \131 msg = str(datetime.datetime.now()) + \ 111 132 ": No update, will check again in " + str(INTERVAL) + "s.." 112 time.sleep(INTERVAL)113 133 114 134 135 if ONCE: 136 sys.exit(0) 137 138 print msg 139 time.sleep(INTERVAL) 140
Note: See TracChangeset
for help on using the changeset viewer.