Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #24175 from zacc/bug_1068670
Browse files Browse the repository at this point in the history
Bug 1068670 - Update the gaiatest treeherder mixin to be able to push to...
  • Loading branch information
Zac committed Sep 18, 2014
2 parents 647bbec + f6afeef commit 2dee9fd
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions tests/python/gaia-ui-tests/gaiatest/mixins/treeherder.py
Expand Up @@ -18,13 +18,22 @@
import requests
from thclient import TreeherderRequest, TreeherderJobCollection

# The device_group_map maps by device name then
# device_firmware_version_release to denote the underlying Android version
DEVICE_GROUP_MAP = {
'flame': {
'name': 'Flame Device Image',
'symbol': 'Flame'},
'4.4.2': {
'name': 'Flame KitKat Device Image',
'symbol': 'Flame-KK'},
'4.3': {
'name': 'Flame Device Image',
'symbol': 'Flame'}
},
'msm7627a': {
'name': 'Buri/Hamachi Device Image',
'symbol': 'Buri/Hamac'}}
'4.0.4': {
'name': 'Buri/Hamachi Device Image',
'symbol': 'Buri/Hamac'}
}}


class S3UploadError(Exception):
Expand Down Expand Up @@ -74,21 +83,27 @@ def post_to_treeherder(self, tests):
job = job_collection.get_job()

device = version.get('device_id')
device_firmware_version_release = \
version.get('device_firmware_version_release')

if not device:
self.logger.error('Submitting to Treeherder is currently limited '
'to devices.')
return

try:
group = DEVICE_GROUP_MAP[device]
group = DEVICE_GROUP_MAP[device][device_firmware_version_release]
job.add_group_name(group['name'])
job.add_group_symbol(group['symbol'])
job.add_job_name('Gaia Python Integration Test (%s)' % device)
job.add_job_symbol('Gip')
except KeyError:
self.logger.error('Unknown device id: %s, unable to determine '
'Treeherder group. Supported device ids: %s' % (
device, DEVICE_GROUP_MAP.keys()))
self.logger.error('Unknown device id: %s or device firmware '
'version: %s. Unable to determine Treeherder '
'group. Supported devices: %s'
% (device, device_firmware_version_release,
['%s: %s' %(k, [fw for fw in v.keys()])
for k, v in DEVICE_GROUP_MAP.iteritems()]))
return

# Determine revision hash from application revision
Expand Down

0 comments on commit 2dee9fd

Please sign in to comment.