Bug 1488849 - Don't fail when a chunk is not running any test when the try selector is 'coverage'. r=ahal

--HG--
extra : rebase_source : 8099420cf47593ea7b38fadc8b4c5f87f791f250
This commit is contained in:
Marco Castelluccio 2018-11-23 17:59:04 +01:00
Родитель 2467797afd
Коммит 8eff89e376
4 изменённых файлов: 10 добавлений и 4 удалений

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

@ -149,7 +149,8 @@ class CheckTestCompleteParser(OutputParser):
levels=TBPL_WORST_LEVEL_TUPLE)
# Account for the possibility that no test summary was output.
if self.pass_count == 0 and self.fail_count == 0:
if (self.pass_count == 0 and self.fail_count == 0 and
os.environ.get('TRY_SELECTOR') != 'coverage'):
self.error('No tests run or test summary not found')
self.tbpl_status = self.worst_level(TBPL_WARNING, self.tbpl_status,
levels=TBPL_WORST_LEVEL_TUPLE)

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

@ -6,6 +6,7 @@
# ***** END LICENSE BLOCK *****
import re
import os
from mozharness.mozilla.testing.errors import TinderBoxPrintRe
from mozharness.base.log import OutputParser, WARNING, INFO, CRITICAL, ERROR
@ -202,8 +203,9 @@ class DesktopUnittestOutputParser(OutputParser):
levels=TBPL_WORST_LEVEL_TUPLE)
# Account for the possibility that no test summary was output.
if self.pass_count <= 0 and self.fail_count <= 0 and \
(self.known_fail_count is None or self.known_fail_count <= 0):
if (self.pass_count <= 0 and self.fail_count <= 0 and
(self.known_fail_count is None or self.known_fail_count <= 0) and
os.environ.get('TRY_SELECTOR') != 'coverage'):
self.error('No tests run or test summary not found')
self.worst_log_level = self.worst_level(WARNING,
self.worst_log_level)

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

@ -1620,7 +1620,7 @@ class XPCShellTests(object):
self.log.error(t)
raise exceptions[0]
if self.testCount == 0:
if self.testCount == 0 and os.environ.get('TRY_SELECTOR') != 'coverage':
self.log.error("No tests run. Did you pass an invalid --test-path?")
self.failCount = 1

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

@ -90,6 +90,9 @@ def push_to_try(method, msg, labels=None, templates=None, try_task_config=None,
commit_message = ('%s%s\n\nPushed via `mach try %s`' %
(msg, closed_tree_string, method))
if templates is not None:
templates.setdefault('env', {}).update({'TRY_SELECTOR': method})
if labels or labels == []:
try_task_config = {
'version': 1,