diff options
Diffstat (limited to 'lib/python2.7/site-packages/autobuilder/buildsteps/RunOeBuildPerfTest.py')
-rw-r--r-- | lib/python2.7/site-packages/autobuilder/buildsteps/RunOeBuildPerfTest.py | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/RunOeBuildPerfTest.py b/lib/python2.7/site-packages/autobuilder/buildsteps/RunOeBuildPerfTest.py deleted file mode 100644 index dcc17ddb..00000000 --- a/lib/python2.7/site-packages/autobuilder/buildsteps/RunOeBuildPerfTest.py +++ /dev/null @@ -1,78 +0,0 @@ -import os, datetime, subprocess -from buildbot.steps.shell import ShellCommand -from buildbot.process.buildstep import LogLineObserver - -from autobuilder.config import PERFORMANCE_PUBLISH_DIR - -class OeBuildPerfTestLogLineObserver(LogLineObserver): - """ - Scans lines in order to save the oe-buil-perf-test command - output. - """ - - def _handleLine(self, line): - if not hasattr(self.step, 'oe_build_perf_test_output'): - self.step.oe_build_perf_test_output = "" - self.step.oe_build_perf_test_match = False - - # Search for ### Shell environment set up for builds. ### to start - # capturing. - if not self.step.oe_build_perf_test_match and line.startswith('###'): - self.step.oe_build_perf_test_match = True - - if self.step.oe_build_perf_test_match: - self.step.oe_build_perf_test_output += line + '\n' - - def outLineReceived(self, line): - self._handleLine(line) - - def errLineReceived(self, line): - self._handleLine(line) - -class RunOeBuildPerfTest(ShellCommand): - flunkOnFailure = True - name = "Running oe-build-perf-test" - - def __init__(self, factory, argdict=None, **kwargs): - self.tests = None - self.factory = factory - for k, v in argdict.iteritems(): - setattr(self, k, v) - self.description = "Running oe-build-perf-test" - self.timeout = 100000 - kwargs['timeout']=self.timeout - ShellCommand.__init__(self, **kwargs) - - self.stdio_observer = OeBuildPerfTestLogLineObserver() - self.addLogObserver('stdio', self.stdio_observer) - - def start(self): - branch = self.getProperty("branch") - revision = self.getProperty("got_revision")[0:10] # small rev - machine = self.getProperty("MACHINE") - - # for oe-build-perf-test - timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S") - results_basename = 'results-%s-%s-%s' % (branch, revision, timestamp) - results_dir = os.path.join(PERFORMANCE_PUBLISH_DIR, results_basename) - lock_file = 'oe-build-perf.lock' - globalres_log = os.path.join(PERFORMANCE_PUBLISH_DIR, 'globalres.log') - git_dir = os.path.join(PERFORMANCE_PUBLISH_DIR, 'git') - - self.setProperty("oe_perf_globalres_log", globalres_log, "RunOeBuildPerfTest") - self.setProperty("oe_perf_results_dir", results_dir, "RunOeBuildPerfTest") - - self.command = "mkdir -p %s; " % (results_dir) - - self.command += ". ./oe-init-build-env; " - self.command += """ oe-build-perf-test --out-dir "%s" \ ---globalres-file "%s" --lock-file "%s" --commit-results "%s" --commit-results-branch "{tester_host}/{git_branch}/%s" \ ---commit-results-tag "{tester_host}/{git_branch}/%s/{git_commit_count}-g{git_commit}/{tag_num}" -""" % (results_dir, globalres_log, lock_file, git_dir, machine, machine) - - - ShellCommand.start(self) - - def commandComplete(self, cmd): - self.setProperty("oe_build_perf_test_output", - self.oe_build_perf_test_output, "RunOeBuildPerfTest") |