mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Run pub tests on the pub bots.
The pub bot script just runs the new test runner against the repo versions of all the packages. R=whesse@google.com Review URL: https://codereview.chromium.org//1214343004.
This commit is contained in:
parent
91a803eae8
commit
49948accad
17
DEPS
17
DEPS
|
@ -40,6 +40,7 @@ vars = {
|
|||
"7zip_rev" : "@19997",
|
||||
"analyzer_cli_rev" : "@8bf3516dd645ca289d7ebc641f7c228d5b3d37c4",
|
||||
"args_tag": "@0.13.0",
|
||||
"async_tag": "@1.2.0",
|
||||
"barback_rev" : "@29ee90dbcf77cfd64632fa2797a4c8a4f29a4b51",
|
||||
"charcode_tag": "@1.1.0",
|
||||
"chrome_rev" : "@19997",
|
||||
|
@ -50,7 +51,7 @@ vars = {
|
|||
"csslib_tag" : "@0.12.0",
|
||||
"dartdoc_rev" : "@3cf49275e8e967b1dff5324fe40694112a4d5648",
|
||||
"dart_services_rev" : "@7aea2574e6f3924bf409a80afb8ad52aa2be4f97",
|
||||
"dart_style_tag": "@0.1.8",
|
||||
"dart_style_tag": "@0.1.8+1",
|
||||
"dev_compiler_rev": "@0.1.1",
|
||||
"fake_async_rev" : "@38614",
|
||||
"firefox_jsshell_rev" : "@45554",
|
||||
|
@ -82,23 +83,24 @@ vars = {
|
|||
"petitparser_rev" : "@37878",
|
||||
"ply_rev": "@604b32590ffad5cbb82e4afef1d305512d06ae93",
|
||||
"plugin_tag": "@0.1.0",
|
||||
"pool_rev": "@22e12aeb16ad0b626900dbe79e4a25391ddfb28c",
|
||||
"pool_rev": "@e454b4b54d2987e8d2f0fbd3ac519641ada9bd0f",
|
||||
"pub_rev": "@8884f572979f35a7918549caa5f258b89715aff1",
|
||||
"pub_cache_tag": "@v0.0.1+2",
|
||||
"pub_semver_tag": "@1.2.1",
|
||||
"quiver_tag": "@0.21.4",
|
||||
"scheduled_test_tag": "@0.11.8+1",
|
||||
"scheduled_test_tag": "@0.12.1+2",
|
||||
"shelf_rev": "@1e87b79b21ac5e6fa2f93576d6c06eaa65285ef4",
|
||||
"smoke_rev" : "@f3361191cc2a85ebc1e4d4c33aec672d7915aba9",
|
||||
"source_maps_rev": "@379b4f31c4e2987eb15934d1ad8b419c6cc897b3",
|
||||
"sqlite_rev": "@38811b79f42801662adc0458a25270ab690a6b81",
|
||||
"shelf_static_rev": "@v0.2.1",
|
||||
"shelf_web_socket_rev": "@ff170cec2c0e4e5722cdf47c557be63b5035a602",
|
||||
"source_map_stack_trace_tag": "@1.0.4",
|
||||
"source_span_rev": "@42501132e43599a151ba6727d340e44442f86c05",
|
||||
"stack_trace_tag": "@1.2.1",
|
||||
"stack_trace_tag": "@1.3.4",
|
||||
"string_scanner_rev": "@3e7617d6f74ba382e9b6130b1cc12091d89a9bc5",
|
||||
"sunflower_rev": "@879b704933413414679396b129f5dfa96f7a0b1e",
|
||||
"test_tag": "@0.12.1",
|
||||
"test_tag": "@0.12.3+4",
|
||||
"test_reflective_loader_tag": "@0.0.3",
|
||||
"utf_rev": "@1f55027068759e2d52f2c12de6a57cce5f3c5ee6",
|
||||
"unittest_tag": "@0.11.6",
|
||||
|
@ -180,6 +182,8 @@ deps = {
|
|||
(Var("github_mirror") % "analyzer_cli") + Var("analyzer_cli_rev"),
|
||||
Var("dart_root") + "/third_party/pkg/args":
|
||||
(Var("github_mirror") % "args") + Var("args_tag"),
|
||||
Var("dart_root") + "/third_party/pkg/async":
|
||||
"https://github.com/dart-lang/async.git" + Var("async_tag"),
|
||||
Var("dart_root") + "/third_party/pkg/barback":
|
||||
(Var("github_mirror") % "barback") + Var("barback_rev"),
|
||||
Var("dart_root") + "/third_party/pkg/charcode":
|
||||
|
@ -273,6 +277,9 @@ deps = {
|
|||
(Var("github_mirror") % "source_maps") + Var("source_maps_rev"),
|
||||
Var("dart_root") + "/third_party/pkg/source_span":
|
||||
(Var("github_mirror") % "source_span") + Var("source_span_rev"),
|
||||
Var("dart_root") + "/third_party/pkg/source_map_stack_trace":
|
||||
"https://github.com/dart-lang/source_map_stack_trace.git" +
|
||||
Var("source_map_stack_trace_tag"),
|
||||
Var("dart_root") + "/third_party/pkg/stack_trace":
|
||||
(Var("github_mirror") % "stack_trace") + Var("stack_trace_tag"),
|
||||
Var("dart_root") + "/third_party/pkg/string_scanner":
|
||||
|
|
|
@ -15,7 +15,11 @@ from os.path import dirname
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
DART_PATH = dirname(dirname(dirname(abspath(__file__))))
|
||||
import bot_utils
|
||||
|
||||
utils = bot_utils.GetUtils()
|
||||
|
||||
BUILD_OS = utils.GuessOS()
|
||||
|
||||
BUILDER_NAME = 'BUILDBOT_BUILDERNAME'
|
||||
BUILDER_CLOBBER = 'BUILDBOT_CLOBBER'
|
||||
|
@ -151,7 +155,7 @@ def RunBot(parse_name, custom_steps, build_step=BuildSDK):
|
|||
build_info.PrintBuildInfo()
|
||||
|
||||
# Make sure we are in the dart directory
|
||||
os.chdir(DART_PATH)
|
||||
os.chdir(bot_utils.DART_DIR)
|
||||
|
||||
try:
|
||||
Clobber()
|
||||
|
@ -240,6 +244,32 @@ def RunTest(name, build_info, targets, flags=None, swallow_error=False):
|
|||
RunProcess(cmd)
|
||||
|
||||
|
||||
def RunTestRunner(build_info, path):
|
||||
"""
|
||||
Runs the test package's runner on the package at 'path'.
|
||||
"""
|
||||
sdk_bin = os.path.join(
|
||||
bot_utils.DART_DIR,
|
||||
utils.GetBuildSdkBin(BUILD_OS, build_info.mode, build_info.arch))
|
||||
|
||||
build_root = utils.GetBuildRoot(
|
||||
BUILD_OS, build_info.mode, build_info.arch)
|
||||
package_root = os.path.abspath(os.path.join(build_root, 'packages'))
|
||||
|
||||
dart_name = 'dart.exe' if build_info.system == 'windows' else 'dart'
|
||||
dart_bin = os.path.join(sdk_bin, dart_name)
|
||||
|
||||
test_bin = os.path.abspath(
|
||||
os.path.join('third_party', 'pkg', 'test', 'bin', 'test.dart'))
|
||||
|
||||
with utils.ChangedWorkingDirectory(path):
|
||||
args = [dart_bin, '--package-root=' + package_root, test_bin,
|
||||
'--package-root', package_root, '--reporter', 'expanded',
|
||||
'--no-color']
|
||||
print("Running %s" % ' '.join(args))
|
||||
RunProcess(args)
|
||||
|
||||
|
||||
def RunProcess(command):
|
||||
"""
|
||||
Runs command.
|
||||
|
|
|
@ -11,6 +11,7 @@ Runs tests for packages that are hosted in the main Dart repo and in
|
|||
third_party/pkg_tested.
|
||||
"""
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
@ -38,12 +39,6 @@ def PkgConfig(name, is_buildbot):
|
|||
builder_tag=locale)
|
||||
|
||||
def PkgSteps(build_info):
|
||||
with bot.BuildStep('Build package-root'):
|
||||
args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode,
|
||||
'packages']
|
||||
print 'Building package-root: %s' % (' '.join(args))
|
||||
bot.RunProcess(args)
|
||||
|
||||
common_args = ['--write-test-outcome-log']
|
||||
if build_info.builder_tag:
|
||||
common_args.append('--builder-tag=%s' % build_info.builder_tag)
|
||||
|
@ -57,27 +52,31 @@ def PkgSteps(build_info):
|
|||
# Experiment with not running concurrent calls.
|
||||
if build_info.system == 'windows':
|
||||
common_args.append('-j1')
|
||||
if build_info.mode == 'release':
|
||||
bot.RunTest('pkg ', build_info,
|
||||
common_args + ['pkg', 'docs', 'pkg_tested'],
|
||||
swallow_error=True)
|
||||
else:
|
||||
# Pkg tests currently have a lot of timeouts when run in debug mode.
|
||||
# See issue 18479
|
||||
bot.RunTest('pkg', build_info, common_args + ['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)
|
||||
bot.RunTest('pkg ', build_info,
|
||||
common_args + ['pkg', 'docs'],
|
||||
swallow_error=True)
|
||||
|
||||
public_args = (common_args +
|
||||
['--append_logs', '--use-public-packages', 'pkgbuild'])
|
||||
bot.RunTest('pkgbuild_public_pkgs', pkgbuild_build_info, public_args)
|
||||
# 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)
|
||||
|
|
|
@ -12,15 +12,8 @@ Runs tests for pub and the pub packages that are hosted in the main Dart repo.
|
|||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
import bot
|
||||
import bot_utils
|
||||
|
||||
utils = bot_utils.GetUtils()
|
||||
|
||||
BUILD_OS = utils.GuessOS()
|
||||
|
||||
PUB_BUILDER = r'pub-(linux|mac|win)'
|
||||
|
||||
|
@ -42,34 +35,11 @@ def PubConfig(name, is_buildbot):
|
|||
|
||||
return bot.BuildInfo('none', 'vm', mode, system, checked=True)
|
||||
|
||||
def Run(command):
|
||||
print "Running %s" % ' '.join(command)
|
||||
return bot.RunProcess(command)
|
||||
|
||||
def PubSteps(build_info):
|
||||
sdk_bin = os.path.join(
|
||||
bot_utils.DART_DIR,
|
||||
utils.GetBuildSdkBin(BUILD_OS, build_info.mode, build_info.arch))
|
||||
pub_script_name = 'pub.bat' if build_info.system == 'windows' else 'pub'
|
||||
pub_bin = os.path.join(sdk_bin, pub_script_name)
|
||||
|
||||
pub_copy = os.path.join(utils.GetBuildRoot(BUILD_OS), 'pub_copy')
|
||||
pub_location = os.path.join('third_party', 'pkg', 'pub')
|
||||
|
||||
with bot.BuildStep('Make copy of pub for testing'):
|
||||
print 'Removing old copy %s' % pub_copy
|
||||
shutil.rmtree(pub_copy, ignore_errors=True)
|
||||
print 'Copying %s to %s' % (pub_location, pub_copy)
|
||||
shutil.copytree(pub_location, pub_copy)
|
||||
|
||||
# TODO(nweiz): add logic for testing pub.
|
||||
with bot.BuildStep('Doing the magic ls'):
|
||||
with utils.ChangedWorkingDirectory(pub_copy):
|
||||
Run(['ls', '-l'])
|
||||
|
||||
with bot.BuildStep('Running pub'):
|
||||
Run([pub_bin, '--version'])
|
||||
|
||||
with bot.BuildStep('Running pub tests'):
|
||||
bot.RunTestRunner(build_info, pub_location)
|
||||
|
||||
if __name__ == '__main__':
|
||||
bot.RunBot(PubConfig, PubSteps)
|
||||
|
|
Loading…
Reference in a new issue