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

Unified Diff: testing/chromoting/browser_tests_launcher.py

Issue 657433002: Python wrapper to launch Chromoting browser-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Raise exception if executing command fails. Created 6 years, 2 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
new file mode 100644
index 0000000000000000000000000000000000000000..3e934917766fa2bfa0944c7beb69e01337d5e2d2
--- /dev/null
+++ b/testing/chromoting/browser_tests_launcher.py
@@ -0,0 +1,45 @@
+# Copyright (c) 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Utility script to launch browser-tests on the Chromoting bot."""
+import argparse
+import subprocess
+
+PROD_DIR_ID = '$(PROD_DIR)'
+
+
+def LaunchCommand(command):
+
+ cmd_line = [command]
+ try:
+ results = subprocess.check_output(
+ cmd_line, stderr=subprocess.STDOUT, shell=True)
+ except subprocess.CalledProcessError, e:
+ raise Exception('Exception %s running command %s' % (e, command))
+ else:
+ print results
+ finally:
+ pass
+
+
+def main():
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-f', '--file',
+ help='path to file containing list of command to launch.')
weitao 2014/10/17 16:56:49 s/command/commands
+ parser.add_argument('-p', '--prod_dir',
+ help='build output folder, i.e., <(PRODUCT_DIR).')
weitao 2014/10/17 16:56:49 It doesn't have to be the build output folder. Sug
+
+ args = parser.parse_args()
+
+ with open(args.file) as f:
+ for line in f:
+ # Replace the PROD_DIR value in the command-line with
+ # the passed in value.
+ line = line.replace(PROD_DIR_ID, args.prod_dir)
+ LaunchCommand(line)
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « testing/chromoting/browser_test_commands_linux.txt ('k') | testing/chromoting/chromoting_integration_tests.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698