Bug 1062579 - Ensure get_symbol() cannot return an empty job symbol

In the case where 'n' wasn't found for jobs whose symbol letter was
suppressed (eg: a mochitest job that isn't split into multiple parts),
get_symbol() could have previously returned an empty symbol.
The suppression now only takes place if 'n' was found.
This commit is contained in:
Ed Morley 2014-09-03 23:32:01 +01:00
Родитель 086820ff20
Коммит 554b233fb3
2 изменённых файлов: 18 добавлений и 8 удалений

Просмотреть файл

@ -87,6 +87,17 @@ buildernames = [
'os': 'linux',
'os_platform': 'linux32',
'vm': True}}),
('Rev4 MacOSX Snow Leopard 10.6 mozilla-central debug test mochitest',
{'build_type': 'debug',
'job_type': 'unittest',
'name': {'group_name': 'Mochitest',
'group_symbol': 'M',
'name': 'Mochitest',
'job_symbol': 'M'},
'platform': {'arch': 'x86_64',
'os': 'mac',
'os_platform': 'osx-10-6',
'vm': False}}),
('Rev4 MacOSX Snow Leopard 10.6 mozilla-central debug test mochitest-devtools-chrome-2',
{'build_type': 'debug',
'job_type': 'unittest',

Просмотреть файл

@ -802,15 +802,14 @@ def get_symbol(name, bn):
s = SYMBOLS.get(name, "?")
# Mochitests, Mochitest-e10s and Mochitest OOP are the only ones
# that display as just a number (with no letters)
if s in ["M", "M-e10s", "M-oop"]:
s = ""
n = ""
nummatch = NUMBER_RE.match(bn)
if nummatch:
n = nummatch.group(1)
n = nummatch.group(1) if nummatch else ""
# For multi-part Mochitest, Mochitest-e10s and Mochitest OOP jobs
# display only the job part number, and not the letters.
if n and s in ["M", "M-e10s", "M-oop"]:
return n
return "{0}{1}".format(s, n)