Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: tools/bots/bot.py

Issue 1214343004: Run pub tests on the pub bots. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Use the right dart_style version. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | tools/bots/pkg.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bots/bot.py
diff --git a/tools/bots/bot.py b/tools/bots/bot.py
index 0015f471e931bc0779b95ca3cdb804344601d9ab..ed20c5d93208704e5fd588c029fabaf39300c202 100644
--- a/tools/bots/bot.py
+++ b/tools/bots/bot.py
@@ -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.
« no previous file with comments | « DEPS ('k') | tools/bots/pkg.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698