Exemple #1
0
    def getRenderingFor(self, build):
        # Upcall the base class first.
        p = WithProperties.getRenderingFor(self, build)

        # Then we need to normalize the path for
        # watever is native on the buildslave.
        # Note: Do not call normpath here, as it could
        # change the path meaning if links used.
        slave = build.build.slavebuilder.slave

        return slave.path_module.normcase(p)
Exemple #2
0
    def getRenderingFor(self, build):
        origfmtstring = self.fmtstring
        if isinstance(origfmtstring, WithProperties):
            self.fmtstring = origfmtstring.getRenderingFor(build)

        try:
            ret = WithProperties.getRenderingFor(self, build)
        finally:
            self.fmtstring = origfmtstring

        return ret
Exemple #3
0
    def add_cbuildbot_step(self, params, pass_revision=False):
        """Adds cbuildbot step for Chromium OS builds.

    Cbuildbot includes all steps for building any Chromium OS config.

    Args:
      params:  Extra parameters for cbuildbot.
      pass_revision: To pass the chrome revision desired into the build.
    """
        cmd = [
            'chromite/buildbot/cbuildbot',
            shell.WithProperties('--buildnumber=%(buildnumber)s'),
            '--buildroot=%s' % self.buildroot
        ]

        if self.trybot:
            cmd.append(Property('extra_args'))
        else:
            cmd += ['--buildbot']

        if self.dry_run:
            cmd += ['--debug']

        if self.chrome_root:
            cmd.append('--chrome_root=%s' % self.chrome_root)

        # Add properties from buildbot as necessary.
        cmd.append(WithProperties('%s', 'clobber:+--clobber'))
        if pass_revision:
            cmd.append(shell.WithProperties('--chrome_version=%(revision)s'))

        # Add additional parameters.
        cmd += params.split()

        # Trigger other slaves that should be run along with this builder.
        if self.trigger_name:
            self.f_cbuild.addStep(
                trigger.Trigger(schedulerNames=[self.trigger_name],
                                waitForFinish=False))
            description = 'cbuildbot_master'
        else:
            description = 'cbuildbot'

        self.f_cbuild.addStep(chromium_step.AnnotatedCommand,
                              command=cmd,
                              timeout=self.timeout,
                              name='cbuildbot',
                              description=description,
                              usePTY=False)
 def AddDrMemoryLogsUpload(self):
     """Upload drmemory's logs after running the suite and the app tests."""
     # TODO(rnk): What would make this *really* useful for reproducing bot issues
     # is if we had a way of forcing a build with higher logging.
     if self.IsWindows():
         del_cmd = ['del']
     else:
         del_cmd = ['rm', '-f']
     self.AddStep(ShellCommand,
                  command=del_cmd + ['testlogs.7z'],
                  haltOnFailure=False,
                  flunkOnFailure=False,
                  warnOnFailure=True,
                  name='Prepare to pack test results',
                  description='cleanup')
     testlog_dirs = [
         'build_drmemory-dbg-32/logs',
         'build_drmemory-dbg-32/Testing/Temporary',
         'build_drmemory-rel-32/logs',
         'build_drmemory-rel-32/Testing/Temporary'
     ]
     if not self.IsMac():
         # We do not yet support 64-bit Mac builds.
         testlog_dirs += [
             'build_drmemory-dbg-64/logs',
             'build_drmemory-dbg-64/Testing/Temporary',
             'build_drmemory-rel-64/logs',
             'build_drmemory-rel-64/Testing/Temporary'
         ]
     if self.IsWindows():
         testlog_dirs += ['xmlresults']
     else:
         testlog_dirs += ['xml:results']
     self.AddToolStep(
         ShellCommand,
         # We exclude WinTypes.pdb and msvc*.pdb to save space.
         command=(['7z', 'a', '-xr!*.pdb', 'testlogs.7z'] + testlog_dirs),
         haltOnFailure=True,
         name='Pack test results',
         description='pack results')
     self.AddStep(
         FileUpload,
         slavesrc='testlogs.7z',
         # We're ok with a git hash as revision here:
         masterdest=WithProperties(
             'public_html/testlogs/' +
             'from_%(buildername)s/testlogs_r%(got_revision)s_b' +
             '%(buildnumber)s.7z'),
         name='Upload test logs to the master')
  def AddProcessCoverage(self, factory_properties=None):
    factory_properties = factory_properties or {}

    args = ['--target', self._target,
            '--build-id', WithProperties('%(got_revision)s')]
    if factory_properties.get('test_platform'):
      args += ['--platform', factory_properties.get('test_platform')]
    if factory_properties.get('upload-dir'):
      args += ['--upload-dir', factory_properties.get('upload-dir')]

    args = self.AddFactoryProperties(factory_properties, args)

    self.AddAnnotatedPerfStep('coverage', None, 'graphing',
                              step_name='process_coverage',
                              cmd_name=self._process_coverage_tool,
                              cmd_options=args, py_script=True,
                              factory_properties=factory_properties)

    # Map the perf ID to the coverage subdir, so we can link from the coverage
    # graph
    perf_mapping = self.PERF_TEST_MAPPINGS[self._target]
    perf_id = factory_properties.get('perf_id')
    perf_subdir = perf_mapping.get(perf_id)

    # 'total_coverage' is the default archive_folder for
    # archive_coverage.py script.
    url = _GetArchiveUrl('coverage', perf_subdir) + '/total_coverage'
    text = 'view coverage'
    cmd_archive = [self._python, self._archive_coverage,
                   '--target', self._target,
                   '--perf-subdir', perf_subdir]
    if factory_properties.get('use_build_number'):
      cmd_archive.extend(['--build-number', WithProperties('%(buildnumber)s')])

    self.AddArchiveStep(data_description='coverage', base_url=url,
                        link_text=text, command=cmd_archive)
Exemple #6
0
 def AddFindFileBaseIntoPropertyStep(self, pattern):
   """Finds a file on the slave and stores the name minus extension
   in the property .
   TODO(rnk): This won't work if pattern matches more than one file.
   """
   if self.IsWindows():
     ls_cmd = 'dir /B'  # /B means "bare", like ls with no -l.
   else:
     ls_cmd = 'ls'
   self.AddStep(SetProperty,
                name='find package basename',
                description='find package basename',
                # Use a string command here to let the shell expand *.
                command=WithProperties(ls_cmd + ' ' + pattern),
                extract_fn=RemoveExtension)
Exemple #7
0
 def AddAnnotatedStep(self,
                      command,
                      timeout=1200,
                      workdir='build/native_client',
                      haltOnFailure=True,
                      factory_properties=None,
                      usePython=False,
                      env=None):
     factory_properties = factory_properties or {}
     env = env or {}
     env = dict(env)
     env['BUILDBOT_TRIGGERED_BY_BUILDERNAME'] = WithProperties(
         '%(triggered_by_buildername:-None)s')
     env['BUILDBOT_TRIGGERED_BY_BUILDNUMBER'] = WithProperties(
         '%(triggered_by_buildnumber:-None)s')
     env['BUILDBOT_TRIGGERED_BY_SLAVENAME'] = WithProperties(
         '%(triggered_by_slavename:-None)s')
     if 'test_name' not in factory_properties:
         test_class = chromium_step.AnnotatedCommand
     else:
         test_name = factory_properties.get('test_name')
         test_class = self.GetPerfStepClass(
             factory_properties,
             test_name,
             process_log.GraphingLogProcessor,
             command_class=chromium_step.AnnotatedCommand)
     if usePython:
         command = [self._python] + command
     self._factory.addStep(test_class,
                           name='annotate',
                           description='annotate',
                           timeout=timeout,
                           haltOnFailure=haltOnFailure,
                           env=env,
                           workdir=workdir,
                           command=command)
Exemple #8
0
    def testCommand(self):
        f = BuildFactory()
        f.addStep(SetProperty(command=["echo", "value"], property="propname"))
        f.addStep(ShellCommand(command=["echo", WithProperties("%(propname)s")]))

        ss = SourceStamp()

        req = FakeBuildRequest("Testing", ss, None)

        b = f.newBuild([req])
        b.build_status = FakeBuildStatus()
        b.slavebuilder = FakeSlaveBuilder()

        # This shouldn't raise an exception
        b.setupBuild(None)
def MakeSrcBuilder():
    f = BuildFactory()
    f.addSteps(svn_co)
    f.addStep(
        ShellCommand(
            name='tarball',
            command=['bash', 'os/source/tarball.sh'],
            env={
                'SCHAT_SOURCE':
                WithProperties('schat2-src-%(version)s%(suffix)s')
            },
            haltOnFailure=True,
        ))
    f.addStep(
        FileUpload(
            mode=0644,
            slavesrc=WithProperties(
                'schat2-src-%(version)s%(suffix)s.tar.bz2'),
            masterdest=UploadFileName(
                'schat2-src-%(version)s%(suffix)s.tar.bz2'),
            url=WithProperties(
                'https://download.schat.me/schat2/snapshots/%(version)s/r%(got_revision)s/schat2-src-%(version)s%(suffix)s.tar.bz2'
            ),
        ))
Exemple #10
0
    def compute_buildbot_params(self):
        cmd = [
            WithProperties('--buildnumber=%(buildnumber)s'),
            '--buildroot=%s' % self.buildroot
        ]

        if self.trybot:
            cmd.append(Property('extra_args'))
        else:
            cmd += ['--buildbot']

        if self.dry_run:
            cmd += ['--debug']

        if self.chrome_root:
            cmd.append('--chrome_root=%s' % self.chrome_root)

        if self.pass_revision:
            cmd.append(WithProperties('--chrome_version=%(revision)s'))

        #TODO(petermayo): This adds an empty parameter when not clobbering; fix.
        cmd.append(WithProperties('%s', 'clobber:+--clobber'))

        return cmd
    def __init__(self, source, toxEnv,
        reactors=["default"],
        allowSystemPackages=False,
        platform="unix",
        python="python",
        env=None,
            ):

        BuildFactory.__init__(self, source)

        # Use the test-case-name property or fallback to 'twisted'.
        self._tests = [WithProperties("%(test-case-name:~twisted)s")]

        assert platform in ["unix", "windows"]

        self._platform = platform
        if platform == "unix":
            self._path = posixpath
        elif platform == "windows":
            self._path = ntpath

        self._toxEnv = toxEnv
        self._env = env
        self._reactors = reactors
        self._allowSystemPackages = allowSystemPackages

        # Workaround for virtualenv --clear issue.
        # https://github.com/pypa/virtualenv/issues/929
        self.addStep(
            shell.ShellCommand,
            description="clearing virtualenv".split(" "),
            command = [python, "-c", "import shutil; shutil.rmtree('" + self._virtualEnvPath + "', True)"],
        )

        self.addStep(
            shell.ShellCommand,
            description="making virtualenv".split(" "),
            command = [python, "-m", "virtualenv", "--clear",
                       self._virtualEnvPath]
        )

        self.addVirtualEnvStep(
            shell.ShellCommand,
            description="installing tox".split(" "),
            command=["python", "-m", "pip", "install", "tox", "virtualenv"]
        )

        self._addRunSteps()
Exemple #12
0
def final_dropdb(configurator, options, environ=()):
    return [
        ShellCommand(
            command=[
                'psql',
                'postgres',
                '-c',
                WithProperties('DROP DATABASE IF EXISTS "%(testing_db)s"'),
            ],
            name='final_dropdb',
            description=["dropdb", Property('testing_db')],
            env=environ,
            haltOnFailure=False,
            flunkOnFailure=False,
        )
    ]
Exemple #13
0
def MakeWinLegacyBuilder():
    f = BuildFactory()
    f.addSteps(svn_co_legacy)
    f.addStep(
        ShellCommand(
            name='revision',
            command=['cmd', '/c', 'revision.cmd'],
            workdir='build/os/win32',
            env={
                'SCHAT_VERSION': SCHAT_VERSION_LEGACY,
                'SCHAT_REVISION': Property('got_revision')
            },
            haltOnFailure=True,
        ))
    f.addStep(
        ShellCommand(
            name='qmake',
            command=['qmake', '-r'],
            haltOnFailure=True,
        ))
    f.addStep(Compile(
        command=['jom', '-j3', '/NOLOGO'],
        haltOnFailure=True,
    ))
    f.addStep(
        ShellCommand(
            name='nsis',
            command=['cmd', '/c', 'nsis.cmd'],
            workdir='build/os/win32',
            env={
                'SCHAT_SIGN_FILE': schat_passwords.SIGN_FILE,
                'SCHAT_SIGN_PASSWORD': schat_passwords.SIGN_PASSWORD,
                'SCHAT_VERSION': SCHAT_VERSION_LEGACY,
                'SCHAT_REVISION': Property('got_revision')
            },
            haltOnFailure=True,
            logEnviron=False,
        ))
    f.addStep(
        FileUpload(
            mode=0644,
            slavesrc=WithProperties(
                'os/win32/out/schat-%(version_legacy)s.%(got_revision)s.exe'),
            masterdest=UploadFileNameLegacy(
                'schat-%(version_legacy)s.%(got_revision)s.exe'),
        ))
def ToolStep(step_class, os, **kwargs):
    """Modify build step arguments to run the command with our custom tools."""
    if os.startswith('win'):
        command = kwargs.get('command')
        env = kwargs.get('env')
        if isinstance(command, list):
            command = [WIN_BUILD_ENV_PATH] + command
        else:
            command = WIN_BUILD_ENV_PATH + ' ' + command
        if env:
            env = dict(env)  # Copy
        else:
            env = {}
        env['BOTTOOLS'] = WithProperties('%(workdir)s\\bot_tools')
        kwargs['command'] = command
        kwargs['env'] = env
    return step_class(**kwargs)
Exemple #15
0
def getNightlytestBuildFactory(submitAux=None, *args, **kwargs):
    f = LLVMGCCBuilder.getLLVMGCCBuildFactory(*args, **kwargs)

    # Prepare environmental variables. Set here all env we want everywhere.
    merged_env = {
        'TERM': 'dumb'  # Make sure Clang doesn't use color escape sequences.
    }

    env = kwargs.pop('env', None)
    if env is not None:
        merged_env.update(
            env
        )  # Overwrite pre-set items with the given ones, so user can set anything.

    # Copy NT script.
    f.addStep(
        ShellCommand(name="cp test script",
                     command=[
                         "cp",
                         WithProperties(
                             "%(builddir)s/llvm.src/utils/NewNightlyTest.pl"),
                         "."
                     ],
                     haltOnFailure=True,
                     description="cp test script",
                     workdir="llvm.nt",
                     env=merged_env))

    submitCommand = []
    if submitAux is not None:
        submitCommand = ['-submit-aux', submitAux]

    f.addStep(
        ShellCommand(
            name="nightlytest",
            command=[
                "./NewNightlyTest.pl", "-parallel-jobs",
                WithProperties("%(jobs)s"), "-parallel", "-noremoveatend",
                "-noremoveresults", "-release", "-enable-llcbeta", "-verbose",
                "-nickname",
                WithProperties("%(slavename)s"), "-test-cxxflags",
                "-I/usr/include/c++/4.2.1/i686-apple-darwin10 -I/usr/include/c++/4.2.1",
                "-nosubmit", "-teelogs"
            ] + submitCommand,
            haltOnFailure=True,
            description="nightlytest",
            workdir="llvm.nt",
            env={
                'LLVMGCCDIR': WithProperties("%(builddir)s/llvm-gcc.install"),
                'BUILDDIR': WithProperties("%(builddir)s/llvm.nt/build"),
                'WEBDIR': WithProperties("%(builddir)s/llvm.nt/testresults"),
            }.update(merged_env)))
    return f
Exemple #16
0
  def AddTriggerSwarmTestStep(self, target_platform, swarm_server, data_server,
                              hashtable_dir, data_dest_dir,
                              min_shards, max_shards,
                              manifest_files):
    script_path = self.PathJoin(self._script_dir, 'run_slavelastic.py')

    swarm_request_name_prefix = WithProperties('%s-%s-',
                                               'buildername:-None',
                                               'buildnumber:-None')

    command = [self._python, script_path, '-m', min_shards, '-s', max_shards,
               '-o', target_platform, '-u', swarm_server, '-d', data_server,
               '--hashtable-dir', hashtable_dir,
               '--data-dest-dir', data_dest_dir,
               '-t', swarm_request_name_prefix]
    command.extend(manifest_files)

    self.AddTestStep(shell.ShellCommand, 'trigger_swarm_tests', command)
Exemple #17
0
def MakeMacLegacyBuilder():
    f = BuildFactory()
    f.addSteps(svn_co_legacy)
    f.addStep(
        ShellCommand(
            name='dmg',
            command=['bash', 'deploy.sh'],
            workdir='build/os/macosx',
            haltOnFailure=True,
        ))
    f.addStep(
        FileUpload(
            mode=0644,
            slavesrc=WithProperties(
                'os/macosx/dmg/SimpleChat-%(version_legacy)s.dmg'),
            masterdest=UploadFileNameLegacy(
                'SimpleChat-%(version_legacy)s.dmg'),
        ))
Exemple #18
0
    def __init__(self, *args, **kwargs):
        # Inject standard tags into the environment.
        env = {
            'BUILDBOT_BLAMELIST': WithProperties('%(blamelist:-[])s'),
            'BUILDBOT_BRANCH': WithProperties('%(branch:-None)s'),
            'BUILDBOT_BUILDERNAME': WithProperties('%(buildername:-None)s'),
            'BUILDBOT_BUILDNUMBER': WithProperties('%(buildnumber:-None)s'),
            'BUILDBOT_CLOBBER': WithProperties('%(clobber:+1)s'),
            'BUILDBOT_GOT_REVISION': WithProperties('%(got_revision:-None)s'),
            'BUILDBOT_REVISION': WithProperties('%(revision:-None)s'),
            'BUILDBOT_SCHEDULER': WithProperties('%(scheduler:-None)s'),
            'BUILDBOT_SLAVENAME': WithProperties('%(slavename:-None)s'),
        }
        # Apply the passed in environment on top.
        old_env = kwargs.get('env')
        if not old_env:
            old_env = {}
        env.update(old_env)
        # Change passed in args (ok as a copy is made internally).
        kwargs['env'] = env

        ProcessLogShellStep.__init__(self, *args, **kwargs)
        self.script_observer = AnnotationObserver(self)
        self.addLogObserver('stdio', self.script_observer)
Exemple #19
0
 def DrMemorySuite(self):
   """Build and test all configurations in the drmemory pre-commit suite."""
   self.AddDrMemorySource()
   # There is no git equivalent of svnversion, so we do not set dr_revision.
   self.AddTools()
   # We always run the long suite on the bots, rather than splitting into
   # short and "nightly", as it's not all that long.
   cmd = ['ctest', '--timeout', '60', '-VV', '-S',
          WithProperties('../drmemory/tests/runsuite.cmake,' +
                         'drmemory_only;long;build=%(buildnumber)s')]
   self.AddToolStep(CTest,
                    command=cmd,
                    name='Dr. Memory ctest',
                    descriptionDone='runsuite',
                    # failure doesn't mark the whole run as failure
                    flunkOnFailure=False,
                    warnOnFailure=True,
                    timeout=600)
   return self.factory
Exemple #20
0
def make_lint():
    f = BuildFactory()
    f.addStep(
        GitNoBranch(repourl="https://github.com/dolphin-emu/dolphin.git",
                    progress=True,
                    mode="incremental"))
    # Make sure the baserev exists locally. GitHub's "baserev" property is
    # the current base branch head, which isn't guaranteed to exist in the PR
    # branch (e.g. if it hasn't been rebased).
    f.addStep(ShellCommand(command=['git', 'fetch', 'origin']))
    f.addStep(
        ShellCommand(
            command=['Tools/lint.sh',
                     WithProperties("%s...", "baserev")],
            logEnviron=False,
            description="lint",
            descriptionDone="lint",
            haltOnFailure=False))
    return f
Exemple #21
0
    def getRenderingFor(self, build):
        # Upcall the base class first.
        p = WithProperties.getRenderingFor(self, build)

        # Then we need to figure out the buildslave OS:
        slave = build.build.slavebuilder.slave
        if slave.slave_system == 'posix':
            # Note: Do not call normpath here, as it could
            # change the path meaning if links used.
            p = slave.path_module.normcase(p)
        elif slave.slave_system in ('win32', 'nt'):
            # Preserve the case, only replace
            # the path separator to the POSIX one.
            p = p.replace('\\', '/')
        else:
            # Return the string as is.
            pass

        return p
Exemple #22
0
    def testCommand(self):
        f = BuildFactory()
        f.addStep(SetPropertyFromCommand(command=["echo", "value"], property="propname"))
        f.addStep(ShellCommand(command=["echo", WithProperties("%(propname)s")]))

        ss = mock.Mock(name="sourcestamp")
        ss.repository = 'repo'
        ss.changes = []
        ss.patch = ss.patch_info = None

        req = FakeBuildRequest("Testing", {ss.repository: ss}, None)

        b = f.newBuild([req])
        b.master = mock.Mock(name='master')
        b.build_status = FakeBuildStatus()
        b.slavebuilder = FakeSlaveBuilder()

        # This shouldn't raise an exception
        b.setupBuild(None)
Exemple #23
0
  def AddGetSwarmTestStep(self, swarm_server, test_name):
    script_path = self.PathJoin(self._script_dir, 'get_swarm_results.py')

    swarm_request_name = WithProperties('%s-%s-' + test_name,
                                        'buildername:-None',
                                        'buildnumber:-None')

    command = [self._python, script_path, '-u', swarm_server,
               swarm_request_name]

    # Swarm handles the timeouts due to no ouput being produced for 10 minutes,
    # but we don't have access to the output until the whole test is done, which
    # may take more than 10 minutes, so we increase the buildbot timeout.
    timeout = 2 * 60 * 60

    self.AddTestStep(gtest_command.GTestCommand,
                     '%s_swarm' % test_name,
                     command,
                     timeout=timeout)
Exemple #24
0
class AcceptanceConfig(ShellCommand):
    """
    This step generates the configuration for the acceptance test.
    """

    name = "acceptance test config"
    description = "generating config"
    descriptionDone = "config generated"
    command = ["rake", WithProperties("acceptance:config[%(box_dir)s]")]
    flunkOnFailure = True
    haltOnFailure = True

    def commandComplete(self, cmd):
        # Set a property with the location of the config file
        config_path = os.path.join(self.getProperty("workdir"),
                                   self.getWorkdir(), "acceptance_config.yml")
        self.setProperty("acceptance_config_path", config_path, self.name)

        ShellCommand.commandComplete(self, cmd)
Exemple #25
0
    def getRenderingFor(self, build):
        # Upcall the base class first.
        p = WithProperties.getRenderingFor(self, build)

        # Then we need to figure out the buildslave OS:
        slave = build.build.slavebuilder.slave
        if slave.slave_system == 'posix':
            # Note: Do not call normpath here, as it could
            # change the path meaning if links used.
            p = slave.path_module.normcase(p)
        elif slave.slave_system in ('win32', 'nt'):
            # Normalize the path first, then replace
            # the path separator to the POSIX one.
            p = slave.path_module.normcase(p).replace('\\','/')
        else:
            # Return the string as is.
            pass

        return p
Exemple #26
0
def getTestSteps(f, scriptExt, pathSep):
    # buildbot doesn't support dynamic step creation, so create 9 test steps as place holder
    # then each builder will define available tests in test_cfg.json
    # if there're less than 9 tests defined on certain builder, extra steps will be skipped and hidden from test details view
    # **hide step is not supported by buildbot 0.8.5
    # flunkOnFailure only takes boolean value, and cannot take configurable property.
    # workaround: don't flunk the last three tests
    # put non flunkable tests at the last three, test7, test8, test9
    getTestConfig(f)
    for x in range(1, 10):
        test='test'+str(x)
        f.addStep(LitTestCommand(name=test,
                                 command=[pathSep + 'test' + scriptExt,
                                          Property(test)],
                                 description=["testing"],
                                 descriptionDone=[WithProperties('%('+test+':-)s')],
                                 doStepIf=lambda step: step.build.hasProperty(step.name),
                                 flunkOnFailure=(x<7),
                                 warnOnFailure=(x<7),
                                 workdir='scripts'))
  def Build(self, role=builder_name_schema.BUILDER_ROLE_HOUSEKEEPER,
            clobber=None):
    """Build and return the complete BuildFactory.

    role: string; type of builder
    clobber: boolean; indicating whether we should clean before building
    """
    if role != builder_name_schema.BUILDER_ROLE_HOUSEKEEPER:
      raise Exception('Canary builders must have role "%s"' %
                      builder_name_schema.BUILDER_ROLE_HOUSEKEEPER)

    # Build Chromium LKGR + Skia ToT.
    self.UpdateSteps()
    self.Compile(retry_without_werr_on_failure=True)

    # Invoke the do_skps_capture buildstep.
    skia_slave_scripts_path = self.TargetPath.join(
        '..', '..', '..', '..', '..', '..', 'slave',
        'skia_slave_scripts')
    self.AddSlaveScript(
        script=self.TargetPath.join(skia_slave_scripts_path,
                                    'do_skps_capture.py'),
        description='RecreateSKPs',
        args=['--page_sets', 'all',
              '--browser_executable', self.TargetPath.join(
                  'out', 'Debug', 'chrome')],
        timeout=None,
        halt_on_failure=True,
        workdir=self._workdir,
        get_props_from_stdout={'skp_version': r'SKP_VERSION=(\d+)'})

    self.AddSlaveScript(
        script=self.TargetPath.join(skia_slave_scripts_path,
                                    'update_skp_version.py'),
        description='UpdateSkpVersion',
        workdir=self._workdir,
        args=['--skp_version', WithProperties('%(skp_version)s')]
    )

    self.Validate()  # Run the factory configuration test.
    return self
Exemple #28
0
def getPollyLNTFactory(triple, nt_flags, xfails=[], clean=False, test=False,
                       build_type="Release", extra_cmake_args=[], **kwargs):
    lnt_args = {}
    lnt_arg_names = ['submitURL', 'package_cache', 'testerName', 'reportBuildslave']

    for argname in lnt_arg_names:
        if argname in kwargs:
            lnt_args[argname] = kwargs.pop(argname)

    llvm_install_dir = 'stage1.install'

    f = ClangBuilder.getClangCMakeBuildFactory(
        test=False,
        useTwoStage=False,
        clean=clean,
        checkout_clang_tools_extra=False,
        checkout_compiler_rt=False,
        extra_cmake_args=extra_cmake_args,
        stage1_config=build_type)

    f.addStep(ShellCommand(name="install-llvm-and-clang",
                           command=["ninja", "install"],
                           haltOnFailure=True,
                           description=["install llvm and clang"],
                           workdir="stage1"))

    AddExternalPollyBuildFactory(f, llvm_install_dir, build_type)

    nt_flags.append('--cflag=' + '-Xclang')
    nt_flags.append('--cflag=' + '-load')
    nt_flags.append('--cflag=' + '-Xclang')
    nt_flags.append(WithProperties("--cflag=%s/polly.install/lib/LLVMPolly.so",
                                   'builddir'))

    # Add an LNT test runner.
    LNTBuilder.AddLNTTestsToFactory(f, nt_flags,
                                    cc_path=(llvm_install_dir+'/bin/clang'),
                                    cxx_path=(llvm_install_dir+'/bin/clang++'),
                                    **lnt_args);

    return f
Exemple #29
0
class GenerateCodeCoverage(ShellCommand):
    command = [
        "genhtml", "final.info", "--output-directory",
        WithProperties("/home/webrtc-cb/www/%(buildername)s_%(buildnumber)s")
    ]
    name = "LCOV_GenHTML"

    def __init__(self, coverage_url=None, coverage_dir=None, **kwargs):
        if coverage_url is None or coverage_dir is None:
            raise TypeError("coverage location required")
        print coverage_url, coverage_dir
        ShellCommand.__init__(self, **kwargs)
        self.addFactoryArguments(coverage_url=coverage_url,
                                 coverage_dir=coverage_dir)
        self.setDefaultWorkdir("build/trunk")
        self.coverage_url = coverage_url
        self.coverage_dir = coverage_dir
        self.setCommand([
            "genhtml", "final.info", "--output-directory",
            WithProperties(coverage_dir + "/%(buildername)s_%(buildnumber)s")
        ])

    def createSummary(self, log):
        coverage_url = "%s/%s_%s" % (self.coverage_url,
                                     self.getProperty("buildername"),
                                     self.getProperty("buildnumber"))
        coverage_dir = "%s/%s_%s" % (self.coverage_dir,
                                     self.getProperty("buildername"),
                                     self.getProperty("buildnumber"))
        os.chmod(coverage_dir, 0777)
        for root, dirs, files in os.walk(coverage_dir):
            for d in dirs:
                os.chmod(os.path.join(root, d), 0777)
            for f in files:
                os.chmod(os.path.join(root, f), 0777)
        self.addURL("coverage", coverage_url)

    def start(self):
        ShellCommand.start(self)
Exemple #30
0
 def AddRunCommandList(self,
                       command_list,
                       description='Run',
                       timeout=None,
                       halt_on_failure=False,
                       is_upload_step=False,
                       is_rebaseline_step=False):
     """Runs a list of arbitrary commands."""
     # TODO(epoger): Change this so that build-step output shows each command
     # in the list separately--that will be a lot easier to follow.
     #
     # TODO(epoger): For now, this wraps the total command with WithProperties()
     # because *some* callers need it, and we can't use the string.join() command
     # to concatenate strings that have already been wrapped with
     # WithProperties().  Once I figure out how to make the build-step output
     # show each command separately, maybe I can remove this wrapper.
     self.AddRunCommand(command=WithProperties(' && '.join(command_list)),
                        description=description,
                        timeout=timeout,
                        halt_on_failure=halt_on_failure,
                        is_upload_step=is_upload_step,
                        is_rebaseline_step=is_rebaseline_step)
Exemple #31
0
def getSymbLinkSteps(f, lldb_srcdir):
    f.addStep(ShellCommand(name='set symbolic link clang',
                           command=['ln', '-nfs',
                                    WithProperties('%(builddir)s/' + lldb_srcdir + '/llvm/tools/clang'),
                                    'clang'],
                           workdir=WithProperties('%(builddir)s')))
    f.addStep(ShellCommand(name='set symbolic link lldb',
                           command=['ln', '-nfs',
                                    WithProperties('%(builddir)s/' + lldb_srcdir),
                                    lldb_srcdir + '/llvm/tools/lldb'],
                           workdir=WithProperties('%(builddir)s')))
    f.addStep(ShellCommand(name='set symbolic link llvm',
                           command=['ln', '-nfs',
                                    WithProperties('%(builddir)s/' + lldb_srcdir + '/llvm'),
                                    'llvm'],
                           workdir=WithProperties('%(builddir)s')))
    return f
Exemple #32
0
  def AddMaybeClobberStep(self, clobber, options=None, timeout=1200):
    """Possibly clobber.

    Either clobber unconditionally (e.g. nuke-and-pave builder, set at
    factory build time), or at runtime (clobber checkbox).  If the
    former, the clobber arg is set.  If the latter, we use a buildbot
    Properties object.

    TODO(jrg); convert into a doStepIf with a closure referencing
    step.build.getProperties().  E.g.
    http://permalink.gmane.org/gmane.comp.python.buildbot.devel/6039
    """
    options = options or {}
    clobber_cmd = [self._python, self._dart_util]
    clobber_cmd.append(WithProperties('%(clobber:+--clobber)s'))
    workdir = self._dart_build_dir
    self._factory.addStep(shell.ShellCommand,
                          name='maybe clobber',
                          description='maybe clobber',
                          timeout=timeout,
                          haltOnFailure=True,
                          workdir=workdir,
                          command=clobber_cmd)
Exemple #33
0
    def __init__(self, token, repoOwner, repoName,
                 builders_to_report=None, # None to report all builders.
                 sha=None,
                 startDescription=None, endDescription=None,
                 baseURL=None):
        """
        Token for GitHub API.
        """
        if not GitHubAPI:
            config.error('GitHubStatus requires txgithub package installed')

        StatusReceiverMultiService.__init__(self)

        self._builders_to_report = builders_to_report
        self._sha = sha or WithProperties("%(got_revision)s")
        self._repoOwner = repoOwner
        self._repoName = repoName
        self._startDescription = startDescription or "Build started."
        self._endDescription = endDescription

        self._github = GitHubAPI(oauth2_token=token, baseURL=baseURL)

        self._status = None
 def __init__(self, items):
   """items should be a list."""
   # Dummy initialization.
   WithProperties.__init__(self, '')
   self.items = items
Exemple #35
0
 def __init__(self, fmtstring, *args, **lambda_subs):
     WithProperties.__init__(self, fmtstring, *args, **lambda_subs)