Ignore:
Timestamp:
Aug 18, 2010 3:18:24 AM (14 years ago)
Author:
bennylp
Message:

Automated test (re #1111): modified run_continuous.py script to also do Nightly build every day at 00:00 GMT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/tests/automated/run_continuous.py

    r3277 r3278  
    66import ccdash 
    77 
    8 GROUP = "Continuous" 
    98INTERVAL = 300 
     9 
     10def run_scenarios(scenarios, group): 
     11        # Run each scenario 
     12        rc = 0 
     13        for scenario in scenarios: 
     14                argv = [] 
     15                argv.append("ccdash.py") 
     16                argv.append("scenario") 
     17                argv.append(scenario) 
     18                argv.append("--group") 
     19                argv.append(group) 
     20                thisrc = ccdash.main(argv) 
     21                if rc==0 and thisrc: 
     22                        rc = thisrc 
     23        return rc 
     24 
    1025 
    1126if __name__ == "__main__": 
    1227        if len(sys.argv)<=1 or sys.argv[1]=="-h" or sys.argv[1]=="--h" or sys.argv[1]=="/h": 
     28                print "This will run both Continuous and Nightly tests" 
     29                print "" 
    1330                print "Usage: run_continuous.py scenario1.xml [scenario2.xml ...]" 
    14                 sys.exit(0) 
     31                print "" 
     32                sys.exit(1) 
    1533 
    1634        # Splice list 
     
    2240                        print "Error: file " + scenario + " does not exist" 
    2341                        sys.exit(1) 
     42 
     43        # Current date 
     44        utc = time.gmtime(None) 
     45        day = utc.tm_mday 
    2446 
    2547        # Loop foreva 
     
    3456                rc = ccdash.main(argv) 
    3557 
    36                 if rc==0: 
     58                utc = time.gmtime(None) 
     59 
     60                if utc.tm_mday != day or rc != 0: 
     61                                group = "" 
     62                                if utc.tm_mday != day: 
     63                                        day = utc.tm_mday 
     64                                        group = "Nightly" 
     65                                elif rc != 0: 
     66                                        group = "Continuous" 
     67                                else: 
     68                                        group = "Experimental" 
     69                                rc = run_scenarios(scenarios, group) 
     70                                # Sleep even if something does change 
     71                                print str(datetime.datetime.now()) + \ 
     72                                          ": done running " + group + \ 
     73                                          "tests, will check again in " + str(INTERVAL) + "s.." 
     74                                time.sleep(INTERVAL) 
     75                else: 
    3776                        # Nothing changed 
    38                         print str(datetime.datetime.now()) + ": No update, will check again in " + str(INTERVAL) + "s.." 
     77                        print str(datetime.datetime.now()) + \ 
     78                                  ": No update, will check again in " + str(INTERVAL) + "s.." 
    3979                        time.sleep(INTERVAL) 
    40                         continue 
    4180                         
    42                 # Run each scenario 
    43                 for scenario in scenarios: 
    44                         argv = [] 
    45                         argv.append("ccdash.py") 
    46                         argv.append("scenario") 
    47                         argv.append(scenario) 
    48                         argv.append("--group") 
    49                         argv.append(GROUP) 
    50                         thisrc = ccdash.main(argv) 
    51                         if rc==0 and thisrc: 
    52                                 rc = thisrc 
    5381 
    54                 # Sleep even if something does change 
    55                 print str(datetime.datetime.now()) + ": done, will check again in " + str(INTERVAL) + "s.." 
    56                 time.sleep(INTERVAL) 
    57  
Note: See TracChangeset for help on using the changeset viewer.