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

Side by Side Diff: build/android/pylib/utils/report_results.py

Issue 22903016: [android] Adds constants.GetOutDirectory() and converts test scripts to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix provision_devices.py which never set the build type Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Module containing utility functions for reporting results.""" 5 """Module containing utility functions for reporting results."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 10
11 from pylib import constants 11 from pylib import constants
12 12
13 import flakiness_dashboard_results_uploader 13 import flakiness_dashboard_results_uploader
14 14
15 15
16 def _LogToFile(results, test_type, suite_name): 16 def _LogToFile(results, test_type, suite_name):
17 """Log results to local files which can be used for aggregation later.""" 17 """Log results to local files which can be used for aggregation later."""
18 log_file_path = os.path.join(constants.DIR_SOURCE_ROOT, 'out', 18 log_file_path = os.path.join(constants.GetOutDirectory(), 'test_logs')
19 constants.GetBuildType(), 'test_logs')
20 if not os.path.exists(log_file_path): 19 if not os.path.exists(log_file_path):
21 os.mkdir(log_file_path) 20 os.mkdir(log_file_path)
22 full_file_name = os.path.join( 21 full_file_name = os.path.join(
23 log_file_path, re.sub('\W', '_', test_type).lower() + '.log') 22 log_file_path, re.sub('\W', '_', test_type).lower() + '.log')
24 if not os.path.exists(full_file_name): 23 if not os.path.exists(full_file_name):
25 with open(full_file_name, 'w') as log_file: 24 with open(full_file_name, 'w') as log_file:
26 print >> log_file, '\n%s results for %s build %s:' % ( 25 print >> log_file, '\n%s results for %s build %s:' % (
27 test_type, os.environ.get('BUILDBOT_BUILDERNAME'), 26 test_type, os.environ.get('BUILDBOT_BUILDERNAME'),
28 os.environ.get('BUILDBOT_BUILDNUMBER')) 27 os.environ.get('BUILDBOT_BUILDNUMBER'))
29 logging.info('Writing results to %s.' % full_file_name) 28 logging.info('Writing results to %s.' % full_file_name)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 # instrumenation test package using different annotations. 100 # instrumenation test package using different annotations.
102 if annotation and len(annotation) == 1: 101 if annotation and len(annotation) == 1:
103 suite_name = annotation[0] 102 suite_name = annotation[0]
104 else: 103 else:
105 suite_name = test_package 104 suite_name = test_package
106 _LogToFile(results, test_type, suite_name) 105 _LogToFile(results, test_type, suite_name)
107 106
108 if flakiness_server: 107 if flakiness_server:
109 _LogToFlakinessDashboard(results, test_type, test_package, 108 _LogToFlakinessDashboard(results, test_type, test_package,
110 flakiness_server) 109 flakiness_server)
OLDNEW
« no previous file with comments | « build/android/pylib/host_driven/test_case.py ('k') | chrome/test/functional/ispy/ispy_core/tools/reverse_port_forwarder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698