def run(self): """Ingition to the engine, this is what does the magic, and returns status of success or failure""" success = True l = Logger() l.log(Logger.info, "Starting the first pass...") # Run the first Pass pass1 = self._pass1() # Run the second pass if pass 1 passed and pass is not set to be skipped. if pass1 and not self._skipPass2: l.log(Logger.info, "Starting the second pass") success = self._pass2() else: success = pass1 Logger().log( Logger.info, "Operations completed, check the dump directory for more information." ) return success
def mainfunc(): """The entry point. Note, if you want dont want argument parsing, feel free to directly use Engine class""" engine = None skippass2 = False datadumpdirectory = None indexgit = None customindexfile = None indexentries = None testentries = None cmdargs = initparser().parse_args() # Set up the parameters to Engine, based on argument parsing. if cmdargs.indexgiturl is not None and cmdargs.customindexfile is not None: Logger().log( Logger.error, "indexgiturl and customindexfile are mutually exclusive. So please specify either one" ) exit(5) if cmdargs.indexgiturl is not None: indexgit = cmdargs.indexgiturl[0] if cmdargs.customindexfile is not None: customindexfile = cmdargs.customindexfile if cmdargs.skippass2 is not None: skippass2 = cmdargs.skippass2 if cmdargs.datadumpdirectory is not None: datadumpdirectory = cmdargs.datadumpdirectory[0] if cmdargs.indexentry is not None: indexentries = [] for item in cmdargs.indexentry: indexentries.append(int(item[0])) if cmdargs.testentry is not None: testentries = cmdargs.testentry engine = Engine(datadumpdirectory=datadumpdirectory, indexgit=indexgit, customindexfile=customindexfile, skippass2=skippass2, specificindexentries=indexentries, testindexentries=testentries) if not engine.run(): exit(1) return
def __init__(self, tid, appid, jobid, giturl, gitpath, gitbranch, notifyemail): if not gitpath.startswith("/"): gitpath = "/" + gitpath if not gitpath.endswith("/"): gitpath += "/" fnm = str(tid) + "_" + appid + "_" + jobid self._gitReposlocation = Globals.repoDirectory self._testLogFile = Globals.testsDirectory + "/" + fnm + ".log" self._logger = Logger(self._testLogFile) self._id = tid self._appId = appid self._jobId = jobid self._gitURL = giturl self._gitPath = gitpath self._gitBranch = gitbranch self._notifyEmail = notifyemail t = "" # The repos will be cloned into this location t = self._gitURL.split(":")[1] if t.startswith("//"): t = t[2:] self._gitCloneLocation = self._gitReposlocation + "/" + t # The location in the git repo against which the tests are to be run self._cccp_test_dir = self._gitCloneLocation + self._gitPath self._testData = { "clone-path": self._gitCloneLocation, "git-path": self._gitPath, "tests": { "clone": False, "cccpexists": False, "jobidmatch": False, "test-skip": False, "test-script": False, "build-script": False, "allpass": False } } return