Fixed bugs in the coverage tracker.

BUG=
TEST=

Review URL: https://webrtc-codereview.appspot.com/421003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1810 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org 2012-03-01 15:50:30 +00:00
parent 8fd937e664
commit 0f1a96a360
4 changed files with 17 additions and 14 deletions

View File

@ -30,7 +30,7 @@ BUILD_MASTER_SERVER = 'webrtc-cb-linux-master.cbf.corp.google.com:8010'
BUILD_MASTER_TRANSPOSED_GRID_URL = '/tgrid'
# Build bot constants.
BUILD_BOT_COVERAGE_WWW_DIRECTORY = '/var/www/'
BUILD_BOT_COVERAGE_WWW_DIRECTORY = '/var/www/coverage'
# Dashboard data input URLs.
ADD_COVERAGE_DATA_URL = DASHBOARD_SERVER_HTTP + '/add_coverage_data'

View File

@ -145,7 +145,7 @@ class AddBuildStatusData(oauth_post_request_handler.OAuthPostRequestHandler):
(build_number, status) = _parse_status(build_number_and_status)
(revision, bot_name) = _parse_name(revision_and_bot_name)
except ValueError as error:
logger.warn('Invalid parameter in request: %s.' % error)
logging.warn('Invalid parameter in request: %s.' % error)
self.response.set_status(400)
return

View File

@ -55,7 +55,7 @@ class AddCoverageData(oauth_post_request_handler.OAuthPostRequestHandler):
function_coverage = _parse_percentage(function_coverage_string)
except ValueError as error:
logger.warn('Invalid parameter in request: %s.' % error)
logging.warn('Invalid parameter in request: %s.' % error)
self.response.set_status(400)
return

View File

@ -47,21 +47,23 @@ def _find_latest_32bit_debug_build(www_directory_contents, coverage_www_dir):
Coverage directories have the form Linux32bitDBG_<number>. There may be
other directories in the list though, for instance for other build
configurations.
configurations. We assume here that build numbers keep rising and never
wrap around or anything like that.
"""
# This sort ensures we will encounter the directory with the highest number
# first.
www_directory_contents.sort(reverse=True)
found_build_numbers = []
for entry in www_directory_contents:
match = re.match('Linux32DBG_\d+', entry)
match = re.match('Linux32DBG_(\d+)', entry)
if match is not None:
return entry
found_build_numbers.append(int(match.group(1)))
raise CouldNotFindCoverageDirectory('Error: Found no 32-bit '
'debug build in directory %s.' %
coverage_www_dir)
if not found_build_numbers:
raise CouldNotFindCoverageDirectory('Error: Found no 32-bit '
'debug build in directory %s.' %
coverage_www_dir)
most_recent = max(found_build_numbers)
return 'Linux32DBG_' + str(most_recent)
def _grab_coverage_percentage(label, index_html_contents):
@ -97,7 +99,8 @@ def _main():
dashboard.read_required_files(constants.CONSUMER_SECRET_FILE,
constants.ACCESS_TOKEN_FILE)
www_dir_contents = os.listdir(BUILD_BOT_COVERAGE_WWW_DIRECTORY)
coverage_www_dir = constants.BUILD_BOT_COVERAGE_WWW_DIRECTORY
www_dir_contents = os.listdir(coverage_www_dir)
latest_build_directory = _find_latest_32bit_debug_build(www_dir_contents,
coverage_www_dir)