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

Unified Diff: testing/chromoting/browser_tests_launcher.py

Issue 1279823004: Custom install me2me host on Linux Swarming bots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fgfd Created 5 years, 4 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
Index: testing/chromoting/browser_tests_launcher.py
diff --git a/testing/chromoting/browser_tests_launcher.py b/testing/chromoting/browser_tests_launcher.py
index d39d2910e3e70ae330e210206d3c250147603c27..c5a6c4cc0731d95d8bba2d4244d44f7f31b6c633 100644
--- a/testing/chromoting/browser_tests_launcher.py
+++ b/testing/chromoting/browser_tests_launcher.py
@@ -21,7 +21,7 @@ HOST_HASH_VALUE = hashlib.md5(socket.gethostname()).hexdigest()
SUCCESS_INDICATOR = 'SUCCESS: all tests passed.'
NATIVE_MESSAGING_DIR = 'NativeMessagingHosts'
CRD_ID = 'chrome-remote-desktop' # Used in a few file/folder names
-CHROMOTING_HOST_PATH = '/opt/google/chrome-remote-desktop/chrome-remote-desktop'
+CHROMOTING_HOST_PATH = './remoting/host/linux/linux_me2me_host.py'
TEST_FAILURE = False
FAILING_TESTS = ''
HOST_READY_INDICATOR = 'Host ready to receive connections.'
@@ -29,6 +29,7 @@ BROWSER_NOT_STARTED_ERROR = (
'Still waiting for the following processes to finish')
TIME_OUT_INDICATOR = '(TIMED OUT)'
MAX_RETRIES = 1
+ISOLATE_TEMP_FOLDER = ''
joedow 2015/08/07 22:16:19 Can you init this variable up here instead of usin
anandc 2015/08/07 22:26:41 Done.
def LaunchBTCommand(args, command):
@@ -156,10 +157,19 @@ def RestartMe2MeHost():
False: if HOST_READY_INDICATOR not found in stdout.
"""
+ # To start the host, we want to be in the temp-folder for this test execution.
+ # Store the current folder to return back to it later.
+ cwd = os.getcwd()
joedow 2015/08/07 22:16:19 can you use previous_directory here? It is no lon
anandc 2015/08/07 22:26:41 Done.
+ os.chdir(ISOLATE_TEMP_FOLDER)
+
# Stop chromoting host.
RunCommandInSubProcess(CHROMOTING_HOST_PATH + ' --stop')
# Start chromoting host.
results = RunCommandInSubProcess(CHROMOTING_HOST_PATH + ' --start')
+
+ # Go back to starting folder.
joedow 2015/08/07 22:16:19 nit: remove comment, I think it will be obvious if
anandc 2015/08/07 22:26:41 Done.
+ os.chdir(cwd)
+ print 'Now in %s: ' % os.getcwd()
# Confirm that the start process completed, and we got:
# "Host ready to receive connections." in the log.
if HOST_READY_INDICATOR not in results:
@@ -220,6 +230,14 @@ def TestCaseSetup(args):
def main(args):
+ global ISOLATE_TEMP_FOLDER
+ # On a Swarming bot where these tests are executed, a temp folder is created
+ # under which the files specified in an .isolate are copied. This temp folder
+ # has a random name, which we'll store here for use late.
+ # Note that the test-execution always start from the testing/chromoting folder
+ # under the temp folder.
+ ISOLATE_TEMP_FOLDER = os.path.abspath(os.path.join(os.getcwd(), '../..'))
+
InitialiseTestMachineForLinux(args.cfg_file)
with open(args.commands_file) as f:
@@ -232,15 +250,12 @@ def main(args):
# All tests completed. Include host-logs in the test results.
host_log_contents = ''
- # There should be only 1 log file, as we delete logs on test completion.
- # Loop through matching files, just in case there are more.
for log_file in glob.glob('/tmp/chrome_remote_desktop_*'):
with open(log_file, 'r') as log:
host_log_contents += '\nHOST LOG %s\n CONTENTS:\n%s' % (
log_file, log.read())
print host_log_contents
- # Was there any test failure?
if TEST_FAILURE:
print '++++++++++AT LEAST 1 TEST FAILED++++++++++'
print FAILING_TESTS.rstrip('\n')

Powered by Google App Engine
This is Rietveld 408576698