Bug 1150497 - Make manifestparser tags whitespace (instead of comma) delimited to conform to other attributes, r=chmanchester
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 02 Apr 2015 09:50:30 -0400
changeset 237459 5d83bd430b88cc88e718f00cc554a76232c1f3f6
parent 237458 8e356e2617806fb2b905759749aeca169ed1e7ae
child 237460 72368655a2d5621d85328f3dab94382a2f237f16
push id28536
push userryanvm@gmail.com
push dateFri, 03 Apr 2015 14:34:15 +0000
treeherdermozilla-central@6d849a62ec0d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1150497
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1150497 - Make manifestparser tags whitespace (instead of comma) delimited to conform to other attributes, r=chmanchester
testing/mozbase/manifestparser/manifestparser/filters.py
testing/mozbase/manifestparser/tests/test_filters.py
--- a/testing/mozbase/manifestparser/manifestparser/filters.py
+++ b/testing/mozbase/manifestparser/manifestparser/filters.py
@@ -307,32 +307,39 @@ class chunk_by_runtime(InstanceFilter):
 
 
 class tags(InstanceFilter):
     """
     Removes tests that don't contain any of the given tags. This overrides
     InstanceFilter's __eq__ method, so multiple instances can be added.
     Multiple tag filters is equivalent to joining tags with the AND operator.
 
+    To define a tag in a manifest, add a `tags` attribute to a test or DEFAULT
+    section. Tests can have multiple tags, in which case they should be
+    whitespace delimited. For example:
+
+    [test_foobar.html]
+    tags = foo bar
+
     :param tags: A tag or list of tags to filter tests on
     """
     unique = False
 
     def __init__(self, tags):
         InstanceFilter.__init__(self, tags)
         if isinstance(tags, basestring):
             tags = [tags]
         self.tags = tags
 
     def __call__(self, tests, values):
         for test in tests:
             if 'tags' not in test:
                 continue
 
-            test_tags = [t.strip() for t in test['tags'].split(',')]
+            test_tags = [t.strip() for t in test['tags'].split()]
             if any(t in self.tags for t in test_tags):
                 yield test
 
 
 # filter container
 
 DEFAULT_FILTERS = (
     skip_if,
--- a/testing/mozbase/manifestparser/tests/test_filters.py
+++ b/testing/mozbase/manifestparser/tests/test_filters.py
@@ -97,17 +97,17 @@ class BuiltinFilters(unittest.TestCase):
     tests = (
         {"name": "test0"},
         {"name": "test1", "skip-if": "foo == 'bar'"},
         {"name": "test2", "run-if": "foo == 'bar'"},
         {"name": "test3", "fail-if": "foo == 'bar'"},
         {"name": "test4", "disabled": "some reason"},
         {"name": "test5", "subsuite": "baz"},
         {"name": "test6", "subsuite": "baz,foo == 'bar'"},
-        {"name": "test7", "tags": "foo, bar"},
+        {"name": "test7", "tags": "foo bar"},
     )
 
     def test_skip_if(self):
         tests = deepcopy(self.tests)
         tests = list(skip_if(tests, {}))
         self.assertEquals(len(tests), len(self.tests))
 
         tests = deepcopy(self.tests)