aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/autobuilder/buildsteps/TarballOeBuildPerfTest.py
blob: ca60c937749f4d2e088fbff08eb66c339c52d995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os, datetime, subprocess
from buildbot.steps.shell import ShellCommand
from autobuilder.config import PERFORMANCE_PUBLISH_DIR

class TarballOeBuildPerfTest(ShellCommand):
    flunkOnFailure = True
    name = "Tarball oe-build-perf-test results"

    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 tarball oe-build-perf-test results"
        self.timeout = 100000
        kwargs['timeout']=self.timeout
        ShellCommand.__init__(self, **kwargs)
  
    def start(self):
        results_dir = self.getProperty("oe_perf_results_dir")

        results_basename = os.path.basename(results_dir)
        archive_dir = os.path.join(PERFORMANCE_PUBLISH_DIR, 'archives')
        archive_file = os.path.join(archive_dir, results_basename + '.tar.gz')

        self.setProperty("oe_perf_archive_dir", archive_dir, "TarballOeBuildPerfTest")
        self.setProperty("oe_perf_archive_file", archive_dir, "TarballOeBuildPerfTest")

        self.command = "mkdir -p %s; " % archive_dir
        self.command += "tar -czf \"%s\" \"%s\"" % (archive_file, results_dir)
                
        ShellCommand.start(self)