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

Unified Diff: tools/bots/compiler.py

Issue 15741006: Add chromeOnAndroid support to the buildbot annotated steps scripts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add android tools to PATH Created 7 years, 7 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 | « no previous file | tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bots/compiler.py
diff --git a/tools/bots/compiler.py b/tools/bots/compiler.py
index 72cf2e69a0cee959c24a6108c971b0a03ac0ffe7..fd34ac6454a7ab95da4b3418e2d32f328aa17776 100644
--- a/tools/bots/compiler.py
+++ b/tools/bots/compiler.py
@@ -10,10 +10,11 @@ Dart2js buildbot steps
Runs tests for the dart2js compiler.
"""
-import platform
import os
+import platform
import re
import shutil
+import socket
import subprocess
import sys
@@ -22,7 +23,7 @@ import bot
DART2JS_BUILDER = (
r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-checked))?(-(host-checked))?(-(minified))?-?(\d*)-?(\d*)')
WEB_BUILDER = (
- r'dart2js-(ie9|ie10|ff|safari|chrome|opera)-(win7|win8|mac10\.8|mac10\.7|linux)(-(all|html))?(-(csp))?(-(\d+)-(\d+))?')
+ r'dart2js-(ie9|ie10|ff|safari|chrome|chromeOnAndroid|opera)-(win7|win8|mac10\.8|mac10\.7|linux)(-(all|html))?(-(csp))?(-(\d+)-(\d+))?')
def GetBuildInfo(builder_name, is_buildbot):
@@ -145,7 +146,7 @@ def TestStep(name, mode, system, compiler, runtime, targets, flags):
# TODO(ricow): temporary hack to run on fyi with --use_browser_controller
if (os.environ.get('BUILDBOT_SCHEDULER') == "fyi-main" and
- (runtime == 'chrome' or runtime == 'ff')):
+ runtime in ['chrome', 'ff', 'chromeOnAndroid']):
cmd.append('--use_browser_controller')
global IsFirstTestStepCall
@@ -296,6 +297,29 @@ def GetHasHardCodedCheckedMode(build_info):
return False
+def GetLocalIPAddress():
+ hostname = socket.gethostname()
+ # '$ host chromeperf02' results for example in
+ # 'chromeperf02.perf.chromium.org has address 172.22.28.55'
+ output = subprocess.check_output(["host", hostname])
+ match = re.match(r'.*\s+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\s+.*', output)
+ if not match:
+ raise Exception("Could not determine local ip address "
+ "(hostname: '%s', host command output: '%s')."
+ % (hostname, output))
+ return match.group(1)
+
+def AddAndroidToolsToPath():
+ par_dir = os.path.pardir
+ join = os.path.join
+
+ dart_dir = join(os.path.dirname(__file__), par_dir, par_dir)
+ android_sdk = join(dart_dir, 'third_party', 'android_tools', 'sdk')
+ tools_dir = os.path.abspath(join(android_sdk, 'tools'))
+ platform_tools_dir = os.path.abspath(join(android_sdk, 'platform-tools'))
+ os.environ['PATH'] = os.pathsep.join(
ricow1 2013/05/22 16:33:29 when we spawn a new process will this be inherited
+ [os.environ['PATH'], tools_dir, platform_tools_dir])
+
def RunCompilerTests(build_info):
test_flags = []
if build_info.shard_index:
@@ -310,6 +334,12 @@ def RunCompilerTests(build_info):
if build_info.csp: test_flags += ['--csp']
+ if build_info.runtime == 'chromeOnAndroid':
+ test_flags.append('--local_ip=%s' % GetLocalIPAddress())
+ # test.py expects the android tools directories to be in PATH
+ # (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.test_set)
« no previous file with comments | « no previous file | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698