Bug 1265584 - Reverse the order of metadata iteration, r=maja_zf
authorJames Graham <james@hoppipolla.co.uk>
Mon, 14 May 2018 22:25:48 +0100
changeset 419876 cc1d47bf0aa7efe3e770316c9ea5d895beafcaba
parent 419875 bc43ae3ccc9f203268a2b495b99515c617306c88
child 419877 cc9b28394533a30a6ae33def5ce1117882653134
push id34052
push userccoroiu@mozilla.com
push dateFri, 25 May 2018 17:52:14 +0000
treeherdermozilla-central@94d7f0e1c4d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1265584
milestone62.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 1265584 - Reverse the order of metadata iteration, r=maja_zf wptrunner previously iterated over properties from least significant to most significant. However this was broken since it caused per-directory properties to override per-test properties, which wasn't expected. Therefore we reverse the order of iteration from most significant to least. MozReview-Commit-ID: 5Rh6EGNtnUS
testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
@@ -166,25 +166,24 @@ class Test(object):
 
     def _get_metadata(self, subtest=None):
         if self._test_metadata is not None and subtest is not None:
             return self._test_metadata.get_subtest(subtest)
         else:
             return self._test_metadata
 
     def itermeta(self, subtest=None):
-        for metadata in self._inherit_metadata:
-            yield metadata
-
         if self._test_metadata is not None:
-            yield self._get_metadata()
             if subtest is not None:
                 subtest_meta = self._get_metadata(subtest)
                 if subtest_meta is not None:
                     yield subtest_meta
+            yield self._get_metadata()
+        for metadata in reversed(self._inherit_metadata):
+            yield metadata
 
     def disabled(self, subtest=None):
         for meta in self.itermeta(subtest):
             disabled = meta.disabled
             if disabled is not None:
                 return disabled
         return None
 
@@ -220,36 +219,34 @@ class Test(object):
                 return count
         return 0
 
     @property
     def tags(self):
         tags = set()
         for meta in self.itermeta():
             meta_tags = meta.tags
+            tags |= meta_tags
             if atom_reset in meta_tags:
-                tags = meta_tags.copy()
                 tags.remove(atom_reset)
-            else:
-                tags |= meta_tags
+                break
 
         tags.add("dir:%s" % self.id.lstrip("/").split("/")[0])
 
         return tags
 
     @property
     def prefs(self):
         prefs = {}
         for meta in self.itermeta():
             meta_prefs = meta.prefs
-            if atom_reset in prefs:
-                prefs = meta_prefs.copy()
+            prefs.update(meta_prefs)
+            if atom_reset in meta_prefs:
                 del prefs[atom_reset]
-            else:
-                prefs.update(meta_prefs)
+                break
         return prefs
 
     def expected(self, subtest=None):
         if subtest is None:
             default = self.result_cls.default_expected
         else:
             default = self.subtest_result_cls.default_expected