Only status from interesting bots are reported to the Dashboard

TBR=phoglund
BUG=none
TEST=Tested with local modifications on the live installation.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2496 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kjellander@webrtc.org 2012-07-09 09:43:30 +00:00
parent e9eb235bc1
commit 1bc6d3238c
2 changed files with 55 additions and 10 deletions

47
tools/quality_tracking/track_build_status.py Executable file → Normal file
View File

@ -12,8 +12,6 @@
it to the dashboard. It is adapted to build bot version 0.7.12.
"""
__author__ = 'phoglund@webrtc.org (Patrik Höglund)'
import httplib
import constants
@ -21,6 +19,28 @@ import dashboard_connection
import tgrid_parser
BOTS = ['Win32Debug',
'Win32Release',
'Mac32Debug',
'Mac32Release',
'Linux32Debug',
'Linux32Release',
'Linux64Debug',
'Linux64Release',
'LinuxClang',
'Linux64Debug-GCC4.6',
'LinuxMemcheck',
'LinuxTsan',
'LinuxAsan',
'WinLargeTests',
'MacLargeTests',
'LinuxLargeTests',
'CrOS',
'Android',
'AndroidNDK',
]
class FailedToGetStatusFromMaster(Exception):
pass
@ -44,13 +64,31 @@ def _download_and_parse_build_status():
def _is_chrome_only_build(revision_to_bot_name):
"""Figures out if a revision-to-bot-name mapping represents a Chrome build.
We assume here that Chrome revisions are always > 100000, whereas WebRTC
revisions will not reach that number in the foreseeable future."""
We assume here that Chrome revisions are always > 100000, whereas WebRTC
revisions will not reach that number in the foreseeable future.
"""
revision = int(revision_to_bot_name.split('--')[0])
bot_name = revision_to_bot_name.split('--')[1]
return 'Chrome' in bot_name and revision > 100000
def _get_desired_bots(bot_to_status_mapping, desired_bot_names):
"""Returns the desired bots for the builds status from the dictionary.
Args:
bot_to_status_mapping: Dictionary mapping bot name with revision to status.
desired_bot_names: List of bot names that will be the only bots returned in
the resulting dictionary.
Returns: A dictionary only containing the desired bots.
"""
result = {}
for revision_to_bot_name, status in bot_to_status_mapping.iteritems():
bot_name = revision_to_bot_name.split('--')[1]
if bot_name in desired_bot_names:
result[revision_to_bot_name] = status
return result
def _filter_chrome_only_builds(bot_to_status_mapping):
"""Filters chrome-only builds from the system so LKGR doesn't get confused."""
return dict((revision_to_bot_name, status)
@ -65,6 +103,7 @@ def _main():
constants.ACCESS_TOKEN_FILE)
bot_to_status_mapping = _download_and_parse_build_status()
bot_to_status_mapping = _get_desired_bots(bot_to_status_mapping, BOTS)
bot_to_status_mapping = _filter_chrome_only_builds(bot_to_status_mapping)
dashboard.send_post_request(constants.ADD_BUILD_STATUS_DATA_URL,

18
tools/quality_tracking/track_build_status_test.py Executable file → Normal file
View File

@ -10,8 +10,6 @@
"""Unit test for the build status tracker script."""
__author__ = 'phoglund@webrtc.org (Patrik Höglund)'
import copy
import unittest
@ -19,13 +17,14 @@ import unittest
import track_build_status
NORMAL_BOT_TO_STATUS_MAPPING = { '1455--ChromeOS': '455--OK',
'1455--Chrome': '900--failed',
'1455--Linux32DBG': '344--OK',
'1456--ChromeOS': '456--OK' }
NORMAL_BOT_TO_STATUS_MAPPING = {'1455--ChromeOS': '455--OK',
'1455--Chrome': '900--failed',
'1455--Linux32DBG': '344--OK',
'1456--ChromeOS': '456--OK'}
class TrackBuildStatusTest(unittest.TestCase):
def test_that_filter_chrome_only_builds_filter_properly(self):
bot_to_status_mapping = copy.deepcopy(NORMAL_BOT_TO_STATUS_MAPPING)
bot_to_status_mapping['133445--Chrome'] = '901--OK'
@ -42,6 +41,13 @@ class TrackBuildStatusTest(unittest.TestCase):
self.assertEquals(NORMAL_BOT_TO_STATUS_MAPPING, result)
def test_get_desired_bots(self):
bot_to_status_mapping = copy.deepcopy(NORMAL_BOT_TO_STATUS_MAPPING)
desired_bot_names = ['Linux32DBG']
result = track_build_status._get_desired_bots(bot_to_status_mapping,
desired_bot_names)
self.assertEquals(1, len(result))
self.assertTrue(desired_bot_names[0] in result.keys()[0])
if __name__ == '__main__':
unittest.main()