def _applyPatch(self, patch): oldWorkingDirectory = os.getcwd() os.chdir(self.dest) errorCode = subprocess.call(['patch', '-p1', '-f', '-i', getPathFromProjectRoot(patch)]) os.chdir(oldWorkingDirectory) if errorCode: raise Exception('Cannot apply patch, will skip current benchmarkPath - Error: %s' % errorCode)
def _applyPatch(self, patch): if not patch: return self.webRoot oldWorkingDirectory = os.getcwd() os.chdir(self.webRoot) errorCode = subprocess.call(['patch', '-p1', '-f', '-i', getPathFromProjectRoot(patch)]) os.chdir(oldWorkingDirectory) if errorCode: _log.error('Cannot apply patch, will skip current benchmarkPath') self.clean() return None return self.webRoot
def _copyBenchmarkToTempDir(self, benchmarkPath): self.webRoot = tempfile.mkdtemp() _log.debug('Servering at webRoot: %s' % self.webRoot) self.dest = os.path.join(self.webRoot, os.path.split(benchmarkPath)[1]) shutil.copytree(getPathFromProjectRoot(benchmarkPath), self.dest)
def _copyBenchmarkToTempDir(self, benchmarkPath): shutil.copytree(getPathFromProjectRoot(benchmarkPath), self.dest)