Esempio n. 1
0
 def __init__(self,  project_root, configs, flags):
   BuildStep.__init__(self,  project_root, configs, flags)
   self.include_paths = [os.path.join(self.project_root,
               'platforms/tools/compiler/nescc/include'), self.build_dir]
   self.defines = []
   self.nescc_args = {}
   self.app_name = None
Esempio n. 2
0
#!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Run the Skia render_pdfs executable. """

from build_step import BuildStep
import sys


class RenderPdfs(BuildStep):
    def _Run(self):
        args = ['--inputPaths', self._device_dirs.SKPDir()]
        if 'Xoom' in self._builder_name:
            # On the Xoom, these SKPs usually make render_pdfs run out of memory.
            args.extend(['--match', '~tabl_mozilla', '~tabl_nytimes'])
        self._flavor_utils.RunFlavoredCmd('render_pdfs', args)


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(RenderPdfs))
Esempio n. 3
0
 def __init__(self, project_root, configs, flags):
     BuildStep.__init__(self, project_root, configs, flags)
Esempio n. 4
0
            print 'Found issue #', issue
            with open(FILENAME_CURRENT_ATTEMPT, 'w') as f:
                f.write(HTML_CONTENT % (ISSUE_URL_TEMPLATE % {'issue': issue}))
            slave_utils.GSUtilCopyFile(filename=FILENAME_CURRENT_ATTEMPT,
                                       gs_base=bucket_url,
                                       subdir=None,
                                       gs_acl='public-read')

        roll_status = None
        for regexp, status_msg in ROLL_STATUSES:
            match = re.search(regexp, output)
            if match:
                roll_status = status_msg % match.groupdict()
                break

        if roll_status:
            with open(FILENAME_ROLL_STATUS, 'w') as f:
                f.write(roll_status)
            slave_utils.GSUtilCopyFile(filename=FILENAME_ROLL_STATUS,
                                       gs_base=bucket_url,
                                       subdir=None,
                                       gs_acl='public-read')

        #pylint: disable=E0702
        if exception:
            raise exception


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(AutoRoll))
#!/usr/bin/env python
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Compares the results of render_skps.py against expectations.
"""

import sys

from build_step import BuildStep
import upload_rendered_skps


class CompareRenderedSKPs(BuildStep):
    def _Run(self):
        print(
            'To view the latest SKP renderings by this builder, see:\n%s' %
            upload_rendered_skps.rebaseline_server_url(
                directive='static/live-view.html#/live-view.html?',
                builder_name=self._builder_name))
        print ''
        print 'TODO(epoger): Compare not yet implemented; see http://skbug.com/1942'


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(CompareRenderedSKPs))
Esempio n. 6
0
SKIA_COMMITTER_EMAIL = '*****@*****.**'
SKIA_COMMITTER_NAME = 'Eric Boren'

class UpdateSkpVersion(BuildStep):
  def __init__(self, timeout=28800, **kwargs):
    super(UpdateSkpVersion, self).__init__(timeout=timeout, **kwargs)

  def _Run(self):
    with misc.ChDir(PATH_TO_SKIA):
      shell_utils.run([GIT, 'config', '--local', 'user.name',
                       SKIA_COMMITTER_NAME])
      shell_utils.run([GIT, 'config', '--local', 'user.email',
                       SKIA_COMMITTER_EMAIL])
      if CHROMIUM_SKIA in shell_utils.run([GIT, 'remote', '-v']):
        shell_utils.run([GIT, 'remote', 'set-url', 'origin', SKIA_GIT_URL,
                         CHROMIUM_SKIA])

      version_file = 'SKP_VERSION'
      skp_version = self._args.get('skp_version')
      with git_utils.GitBranch(branch_name='update_skp_version',
                               commit_msg=COMMIT_MSG % skp_version,
                               commit_queue=not self._is_try):

        # First, upload a version of the CL with just the SKP version changed.
        with open(version_file, 'w') as f:
          f.write(skp_version)


if '__main__' == __name__:
  sys.exit(BuildStep.RunBuildStep(UpdateSkpVersion))
Esempio n. 7
0
class GenerateDoxygen(BuildStep):
    def _Run(self):
        # Create empty dir and add static_footer.txt
        file_utils.create_clean_local_dir(DOXYGEN_WORKING_DIR)
        static_footer_path = os.path.join(DOXYGEN_WORKING_DIR,
                                          'static_footer.txt')
        shutil.copyfile(os.path.join('tools', 'doxygen_footer.txt'),
                        static_footer_path)

        # Make copy of doxygen config file, overriding any necessary configs,
        # and run doxygen.
        file_utils.create_clean_local_dir(DOXYGEN_CONFIG_DIR)
        modified_doxyfile = os.path.join(DOXYGEN_CONFIG_DIR, DOXYFILE_BASENAME)
        with open(DOXYFILE_BASENAME, 'r') as reader:
            with open(modified_doxyfile, 'w') as writer:
                shutil.copyfileobj(reader, writer)
                writer.write('OUTPUT_DIRECTORY = %s\n' % DOXYGEN_WORKING_DIR)
                writer.write('HTML_FOOTER = %s\n' % static_footer_path)
        shell_utils.run([DOXYGEN_BINARY, modified_doxyfile])

        # Create iframe_footer.html
        with open(os.path.join(DOXYGEN_WORKING_DIR, 'iframe_footer.html'),
                  'w') as fh:
            fh.write(IFRAME_FOOTER_TEMPLATE %
                     (datetime.datetime.now().isoformat(' '),
                      shell_utils.run([DOXYGEN_BINARY, '--version'])))


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(GenerateDoxygen))
Esempio n. 8
0
        # SKP files have already been installed by DownloadSKPs, so we don't need
        # to do that here.

        # Install JSON summaries of image expectations.
        if not os.path.isdir(self.playback_expected_summaries_dir):
            os.makedirs(self.playback_expected_summaries_dir)
        self._flavor_utils.CopyDirectoryContentsToDevice(
            self.playback_expected_summaries_dir,
            self._device_dirs.PlaybackExpectedSummariesDir())

        # Prepare directory to hold actually-generated images.
        self._flavor_utils.CreateCleanHostDirectory(
            self.playback_actual_images_dir)
        self._flavor_utils.CreateCleanDeviceDirectory(
            self._device_dirs.PlaybackActualImagesDir())

        # Prepare directory to hold JSON summaries of actually-generated images.
        self._flavor_utils.CreateCleanHostDirectory(
            self.playback_actual_summaries_dir)
        self._flavor_utils.CreateCleanDeviceDirectory(
            self._device_dirs.PlaybackActualSummariesDir())

    def _Run(self):
        self._RunBeforeGenerateGMs()
        self._RunBeforeRunDecodingTests()
        self._RunBeforeRenderSKPs()


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(PreRender))
Esempio n. 9
0
    print 'Downloading %s' % DUMP_STATIC_INITIALIZERS_URL
    dl = urllib2.urlopen(DUMP_STATIC_INITIALIZERS_URL)
    with open(DUMP_STATIC_INITIALIZERS_FILENAME, 'wb') as f:
      f.write(dl.read())

    # Run the script over the compiled files.
    results = []
    for built_file_name in os.listdir(os.path.join('out', 'Release')):
      if built_file_name.endswith('.a') or built_file_name.endswith('.so'):
        output = shell_utils.run(['python', DUMP_STATIC_INITIALIZERS_FILENAME,
                                  os.path.join('out', 'Release',
                                               built_file_name)])
        matches = re.search('Found (\d+) static initializers', output)
        if matches:
          num_found = int(matches.groups()[0])
          if num_found:
            results.append((built_file_name, num_found))
    if results:
      print
      print 'Found static initializers:'
      print
      for result in results:
        print '  %s: %d' % result
      print
      # TODO(borenet): Make this an error once we have no static initializers.
      raise BuildStepWarning('Static initializers found!')


if '__main__' == __name__:
  sys.exit(BuildStep.RunBuildStep(DetectStaticInitializers))
Esempio n. 10
0
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

""" Check out the Skia buildbot scripts. """


from build_step import BuildStep
from utils import force_update_checkout
import sys


class UpdateScripts(BuildStep):
  def __init__(self, attempts=5, **kwargs):
    super(UpdateScripts, self).__init__(attempts=attempts, **kwargs)

  def _Run(self):
    force_update_checkout.force_update()


if '__main__' == __name__:
  sys.exit(BuildStep.RunBuildStep(UpdateScripts))
Esempio n. 11
0
class ChromeCanaryUpdate(BuildStep):
    def __init__(self,
                 timeout=24000,
                 no_output_timeout=4800,
                 attempts=5,
                 **kwargs):
        super(ChromeCanaryUpdate,
              self).__init__(timeout=timeout,
                             no_output_timeout=no_output_timeout,
                             attempts=attempts,
                             **kwargs)

    def _Run(self):
        chrome_rev = self._args.get('chrome_rev',
                                    sync_skia_in_chrome.CHROME_REV_MASTER)
        skia_rev = (sync_skia_in_chrome.SKIA_REV_DEPS
                    if self._args.get('use_lkgr_skia') else
                    (self._revision or sync_skia_in_chrome.SKIA_REV_MASTER))
        (got_skia_rev, got_chrome_rev) = sync_skia_in_chrome.Sync(
            skia_revision=skia_rev,
            chrome_revision=chrome_rev,
            gyp_defines=self._flavor_utils.gyp_defines,
            gyp_generators=self._flavor_utils.gyp_generators)
        print 'Skia updated to %s' % got_skia_rev
        print 'Chrome updated to %s' % got_chrome_rev


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(ChromeCanaryUpdate))
Esempio n. 12
0
    ]
    if write_images:
      cmd.extend([
          '--mismatchPath', self._device_dirs.PlaybackActualImagesDir()])
    cmd.extend(args)

    if False:
      # For now, skip --validate on all builders, since it takes more time,
      # and at last check failed on Windows.
      if not os.name == 'nt':
        cmd.append('--validate')

    self._flavor_utils.RunFlavoredCmd('render_pictures', cmd)


  def _Run(self):
    exceptions = []
    for render_mode_name, args in sorted(RENDER_MODES.iteritems()):
      try:
        self.DoRenderSKPs(args=args, render_mode_name=render_mode_name)
      except BuildStepWarning, e:
        exceptions.append(e)
        print e
    if exceptions:
      raise BuildStepWarning('\nGot %d exceptions:\n%s' % (
          len(exceptions), '\n'.join([repr(e) for e in exceptions])))


if '__main__' == __name__:
  sys.exit(BuildStep.RunBuildStep(RenderSKPs))
Esempio n. 13
0
--make_flags "" --test_args "" --gm_args "" \
--bench_args "" -perf_output_basedir "../../../../perfdata" \
--builder_name Test-Ubuntu12-ShuttleA-ATI5770-x86_64-Release \
--got_revision 0 --dest_gsbase "gs://rmistry"

"""

from build_step import BuildStep
from upload_bench_results import UploadBenchResults

import sys


class UploadWebpagePictureBenchResults(UploadBenchResults):
    """Upload benchmark performance data results from archived webpages."""
    def __init__(self, attempts=5, **kwargs):
        """Create an instance of UploadWebpagePictureBenchResults."""
        super(UploadBenchResults, self).__init__(attempts=attempts, **kwargs)

    def _GetPerfDataDir(self):
        """Points to the local playback perf data directory."""
        return self._local_playback_dirs.PlaybackPerfDataDir()

    def _GetBucketSubdir(self):
        """Results the playback perf data bucket."""
        return self._storage_playback_dirs.PlaybackPerfDataDir()


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(UploadWebpagePictureBenchResults))
from utils import sync_bucket_subdir
import posixpath
import sys


class DownloadSKImageFiles(BuildStep):
    def __init__(self, timeout=12800, no_output_timeout=9600, **kwargs):
        super(DownloadSKImageFiles,
              self).__init__(timeout=timeout,
                             no_output_timeout=no_output_timeout,
                             **kwargs)

    def _DownloadSKImagesFromStorage(self):
        """Copies over image files from Google Storage if the timestamps differ."""
        dest_gsbase = (self._args.get('dest_gsbase')
                       or sync_bucket_subdir.DEFAULT_PERFDATA_GS_BASE)
        print '\n\n========Downloading image files from Google Storage========\n\n'
        gs_relative_dir = posixpath.join('skimage', 'input')
        gs_utils.download_directory_contents_if_changed(
            gs_base=dest_gsbase,
            gs_relative_dir=gs_relative_dir,
            local_dir=self._skimage_in_dir)

    def _Run(self):
        # Locally copy image files from GoogleStorage.
        self._DownloadSKImagesFromStorage()


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(DownloadSKImageFiles))
Esempio n. 15
0
                        }
                        if duration > COMPILE_TIME_LIMIT:
                            too_slow.append(summarized_build_info)
                        if not longest_build or duration > longest_build[
                                'duration']:
                            longest_build = summarized_build_info
                    else:
                        no_builds.append(builder_name)
        if longest_build:
            print 'Longest build: %(builder)s #%(number)s: %(duration)ds' % \
                longest_build
            print '%s/builders/%s/builds/%s' % (BUILD_MASTER_URL,
                                                longest_build['builder'],
                                                longest_build['number'])
            print
        if no_builds:
            print 'Warning: No builds found for the following builders:'
            for builder in no_builds:
                print '  %s' % builder
            print
        if too_slow:
            print 'The following builds exceeded the time limit of %ds:' % \
                COMPILE_TIME_LIMIT
            for summarized_build_info in too_slow:
                print '  %(builder)s #%(number)s: %(duration)ds' % summarized_build_info
            raise BuildStepFailure('Builds exceeded time limit.')


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(CheckCompileTimes))
Esempio n. 16
0
        cmd.extend(['--mismatchPath', image_out_dir])

        self._flavor_utils.RunFlavoredCmd('skimage', cmd)

        # If there is no expectations file, still run the tests, and then report a
        # failure. Then we'll know to update the expectations with the results of
        # running the tests.
        # TODO(scroggo): Skipping the TSAN bot, where we'll never have
        # expectations. A better way might be to have empty expectations. See
        # https://code.google.com/p/skia/issues/detail?id=1711
        if not have_expectations and not 'TSAN' in self._builder_name:
            name = self._builder_name
            msg = ((
                'Missing expectations file %s.\n'
                'In order to blindly use the actual results as the expectations,'
                '\nrun the following commands once UploadSKImageResults '
                'succeeds:\n') % expectations_file)
            cmds = (('$ gsutil cp -R gs://chromium-skia-gm/skimage/actuals/%s '
                     'expectations/skimage/%s\n') % (name, waterfall_name))

            cmds += (
                ('$ mv expectations/skimage/%s/actual-results.json '
                 'expectations/skimage/%s/%s\n') %
                (waterfall_name, waterfall_name, GM_EXPECTATIONS_FILENAME))
            cmds += '\nThen check in using git.\n'
            raise BuildStepFailure(msg + cmds)


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(RunDecodingTests))
#!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Run this before running any tests. """

from build_step import BuildStep
import sys


class ChromeDRTCanaryPreTest(BuildStep):
    def _Run(self):
        self._flavor_utils.CreateCleanHostDirectory(
            self._flavor_utils.baseline_dir)
        self._flavor_utils.CreateCleanHostDirectory(
            self._flavor_utils.result_dir)


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(ChromeDRTCanaryPreTest))
Esempio n. 18
0
    def _Run(self):
        # Copy actual-results.json to skimage/actuals
        print '\n\n====Uploading skimage actual-results to Google Storage====\n\n'
        src_dir = os.path.abspath(
            os.path.join(self._skimage_out_dir, self._builder_name))
        bucket_url = gs_utils.GSUtils.with_gs_prefix(
            skia_vars.GetGlobalVariable('googlestorage_bucket'))
        dest_dir = posixpath.join(bucket_url, 'skimage', 'actuals',
                                  self._builder_name)
        http_header_lines = ['Cache-Control:public,max-age=3600']
        old_gs_utils.upload_dir_contents(local_src_dir=src_dir,
                                         remote_dest_dir=dest_dir,
                                         gs_acl='public-read',
                                         http_header_lines=http_header_lines)

        # Copy actual images to Google Storage at skimage/output. This will merge
        # with the existing files.
        print '\n\n========Uploading skimage results to Google Storage=======\n\n'
        src_dir = os.path.abspath(os.path.join(self._skimage_out_dir,
                                               'images'))
        dest_dir = posixpath.join(bucket_url, 'skimage', 'output', 'images')
        if os.path.isdir(src_dir) and os.listdir(src_dir):
            old_gs_utils.upload_dir_contents(
                local_src_dir=src_dir,
                remote_dest_dir=dest_dir,
                gs_acl=gs_utils.GSUtils.PLAYBACK_CANNED_ACL)


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(UploadSKImageResults))
Esempio n. 19
0
    else:
      print 'No authentication file. Did you authenticate?'

  def __exit__(self, *args):
    if self._auth_daemon_pid:
      shell_utils.run(['kill', self._auth_daemon_pid])


class SyncAndroid(BuildStep):
  """BuildStep which syncs the Android sources."""

  def _Run(self):
    try:
      os.makedirs(ANDROID_CHECKOUT_PATH)
    except OSError:
      pass
    with misc.ChDir(ANDROID_CHECKOUT_PATH):
      if not os.path.exists(REPO):
        # Download repo.
        shell_utils.run(['curl', REPO_URL, '>', REPO])
        shell_utils.run(['chmod', 'a+x', REPO])

      with GitAuthenticate():
        shell_utils.run([REPO, 'init', '-u', ANDROID_REPO_URL, '-g',
                         'all,-notdefault,-darwin', '-b', 'master-skia'])
        shell_utils.run([REPO, 'sync', '-j32'])


if '__main__' == __name__:
  sys.exit(BuildStep.RunBuildStep(SyncAndroid))
            dest_dir=summary_dest_dir,
            upload_if=gs.UploadIf.ALWAYS,
            predefined_acl=acl,
            fine_grained_acl_list=fine_acls)

        # Now we can upload everything that's left, all the .pngs.
        gs.upload_dir_contents(
            source_dir=self._dm_dir,
            dest_bucket=skia_vars.GetGlobalVariable('dm_images_bucket'),
            dest_dir='dm-images-v1',
            upload_if=gs.UploadIf.IF_NEW,
            predefined_acl=acl,
            fine_grained_acl_list=fine_acls)

        # Just for hygiene, put dm.json back.
        shutil.move(os.path.join(summary_dir, 'dm.json'),
                    os.path.join(self._dm_dir, 'dm.json'))
        os.rmdir(summary_dir)

    def _Run(self):
        # TODO(epoger): Can't we get gm_output_dir from BuildStep._gm_actual_dir ?
        gm_output_dir = os.path.join(os.pardir, os.pardir, 'gm', 'actual',
                                     self._args['builder_name'])
        self._GSUploadAllImages(src_dir=gm_output_dir)
        self._GSUploadJsonFiles(src_dir=gm_output_dir)
        self._UploadDMResults()


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(UploadGMResults))
Esempio n. 21
0
#!/usr/bin/env python
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run self-tests within tools/ dir. """

import os
import sys

from build_step import BuildStep
from py.utils import shell_utils


class RunToolSelfTests(BuildStep):
    def _Run(self):
        shell_utils.run(os.path.join('tools', 'tests', 'run.sh'))


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(RunToolSelfTests))
Esempio n. 22
0
    'static/view.html#/view.html')


class CompareGMs(BuildStep):
    def _Run(self):
        json_summary_path = misc.GetAbsPath(
            os.path.join(self._gm_actual_dir, run_gm.JSON_SUMMARY_FILENAME))

        # Temporary list of builders who are allowed to fail this step without the
        # bot turning red.
        may_fail_with_warning = []
        # This import must happen after BuildStep.__init__ because it requires that
        # CWD is in PYTHONPATH, and BuildStep.__init__ may change the CWD.
        from gm import display_json_results
        success = display_json_results.Display(json_summary_path)
        print('%s<a href="%s?resultsToLoad=/results/failures&builder=%s">'
              'link</a>' %
              (skia_vars.GetGlobalVariable('latest_gm_failures_preamble'),
               LIVE_REBASELINE_SERVER_BASEURL, self._builder_name))
        if not success:
            if self._builder_name in may_fail_with_warning:
                raise BuildStepWarning('Expectations mismatch in %s!' %
                                       json_summary_path)
            else:
                raise Exception('Expectations mismatch in %s!' %
                                json_summary_path)


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(CompareGMs))
    def _RunNanoBenchJSONUpload(self, dest_gsbase):
        """Uploads gzipped nanobench JSON data."""
        # Find the nanobench JSON
        file_list = os.listdir(self._perf_data_dir)
        RE_FILE_SEARCH = re.compile('nanobench_({})_[0-9]+\.json'.format(
            self._got_revision))
        nanobench_name = None

        for file_name in file_list:
            if RE_FILE_SEARCH.search(file_name):
                nanobench_name = file_name
                break

        if nanobench_name:
            nanobench_json_file = os.path.join(self._perf_data_dir,
                                               nanobench_name)

            self._UploadJSONResults(dest_gsbase,
                                    'nano-json-v1',
                                    nanobench_json_file,
                                    gzipped=True)

    def _Run(self):
        dest_gsbase = (self._args.get('dest_gsbase')
                       or sync_bucket_subdir.DEFAULT_PERFDATA_GS_BASE)
        self._RunNanoBenchJSONUpload(dest_gsbase)


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(UploadBenchResults))
Esempio n. 24
0
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Compile step """

from build_step import BuildStep
import sys


class Compile(BuildStep):
    def __init__(self, timeout=16800, no_output_timeout=16800, **kwargs):
        super(Compile, self).__init__(timeout=timeout,
                                      no_output_timeout=no_output_timeout,
                                      **kwargs)

    def _Run(self):
        self._flavor_utils.Compile(self._args['target'])


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(Compile))
Esempio n. 25
0
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Clean step """

from build_step import BuildStep
import sys


class Clean(BuildStep):
    def _Run(self):
        self._flavor_utils.MakeClean()


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(Clean))
Esempio n. 26
0
#!/usr/bin/env python
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run self-tests within platform_tools/android/tests dir. """

import os
import sys

from build_step import BuildStep
from py.utils import shell_utils


class RunAndroidPlatformSelfTests(BuildStep):
    def _Run(self):
        shell_utils.run([
            'python',
            os.path.join('platform_tools', 'android', 'tests', 'run_all.py')
        ])


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(RunAndroidPlatformSelfTests))
Esempio n. 27
0
#!/usr/bin/env python
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run self-tests within gm/ dir. """

import os
import sys

from build_step import BuildStep
from py.utils import shell_utils


class RunGmSelfTests(BuildStep):
    def _Run(self):
        shell_utils.run(os.path.join('gm', 'tests', 'run.sh'))


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(RunGmSelfTests))
Esempio n. 28
0
#!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Run GYP to generate project files. """

from build_step import BuildStep
import sys


class RunGYP(BuildStep):
    def __init__(self, timeout=15000, no_output_timeout=10000, **kwargs):
        super(RunGYP, self).__init__(timeout=timeout,
                                     no_output_timeout=no_output_timeout,
                                     **kwargs)

    def _Run(self):
        self._flavor_utils.RunGYP()


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(RunGYP))
Esempio n. 29
0
        webpages_playback_cmd = [
            'python',
            os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'webpages_playback.py'),
            '--page_sets',
            self._args['page_sets'],
            '--browser_executable',
            full_path_browser_executable,
            '--non-interactive',
            '--upload_to_gs',
            '--alternate_upload_dir',
            upload_dir,
        ]

        try:
            shell_utils.run(webpages_playback_cmd)
        finally:
            # Clean up any leftover browser instances. This can happen if there are
            # telemetry crashes, processes are not always cleaned up appropriately by
            # the webpagereplay and telemetry frameworks.
            cleanup_cmd = ['pkill', '-9', '-f', full_path_browser_executable]
            try:
                shell_utils.run(cleanup_cmd)
            except Exception:
                # Do not fail the build step if the cleanup command fails.
                pass


if '__main__' == __name__:
    sys.exit(BuildStep.RunBuildStep(SKPsCapture))
Esempio n. 30
0
            match = re.search(
                force_update_checkout.GOT_REVISION_PATTERN % ('(\w+)'),
                results[host][buildslave].stdout)
            if match:
              print '\t%s' % match.group(1)
            else:
              failed.append(host)
              print
              results[host][buildslave].print_results(pretty=True)
      else:
        # We were unable to log into the buildslave host machine.
        if results[host].returncode != 0:
          failed.append(host)
          results[host].print_results(pretty=True)
      print

    if failed:
      print
      print 'Failed to update the following buildslaves:'
      for failed_host in failed:
        print ' ', failed_host

    if failed:
      # TODO(borenet): Make sure that we can log in to all hosts, then make this
      # an error.
      raise BuildStepWarning('Could not update some buildslaves.')


if '__main__' == __name__:
  sys.exit(BuildStep.RunBuildStep(UpdateAllBuildslaves))