Bug 1308789 - Fix setting of default platforms for tests
The previous logic meant that any top-level platform (e.g. 'win64') without any
try-by-default slave platforms wouldn't get test runs unless 'win64' was
specified as an argument to -p.
This patch also flips the test case logic around now to demonstrate that the
issue is fixed.
MozReview-Commit-ID: KI0RayHbyAi
--- a/test/test_try_parser.py
+++ b/test/test_try_parser.py
@@ -526,21 +526,17 @@ class TestTryParser(unittest.TestCase):
}
unittestSuites = ['reftest']
customBuilders = TryParser(tm, validTesterNames, testerPrettyNames,
None, unittestSuites)
expectedBuilders = ['Windows 8 64-bit try opt test reftest',
'Windows XP 32-bit try opt test reftest',
]
- # The proper behaviour is to have these lists be equal
- # To reproduce the bug, first test that the results are unequal
- # Unfortunately trial doesn't handle the unittest.expectedFailure
- # decorator
- self.assertNotEqual(sorted(customBuilders), sorted(expectedBuilders))
+ self.assertEqual(sorted(customBuilders), sorted(expectedBuilders))
def test_HiddenCharactersAndOldSyntax(self):
tm = 'attributes\ntry: -b o -p linux64 -m none -u reftest -t none'
self.customBuilders = TryParser(tm, VALID_BUILDER_NAMES, BUILDER_PRETTY_NAMES, None, UNITTEST_SUITES)
builders = [BUILDER_PRETTY_NAMES['linux64']]
self.assertEqual(sorted(self.customBuilders), sorted(builders))
def test_NoBuildTypeSelected(self):
--- a/try_parser.py
+++ b/try_parser.py
@@ -361,19 +361,17 @@ def TryParser(
# buildType == debug
all_platforms = list(
set([p.replace('-debug', '') for p in all_platforms]))
# Platforms whose prettyNames all have 'try-nondefault' in them are not
# included in -p all
default_platforms = set()
if unittestSuites or talosSuites:
- for p in all_platforms:
- default_platforms.update(
- [p for n in prettyNames[p] if 'try-nondefault' not in n])
+ default_platforms = prettyNames.keys()
else:
defaultPrettyNames = dict([(k, v)
for k, v in prettyNames.iteritems()
if 'try-nondefault' not in v])
for p in all_platforms:
if p in defaultPrettyNames:
default_platforms.add(p)
elif p + '-debug' in defaultPrettyNames: