Bug 1332570: better test for ridealongs; r?Callek
MozReview-Commit-ID: 1eUytk4cMcf
--- a/taskcluster/taskgraph/test/test_try_option_syntax.py
+++ b/taskcluster/taskgraph/test/test_try_option_syntax.py
@@ -1,16 +1,15 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
import unittest
-import itertools
from ..try_option_syntax import TryOptionSyntax
from ..try_option_syntax import RIDEALONG_BUILDS
from ..graph import Graph
from ..taskgraph import TaskGraph
from .util import TestTask
from mozunit import main
@@ -132,22 +131,19 @@ class TestTryOptionSyntax(unittest.TestC
def test_p_linux_win32(self):
"-p linux,win32 sets platforms=['linux', 'linux-l10n', 'win32']"
tos = TryOptionSyntax('try: -p linux,win32', empty_graph)
self.assertEqual(sorted(tos.platforms), ['linux', 'linux-l10n', 'win32'])
def test_p_expands_ridealongs(self):
"-p linux,linux64 includes the RIDEALONG_BUILDS"
tos = TryOptionSyntax('try: -p linux,linux64', empty_graph)
- ridealongs = list(task
- for task in itertools.chain.from_iterable(
- RIDEALONG_BUILDS.itervalues()
- )
- if 'android' not in task) # Don't include android-l10n
- self.assertEqual(sorted(tos.platforms), sorted(['linux', 'linux64'] + ridealongs))
+ platforms = set(['linux'] + RIDEALONG_BUILDS['linux'])
+ platforms |= set(['linux64'] + RIDEALONG_BUILDS['linux64'])
+ self.assertEqual(sorted(tos.platforms), sorted(platforms))
def test_u_none(self):
"-u none sets unittests=[]"
tos = TryOptionSyntax('try: -u none', graph_with_jobs)
self.assertEqual(sorted(tos.unittests), [])
def test_u_all(self):
"-u all sets unittests=[..whole list..]"