예제 #1
0
  def WebRTCFactory(self, target='Debug', clobber=False, tests=None, mode=None,
                    slave_type='BuilderTester', options=None,
                    compile_timeout=1200, build_url=None, project=None,
                    factory_properties=None, gclient_deps=None):
    options = options or ''
    tests = tests or []
    factory_properties = factory_properties or {}

    if factory_properties.get('needs_valgrind'):
      self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND]
    factory = self.BuildFactory(target, clobber, tests, mode, slave_type,
                                options, compile_timeout, build_url, project,
                                factory_properties, gclient_deps)

    # Get the factory command object to create new steps to the factory.
    cmds = chromium_commands.ChromiumCommands(factory, target, self._build_dir,
                                              self._target_platform)
    # Override test runner script paths with our own that can run any test and
    # have our suppressions configured.
    valgrind_script_path = cmds.PathJoin('src', 'tools', 'valgrind-webrtc')
    cmds._posix_memory_tests_runner = cmds.PathJoin(valgrind_script_path,
                                                    'webrtc_tests.sh')
    cmds._win_memory_tests_runner = cmds.PathJoin(valgrind_script_path,
                                                  'webrtc_tests.bat')
    cmds.AddWebRTCTests(tests, factory_properties)
    return factory
예제 #2
0
  def WebRTCFactory(self, target='Debug', clobber=False, tests=None, mode=None,
                    slave_type='BuilderTester', options=None,
                    compile_timeout=1200, build_url=None, project=None,
                    factory_properties=None, gclient_deps=None):
    options = options or ''
    tests = tests or []
    factory_properties = factory_properties or {}
    factory_properties['gclient_env'] = \
        factory_properties.get('gclient_env', {}).copy()

    if factory_properties.get('needs_valgrind'):
      self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND]
    elif factory_properties.get('needs_tsan_win'):
      self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_TSAN_WIN]
    elif factory_properties.get('needs_drmemory'):
      if 'drmemory.DEPS' not in [s.name for s in self._solutions]:
        self._solutions.append(gclient_factory.GClientSolution(
            config.Master.trunk_url +
            '/deps/third_party/drmemory/drmemory.DEPS',
            'drmemory.DEPS'))

    # Ensure GYP errors out if files referenced in .gyp files are missing.
    self.ForceMissingFilesToBeFatal(project, factory_properties['gclient_env'])

    factory = self.BuildFactory(target, clobber, tests, mode, slave_type,
                                options, compile_timeout, build_url, project,
                                factory_properties, gclient_deps)

    # Get the factory command object to create new steps to the factory.
    cmds = chromium_commands.ChromiumCommands(factory, target, self._build_dir,
                                              self._target_platform)
    # Override test runner script paths with our own that can run any test and
    # have our suppressions configured.
    valgrind_script_path = cmds.PathJoin('src', 'tools', 'valgrind-webrtc')
    cmds._posix_memory_tests_runner = cmds.PathJoin(valgrind_script_path,
                                                    'webrtc_tests.sh')
    cmds._win_memory_tests_runner = cmds.PathJoin(valgrind_script_path,
                                                  'webrtc_tests.bat')

    if (self._target_platform == 'win32' and factory_properties.get(
        'syzyasan')):
      cmds.AddWindowsSyzyASanStep()

    # Add check/start step for virtual webcams, if needed.
    if factory_properties.get('virtual_webcam'):
      cmds.AddVirtualWebcamCheck()

    cmds.AddWebRTCTests(tests, factory_properties)
    return factory
예제 #3
0
    def LibyuvFactory(self,
                      target='Debug',
                      clobber=False,
                      tests=None,
                      mode=None,
                      slave_type='BuilderTester',
                      options=None,
                      compile_timeout=1200,
                      build_url=None,
                      project=None,
                      factory_properties=None,
                      gclient_deps=None):
        options = options or ''
        tests = tests or []
        factory_properties = factory_properties or {}
        factory_properties.setdefault('gclient_env', {})

        if factory_properties.get('needs_valgrind'):
            self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND]
        factory = self.BuildFactory(target, clobber, tests, mode, slave_type,
                                    options, compile_timeout, build_url,
                                    project, factory_properties, gclient_deps)

        # Get the factory command object to create new steps to the factory.
        cmds = chromium_commands.ChromiumCommands(factory, target,
                                                  self._build_dir,
                                                  self._target_platform)
        # Override test runner script paths with our own that can run any test and
        # have our suppressions configured.
        valgrind_script_path = cmds.PathJoin('src', 'tools', 'valgrind-libyuv')
        cmds._posix_memory_tests_runner = cmds.PathJoin(
            valgrind_script_path, 'libyuv_tests.sh')
        cmds._win_memory_tests_runner = cmds.PathJoin(valgrind_script_path,
                                                      'libyuv_tests.bat')
        # Add tests.
        gyp_defines = factory_properties['gclient_env'].get('GYP_DEFINES', '')
        for test in tests:
            if 'build_for_tool=memcheck' in gyp_defines:
                cmds.AddMemoryTest(test,
                                   'memcheck',
                                   factory_properties=factory_properties)
            elif 'build_for_tool=tsan' in gyp_defines:
                cmds.AddMemoryTest(test,
                                   'tsan',
                                   factory_properties=factory_properties)
            else:
                cmds.AddAnnotatedGTestTestStep(test, factory_properties)
        return factory
예제 #4
0
    def ChromiumFactory(self,
                        target='Release',
                        clobber=False,
                        tests=None,
                        mode=None,
                        slave_type='BuilderTester',
                        options=None,
                        compile_timeout=1200,
                        build_url=None,
                        project=None,
                        factory_properties=None,
                        gclient_deps=None,
                        run_default_swarm_tests=None):
        factory_properties = (factory_properties or {}).copy()
        run_default_swarm_tests = run_default_swarm_tests or []

        # Default to the configuration of Blink appropriate for Chromium patches.
        factory_properties.setdefault('blink_config', 'chromium')
        if factory_properties['blink_config'] == 'blink':
            # This will let builders embed their webkit revision in their output
            # filename and will let testers look for zip files containing a webkit
            # revision in their filename. For this to work correctly, the testers
            # need to be on a Triggerable that's activated by their builder.
            factory_properties.setdefault('webkit_dir',
                                          'third_party/WebKit/Source')

        factory_properties['gclient_env'] = \
            factory_properties.get('gclient_env', {}).copy()
        tests = tests or []

        if factory_properties.get('needs_valgrind'):
            self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND]
        elif factory_properties.get('needs_tsan_win'):
            self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_TSAN_WIN]
        elif factory_properties.get('needs_webdriver_java_tests'):
            self._solutions[0].custom_deps_list = [
                self.CUSTOM_DEPS_WEBDRIVER_JAVA_TESTS
            ]

        if 'devtools_perf' in tests:
            self._solutions[0].custom_deps_list.extend(
                self.CUSTOM_DEPS_DEVTOOLS_PERF)

        if factory_properties.get('safesync_url'):
            self._solutions[0].safesync_url = factory_properties.get(
                'safesync_url')
        elif factory_properties.get('lkgr'):
            self._solutions[0].safesync_url = self.SAFESYNC_URL_CHROMIUM

        tests_for_build = [
            re.match('^(?:valgrind_)?(.*)$', t).group(1) for t in tests
        ]

        # Ensure that component is set correctly in the gyp defines.
        ForceComponent(target, project, factory_properties['gclient_env'])

        factory = self.BuildFactory(target,
                                    clobber,
                                    tests_for_build,
                                    mode,
                                    slave_type,
                                    options,
                                    compile_timeout,
                                    build_url,
                                    project,
                                    factory_properties,
                                    gclient_deps=gclient_deps,
                                    skip_archive_steps=False)

        # Get the factory command object to create new steps to the factory.
        chromium_cmd_obj = chromium_commands.ChromiumCommands(
            factory, target, self._build_dir, self._target_platform)

        # Add this archive build step.
        if factory_properties.get('archive_build'):
            chromium_cmd_obj.AddArchiveBuild(
                factory_properties=factory_properties)

        # TODO(thakis): Remove this after a while.
        assert not factory_properties.get('cf_archive_build')

        # Add a trigger step if needed.
        self.TriggerFactory(factory,
                            slave_type=slave_type,
                            factory_properties=factory_properties)

        # Add all the tests.
        self._AddTests(chromium_cmd_obj, tests, mode, factory_properties)

        # TODO(thakis): Remove this after a while.
        assert not factory_properties.get('late_cf_archive_build')

        if factory_properties.get('process_dumps'):
            chromium_cmd_obj.AddProcessDumps()

        return factory
예제 #5
0
    def ChromiumAnnotationFactory(self,
                                  annotation_script,
                                  branch='master',
                                  target='Release',
                                  slave_type='AnnotatedBuilderTester',
                                  clobber=False,
                                  compile_timeout=6000,
                                  maxTime=8 * 60 * 60,
                                  project=None,
                                  factory_properties=None,
                                  options=None,
                                  tests=None,
                                  gclient_deps=None):
        """Annotation-driven Chromium buildbot factory.

    Like a ChromiumFactory, but non-sync steps (compile, run tests)
    are specified in a script that uses @@@BUILD_STEP descriptive
    text@@@ style annotations.

    Note new slave type AnnotatedBuilderTester; we don't want a
    compile step added.
    TODO(jrg): is a new slave type the right direction?
    """
        # Setup factory.
        factory_properties = factory_properties or {}
        options = options or {}
        if self._target_os:
            factory_properties['target_os'] = self._target_os

        # Ensure that component is set correctly in the gyp defines.
        ForceComponent(target, project, factory_properties)

        factory = self.BuildFactory(target=target,
                                    clobber=clobber,
                                    tests=tests,
                                    mode=None,
                                    slave_type=slave_type,
                                    options=options,
                                    compile_timeout=compile_timeout,
                                    build_url=None,
                                    project=project,
                                    factory_properties=factory_properties,
                                    gclient_deps=gclient_deps)

        # Get the factory command object to create new steps to the factory.
        chromium_cmd_obj = chromium_commands.ChromiumCommands(
            factory=factory,
            target=target,
            build_dir=self._build_dir,
            target_platform=self._target_platform,
            target_os=self._target_os)

        # Add the main build.
        env = factory_properties.get('annotation_env')
        factory_properties['target'] = target
        factory_properties.setdefault('clobber', clobber)

        chromium_cmd_obj.AddAnnotationStep(
            name='slave_steps',
            cmd=annotation_script,
            factory_properties=factory_properties,
            env=env,
            maxTime=maxTime)

        # Add archive build step.
        if factory_properties.get('archive_build'):
            chromium_cmd_obj.AddArchiveBuild(
                factory_properties=factory_properties)

        # Add all the tests.
        self._AddTests(factory_cmd_obj=chromium_cmd_obj,
                       tests=tests,
                       factory_properties=factory_properties)

        # Add a trigger step if needed.
        self.TriggerFactory(factory,
                            slave_type=slave_type,
                            factory_properties=factory_properties)

        return factory