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

Unified Diff: build/android/test_wrapper/logdog_wrapper.py

Issue 2695963003: Use logdog butler subcommand to run tests. (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/test_wrapper/logdog_wrapper.py
diff --git a/build/android/test_wrapper/logdog_wrapper.py b/build/android/test_wrapper/logdog_wrapper.py
index 14ed7d138b432d0a2e856ce7f3ae8aa8b6b2e209..d14efdff701a9d3a81eda3b75fc7e6c97cdc68f4 100755
--- a/build/android/test_wrapper/logdog_wrapper.py
+++ b/build/android/test_wrapper/logdog_wrapper.py
@@ -54,18 +54,13 @@ def main():
logging.basicConfig(level=logging.INFO)
if not test_cmd:
parser.error('Must specify command to run after the logdog flags')
- test_proc = subprocess.Popen(test_cmd)
- original_sigterm_handler = signal.signal(
- signal.SIGTERM, CreateSignalForwarder(test_proc))
- try:
- result = test_proc.wait()
- finally:
- signal.signal(signal.SIGTERM, original_sigterm_handler)
+
if '${SWARMING_TASK_ID}' in args.prefix:
args.prefix = args.prefix.replace('${SWARMING_TASK_ID}',
os.environ.get('SWARMING_TASK_ID'))
url = CreateUrl('luci-logdog.appspot.com', args.project, args.prefix,
args.name)
+
logdog_cmd = [args.logdog_bin_cmd, '-project', args.project,
'-output', 'logdog,host=%s' % args.logdog_server,
'-prefix', args.prefix,
@@ -74,10 +69,27 @@ def main():
'-stream', '-name=%s' % args.name]
if not os.path.exists(args.logdog_bin_cmd):
+ test_proc = subprocess.Popen(test_cmd)
jbudorick 2017/02/14 23:50:27 Why is this moving? We still need to pass signals
+ original_sigterm_handler = signal.signal(
+ signal.SIGTERM, CreateSignalForwarder(test_proc))
+ try:
+ result = test_proc.wait()
+ finally:
+ signal.signal(signal.SIGTERM, original_sigterm_handler)
+
logging.error(
'Logdog binary %s unavailable. Unable to upload logcats.',
args.logdog_bin_cmd)
- elif not os.path.exists(args.source):
+ return result
+
+ test_cmd = [args.logdog_bin_cmd, '-project', args.project,
+ '-output', 'logdog,host=%s' % args.logdog_server,
+ '-prefix', args.prefix,
+ '-service-account-json', args.service_account_json,
+ 'run', '--'] + test_cmd
+ result = subprocess.call(test_cmd)
+
+ if not os.path.exists(args.source):
logging.error(
'Logcat sources not found at %s. Unable to upload logcats.',
args.source)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698