コード例 #1
0
    def start(self):
        """Triggers the intersection of 'swarm_hashes' build property,
    self.tests and 'testfilter' build property if set.

    'swarm_hashes' is already related to GetSwarmTests().
    """
        # Only used for pass gtest filters specified by the user via 'testfilter'.
        swarm_tests = commands.GetSwarmTests(self)
        # The 'swarm_hashes' build property has been set by the
        # CalculateIsolatedSha1s build step. It will have all the steps that can be
        # triggered. This implicitly takes account 'testfilter'.
        swarm_tests_hash_mapping = commands.GetProp(self, 'swarm_hashes', {})

        command = self.command[:]
        for swarm_test in self.tests:
            if swarm_tests_hash_mapping.get(swarm_test.test_name):
                command.extend([
                    '--run_from_hash',
                    swarm_tests_hash_mapping[swarm_test.test_name],
                    swarm_test.test_name,
                    '%d' % swarm_test.shards,
                    # '*' is a special value to mean no filter. This is used so '' is
                    # not used, as '' may be misinterpreted by the shell, especially
                    # on Windows.
                    swarm_tests.get(swarm_test.test_name) or '*',
                ])
            else:
                log.msg('Given a swarm test, %s, that has no matching hash' %
                        swarm_test.test_name)

        self.setCommand(command)
        shell.ShellCommand.start(self)
コード例 #2
0
def TestStepFilterRetrieveSwarmResult(bStep):
    """Returns True if the given swarm step to get results should be run.

  It should be run if the .isolated hash was calculated.
  """
    # TODO(maruel): bStep.name[:-len('_swarm')] once the swarm retrieve results
    # steps have the _swarm suffix.
    return bStep.name in commands.GetProp(bStep, 'swarm_hashes', {})
コード例 #3
0
 def start(self):
     """Contrary to source.Source, ignores the branch, source stamp and patch."""
     self.args['workdir'] = self.workdir
     revision = commands.GetProp(self, 'use_swarming_client_revision', None)
     self.startVC(None, revision, None)
コード例 #4
0
 def doSwarmingStepIf(b):
     return bool(
         commands.GetProp(b, 'use_swarming_client_revision', None))