Ejemplo n.º 1
0
      # (they contain for example 'adb')
      AddAndroidToolsToPath()

    TestCompiler(build_info.runtime, build_info.mode, build_info.system,
                 list(test_flags), build_info.is_buildbot,
                 build_info.arch, compiler=build_info.compiler)

    # See comment in GetHasHardCodedCheckedMode, this is a hack.
    if (GetHasHardCodedCheckedMode(build_info)):
      TestCompiler(build_info.runtime, build_info.mode, build_info.system,
                   test_flags + ['--checked'], build_info.is_buildbot,
                   build_info.arch,  compiler=build_info.compiler)


def BuildCompiler(build_info):
  """
  Builds the SDK.

  - build_info: the buildInfo object, containing information about what sort of
      build and test to be run.
  """
  with bot.BuildStep('Build SDK'):
    args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode,
            '--arch=' + build_info.arch, 'dart2js_bot']
    print 'Build SDK and d8: %s' % (' '.join(args))
    bot.RunProcess(args)


if __name__ == '__main__':
  bot.RunBot(GetBuildInfo, RunCompilerTests, build_step=BuildCompiler)
Ejemplo n.º 2
0
                # Asan/x64 takes a long time on mac.
                pass
            else:
                RunTests(configuration['build_conf'],
                         configuration['mode'],
                         configuration['arch'],
                         mac=mac,
                         clang=configuration['clang'],
                         asan=configuration['asan'])


def RunTests(name, mode, arch, mac=False, clang=True, asan=False):
    with bot.BuildStep('Test %s' % name, swallow_error=True):
        args = [
            'python', 'tools/test.py',
            '-m%s' % mode,
            '-a%s' % arch, '--time', '--report', '-pbuildbot',
            '--step_name=test_%s' % name
        ]
        if asan:
            args.append('--asan')

        if clang:
            args.append('--clang')

        Run(args)


if __name__ == '__main__':
    bot.RunBot(Config, Steps, build_step=None)
Ejemplo n.º 3
0
  gsutil.upload(vm_path, gcs_path)
  print '@@@STEP_LINK@download %s@%s@@@' % (link_name, download_link)
  sys.stdout.flush()
  

def BuildSteps(build_info):
  with bot.BuildStep('Upload VM to GCS'):
    # The build binary in the sdk is stripped, the one in build_root is not.
    # We archive the unstripped binaries in case we need to debug a vm crash.
    sdk_bin_path = utils.GetBuildSdkBin(build_info.system,
                                        build_info.mode,
                                        build_info.arch)
    build_root = utils.GetBuildRoot(build_info.system,
                                    build_info.mode,
                                    build_info.arch)
    revision = utils.GetGitRevision()
    archive_path = 'fletch-archive/patched_dart_sdks/%s/' % revision
    stripped_name = '%sdart-vm-%s-%s' % (archive_path, build_info.arch,
                                         build_info.system)
    unstripped_name = '%sdart-vm-%s-%s-symbols' % (archive_path,
                                                   build_info.arch,
                                                   build_info.system)

    unstripped_vm = os.path.join(build_root, 'dart')
    stripped_vm = os.path.join(sdk_bin_path, 'dart')
    Archive(stripped_name, stripped_vm, 'stripped')
    Archive(unstripped_name, unstripped_vm, 'unstripped')

if __name__ == '__main__':
  bot.RunBot(BuildConfig, BuildSteps)
Ejemplo n.º 4
0
                    swallow_error=True)
        bot.RunTest('pub and pkg optimization counter threshold 5',
                    build_info,
                    common_args +
                    ['--append_logs', opt_threshold, 'pkg', 'docs'],
                    swallow_error=True)

    if build_info.mode == 'release':
        pkgbuild_build_info = bot.BuildInfo('none',
                                            'vm',
                                            build_info.mode,
                                            build_info.system,
                                            checked=False)
        bot.RunTest('pkgbuild_repo_pkgs',
                    pkgbuild_build_info,
                    common_args +
                    ['--append_logs', '--use-repository-packages', 'pkgbuild'],
                    swallow_error=True)

        # We are seeing issues with pub get calls on the windows bots.
        # Experiment with not running concurrent calls.
        public_args = (common_args +
                       ['--append_logs', '--use-public-packages', 'pkgbuild'])
        if build_info.system == 'windows':
            public_args.append('-j1')
        bot.RunTest('pkgbuild_public_pkgs', pkgbuild_build_info, public_args)


if __name__ == '__main__':
    bot.RunBot(PubConfig, PubSteps)
Ejemplo n.º 5
0
    if latest_prerelease < int(repo_version.prerelease):
        return True
    if latest_prerelease_patch < int(repo_version.prerelease_patch):
        return True
    return False


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'


if __name__ == '__main__':
    # We pass in None for build_step to avoid building.
    bot.RunBot(VersionConfig, VersionSteps, build_step=None)
Ejemplo n.º 6
0
# BSD-style license that can be found in the LICENSE file.

import re
import sys

import bot
import bot_utils

utils = bot_utils.GetUtils()

PACKAGES_BUILDER = r'packages-(windows|linux|mac)-(core-elements|polymer)'


def PackagesConfig(name, is_buildbot):
    packages_pattern = re.match(PACKAGES_BUILDER, name)
    if not packages_pattern:
        return None
    system = packages_pattern.group(1)

    return bot.BuildInfo('none', 'vm', 'release', system, checked=True)


def PackagesSteps(build_info):
    with bot.BuildStep('Testing packages'):
        bot_name, _ = bot.GetBotName()
        print bot_name


if __name__ == '__main__':
    bot.RunBot(PackagesConfig, PackagesSteps)
    with bot.BuildStep('Create copy of dart_services'):
        print 'Removing existing copy of dart_services'
        shutil.rmtree(dart_services_copy, ignore_errors=True)
        args = ['cp', '-R', dart_services, dart_services_copy]
        Run(args)

    with bot.BuildStep('Fixing pubspec file'):
        pubspec = os.path.join(dart_services_copy, 'pubspec.yaml')
        # TODO(lukechurch): Actually provide the name of the alternative pubspec
        testing_pubspec = os.path.join(dart_services_copy,
                                       'pubspec.foobar.yaml')
        print 'Fixing pubspec up for stress testing'
        # TODO(lukechurch): change to do the mv of the testing pubspec
        Run(['ls', pubspec])

    with bot.BuildStep('Run pub'):
        print 'Print running pub'
        pub = os.path.join(sdk_bin, 'pub')
        with utils.ChangedWorkingDirectory(dart_services_copy):
            args = [pub, 'get']

    with bot.BuildStep('Stress testing'):
        # Consider doing something more useful here.
        args = ['ls', 'third_party']
        Run(args)


if __name__ == '__main__':
    bot.RunBot(ServicesConfig, ServicesSteps)
Ejemplo n.º 8
0
        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'])

        # 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)


if __name__ == '__main__':
    # We pass in None for build_step to avoid building the sdk.
    bot.RunBot(SrcConfig, SrcSteps, build_step=None)
Ejemplo n.º 9
0
def AndroidSteps(build_info):
    # TODO(efortuna): Here's where we'll run tests.
    #bot.RunTest('android', build_info, ['android'])
    pass


def BuildAndroid(build_info):
    """
  Builds the android target.

  - build_info: the buildInfo object, containing information about what sort of
      build and test to be run.
  """
    with bot.BuildStep('Build Android'):
        # TODO(vsm): A temporary hack until we figure out why incremental builds are
        # broken on Android.
        if os.path.exists('./out/lastHooksTargetOS.txt'):
            os.remove('./out/lastHooksTargetOS.txt')
        targets = ['runtime']
        args = [
            sys.executable, './tools/build.py', '--arch=' + build_info.arch,
            '--mode=' + build_info.mode, '--os=android'
        ] + targets
        print 'Building Android: %s' % (' '.join(args))
        bot.RunProcess(args)


if __name__ == '__main__':
    bot.RunBot(AndroidConfig, AndroidSteps, build_step=BuildAndroid)
Ejemplo n.º 10
0
        with bot.BuildStep('Store normal compilation artifacts'):
            args = ['mv', compilations_dir, normal_compilations]
            Run(args)

        with bot.BuildStep('Compiling with dump info'):
            args = normal_compilation_command + [
                '--dart2js-options=--dump-info'
            ]
            Run(args)

        with bot.BuildStep('Store normal compilation artifacts'):
            args = ['mv', compilations_dir, dump_compilations]
            Run(args)

        with bot.BuildStep('Compare outputs'):
            args = [
                'diff', '-rq', '-x', '*\.json', normal_compilations,
                dump_compilations
            ]
            # Diff will return non zero and we will throw if there are any differences
            Run(args)

        with bot.BuildStep('Validate dump files'):
            # Do whatever you like :-), files are in dump_compilations
            pass


if __name__ == '__main__':
    bot.RunBot(DumpConfig, DumpSteps)
Ejemplo n.º 11
0
                swallow_error=True)

    # Pkg tests currently have a lot of timeouts when run in debug mode.
    # See issue 18479
    if build_info.mode != 'release': return

    with bot.BuildStep('third_party pkg tests', swallow_error=True):
        pkg_tested = os.path.join('third_party', 'pkg_tested')
        for entry in os.listdir(pkg_tested):
            path = os.path.join(pkg_tested, entry)
            if os.path.isdir(path): bot.RunTestRunner(build_info, path)

    pkgbuild_build_info = bot.BuildInfo('none',
                                        'vm',
                                        build_info.mode,
                                        build_info.system,
                                        checked=False)
    bot.RunTest('pkgbuild_repo_pkgs',
                pkgbuild_build_info,
                common_args +
                ['--append_logs', '--use-repository-packages', 'pkgbuild'],
                swallow_error=True)

    public_args = (common_args +
                   ['--append_logs', '--use-public-packages', 'pkgbuild'])
    bot.RunTest('pkgbuild_public_pkgs', pkgbuild_build_info, public_args)


if __name__ == '__main__':
    bot.RunBot(PkgConfig, PkgSteps)