コード例 #1
0
def FTSlave(config):

    # Run SWTBot tests
    if len(sys.argv) > 0:
        scriptdir = os.path.dirname(sys.argv[0])
        builddir = os.path.join(scriptdir, '..', '..', 'editor', 'build')
        testScript = os.path.join(builddir, 'testswteditor.py')
        cmd = [sys.executable, testScript]
        try:
            subprocess.call(cmd, shell=IsWindows())
        except:
            pass

    # Prepare to run EggPlant tests
    with bot.BuildStep('Fetching editor'):
        revision = int(os.environ['BUILDBOT_GOT_REVISION'])
        bot_name, _ = bot.GetBotName()
        print bot_name
        channel = bot_utils.GetChannelFromName(bot_name)
        namer = bot_utils.GCSNamer(channel=channel)
        system = config.system
        if system == 'mac':
            system = 'macos'
        editor_path = namer.editor_zipfilepath(revision, system, 'x64')
        gsutils = bot_utils.GSUtil()
        editor_location = '/home/chrome-bot/Desktop'
        if system == 'macos':
            editor_location = '/Users/chrome-bot/Desktop'
        local_path = os.path.join(editor_location, 'editor.zip')
        if os.path.exists(local_path):
            os.remove(local_path)
        local_extracted = os.path.join(editor_location, 'dart')
        shutil.rmtree(local_extracted, ignore_errors=True)
        gsutils.execute(['cp', editor_path, local_path])
        Run(['unzip', local_path, '-d', editor_location])
コード例 #2
0
def VersionSteps(build_info):
    with bot.BuildStep('Version file sanity checking'):
        bot_name, _ = bot.GetBotName()
        channel = bot_utils.GetChannelFromName(bot_name)
        if channel == bot_utils.Channel.BLEEDING_EDGE:
            print 'No sanity checking on bleeding edge'
        else:
            assert (channel == bot_utils.Channel.STABLE
                    or channel == bot_utils.Channel.DEV)
            latest_version = GetLatestVersionFromGCS(channel)
            version = utils.GetVersion()
            print 'Latests version on GCS: %s' % latest_version
            print 'Version currently building: %s' % version
            if not ValidateChannelVersion(latest_version, channel):
                print "Validation failed"
                sys.exit(1)
            else:
                print 'Version file changed, sanity checks passed'
コード例 #3
0
def FTSlave(config):
    with bot.BuildStep('Fetching editor'):
        revision = int(os.environ['BUILDBOT_GOT_REVISION'])
        bot_name, _ = bot.GetBotName()
        print bot_name
        channel = bot_utils.GetChannelFromName(bot_name)
        namer = bot_utils.GCSNamer(channel=channel)
        system = config.system
        if system == 'mac':
            system = 'macos'
        editor_path = namer.editor_zipfilepath(revision, system, 'x64')
        gsutils = bot_utils.GSUtil()
        editor_location = '/home/chrome-bot/Desktop'
        if system == 'macos':
            editor_location = '/Users/chrome-bot/Desktop'
        local_path = os.path.join(editor_location, 'editor.zip')
        if os.path.exists(local_path):
            os.remove(local_path)
        local_extracted = os.path.join(editor_location, 'dart')
        shutil.rmtree(local_extracted, ignore_errors=True)
        gsutils.execute(['cp', editor_path, local_path])
        Run(['unzip', local_path, '-d', editor_location])
コード例 #4
0
ファイル: dartium_android.py プロジェクト: tnip/dartlang-sdk
def UploadAPKs(options):
  with bot.BuildStep('Upload apk'):
    bot_name = os.environ.get('BUILDBOT_BUILDERNAME')
    on_fyi = 'fyi-' in os.environ.get('BUILDBOT_SCHEDULER')
    if '-integration' in bot_name or on_fyi:
      return
    channel = bot_utils.GetChannelFromName(bot_name)
    namer = bot_utils.GCSNamer(channel=channel)
    gsutil = bot_utils.GSUtil()

    web_link_prefix = 'https://storage.cloud.google.com/'

    # Archive content shell
    local = os.path.join(options.build_products_dir, CS_LOCATION)

    for revision in [utils.GetArchiveVersion(), 'latest']:
      # TODO(whesse): pass in arch and mode from reciepe
      remote = namer.dartium_android_apk_filepath(revision,
                                                  'content_shell-android',
                                                  'arm',
                                                  'release')
      content_shell_link = string.replace(remote, 'gs://', web_link_prefix)
      UploadSetACL(gsutil, local, remote)
      print "Uploaded content shell, available from: %s" % content_shell_link
コード例 #5
0
#!/usr/bin/env python
#
# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

import os
import os.path
import shutil
import sys
import subprocess

import bot
import bot_utils

utils = bot_utils.GetUtils()

BUILD_OS = utils.GuessOS()

(bot_name, _) = bot.GetBotName()
CHANNEL = bot_utils.GetChannelFromName(bot_name)

if __name__ == '__main__':
    print "This step should run dartdevc tests"
    print "Current directory when running on a bot should be"
    print "/b/build/slave/[builder name]/build/sdk"
コード例 #6
0
ファイル: upload_debian_packages.py プロジェクト: xster/sdk
    gsutil = bot_utils.GSUtil()
    revision = utils.GetArchiveVersion()
    # Archive the src tar to the src dir
    remote_tarfile = '/'.join(
        [namer.src_directory(revision),
         os.path.basename(tarfile)])
    gsutil.upload(tarfile, remote_tarfile, public=True)
    # Archive all files except the tar file to the linux packages dir
    for entry in os.listdir(builddir):
        full_path = os.path.join(builddir, entry)
        # We expect a flat structure, not subdirectories
        assert (os.path.isfile(full_path))
        if full_path != tarfile:
            package_dir = namer.linux_packages_directory(revision)
            remote_file = '/'.join([package_dir, os.path.basename(entry)])
            gsutil.upload(full_path, remote_file, public=True)


if __name__ == '__main__':
    bot_name = os.environ.get('BUILDBOT_BUILDERNAME')
    channel = bot_utils.GetChannelFromName(bot_name)
    if channel not in (bot_utils.Channel.BLEEDING_EDGE, bot_utils.Channel.TRY):
        builddir = os.path.join(bot_utils.DART_DIR, utils.GetBuildDir(HOST_OS),
                                'src_and_installation')
        version = utils.GetVersion()
        tarfilename = 'dart-%s.tar.gz' % version
        tarfile = os.path.join(builddir, tarfilename)
        ArchiveArtifacts(tarfile, builddir, channel)
    else:
        print('Not uploading artifacts on bleeding edge')
コード例 #7
0
def IsBleedingEdge():
    name, _ = bot.GetBotName()
    channel = bot_utils.GetChannelFromName(name)
    return channel == bot_utils.Channel.BLEEDING_EDGE
コード例 #8
0
def GetNamer(temporary=False):
    name, _ = bot.GetBotName()
    channel = bot_utils.GetChannelFromName(name)
    return dartino_namer.DartinoGCSNamer(channel, temporary=temporary)
コード例 #9
0
# BSD-style license that can be found in the LICENSE file.

import os
import os.path
import shutil
import sys
import subprocess

import bot_utils

utils = bot_utils.GetUtils()

BUILD_OS = utils.GuessOS()
BUILD_ARCHITECTURE = utils.GuessArchitecture()
BUILDER_NAME = os.environ.get('BUILDBOT_BUILDERNAME')
CHANNEL = bot_utils.GetChannelFromName(BUILDER_NAME)


def BuildArchitectures():
    if BUILD_OS == 'linux':
        return ['ia32', 'x64', 'arm', 'arm64']
    elif BUILD_OS == 'macos':
        return ['x64']
    else:
        return ['ia32', 'x64']


def BuildRootPath(path, arch=BUILD_ARCHITECTURE, build_mode='release'):
    return os.path.join(bot_utils.DART_DIR,
                        utils.GetBuildRoot(BUILD_OS, build_mode, arch), path)
コード例 #10
0
ファイル: fletch.py プロジェクト: aam/fletch
def GetNamer(temporary=False):
    name, _ = bot.GetBotName()
    channel = bot_utils.GetChannelFromName(name)
    return fletch_namer.FletchGCSNamer(channel, temporary=temporary)
コード例 #11
0
def SrcSteps(build_info):
    # We always clobber the bot, to not leave old tarballs and packages
    # floating around the out dir.
    bot.Clobber(force=True)

    version = utils.GetVersion()
    builddir = os.path.join(bot_utils.DART_DIR, utils.GetBuildDir(HOST_OS),
                            'src_and_installation')

    if not os.path.exists(builddir):
        os.makedirs(builddir)
    tarfilename = 'dart-%s.tar.gz' % version
    tarfile = os.path.join(builddir, tarfilename)

    with bot.BuildStep('Validating linux system'):
        print 'Validating that we are on debian jessie'
        args = ['cat', '/etc/os-release']
        (stdout, stderr, exitcode) = bot_utils.run(args)
        if exitcode != 0:
            print "Could not find linux system, exiting"
            sys.exit(1)
        if not "jessie" in stdout:
            print "Trying to build debian bits but not on debian Jessie"
            print "You can't fix this, please contact whesse@"
            sys.exit(1)

    with bot.BuildStep('Create src tarball'):
        print 'Building src tarball'
        Run([
            sys.executable, './tools/create_tarball.py', '--tar_filename',
            tarfile
        ])

        print 'Building Debian packages'
        Run([
            sys.executable, './tools/create_debian_packages.py',
            '--tar_filename', tarfile, '--out_dir', builddir
        ])

    with bot.BuildStep('Sanity check installation'):
        if os.path.exists('/usr/bin/dart') or os.path.exists(
                '/usr/lib/dart/bin/dart2js'):
            print "Dart already installed, removing"
            UninstallDart()
        TestInstallation(assume_installed=False)

        InstallFromDep(builddir)
        TestInstallation(assume_installed=True)

        # We build the runtime target to get everything we need to test the
        # standalone target.
        Run([
            sys.executable, './tools/build.py', '-mrelease', '-ax64', 'runtime'
        ])
        # Copy in the installed binary to avoid poluting /usr/bin (and having to
        # run as root)
        Run(['cp', '/usr/bin/dart', 'out/ReleaseX64/dart'])

        # We currently can't run the testing script on wheezy since the checked in
        # binary is built on precise, see issue 18742
        # TODO(18742): Run './tools/test.py' '-mrelease' 'standalone'

        # Sanity check dart2js and the analyzer against a hello world program
        with utils.TempDir() as temp_dir:
            test_file = CreateDartTestFile(temp_dir)
            Run(['/usr/lib/dart/bin/dart2js', test_file])
            Run(['/usr/lib/dart/bin/dartanalyzer', test_file])
            Run(['/usr/lib/dart/bin/dart', test_file])

        # Sanity check that pub can start up and print the version
        Run(['/usr/lib/dart/bin/pub', '--version'])

        UninstallDart()
        TestInstallation(assume_installed=False)

    with bot.BuildStep('Upload artifacts'):
        bot_name, _ = bot.GetBotName()
        channel = bot_utils.GetChannelFromName(bot_name)
        if channel != bot_utils.Channel.BLEEDING_EDGE:
            ArchiveArtifacts(tarfile, builddir, channel)
        else:
            print 'Not uploading artifacts on bleeding edge'