Backed out changeset 4fcae0e31524 (bug 1498636) for multiple browser-chrome failures e.g browser_ext_browserAction_popup_resize.js. CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Mon, 04 Feb 2019 15:27:06 +0200
changeset 456613 70eed5b291e743debe9ade6f101aba97b7131518
parent 456612 f2d79af5a356f5b09e3e656cf8ae5000dda7a83d
child 456614 19cdd41c33e6f251bb4fbc88a2a87f646c758dbd
push id35496
push userbtara@mozilla.com
push dateMon, 04 Feb 2019 17:36:40 +0000
treeherdermozilla-central@be1beccfb86d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1498636
milestone67.0a1
backs out4fcae0e31524da7ca7477e076738f9cf826939bd
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
Backed out changeset 4fcae0e31524 (bug 1498636) for multiple browser-chrome failures e.g browser_ext_browserAction_popup_resize.js. CLOSED TREE
testing/mozbase/manifestparser/manifestparser/manifestparser.py
testing/mozbase/manifestparser/tests/test_manifestparser.py
testing/mozbase/moztest/moztest/resolve.py
--- a/testing/mozbase/manifestparser/manifestparser/manifestparser.py
+++ b/testing/mozbase/manifestparser/manifestparser/manifestparser.py
@@ -142,30 +142,20 @@ class ManifestParser(object):
         # Rootdir is needed for relative path calculation. Precompute it for
         # the microoptimization used below.
         if self.rootdir is None:
             rootdir = ""
         else:
             assert os.path.isabs(self.rootdir)
             rootdir = self.rootdir + os.path.sep
 
-        if parentmanifest and filename:
-            # A manifest can be read multiple times, via "include:", optionally
-            # with section-specific variables. These variables only apply to
-            # the included manifest when included via the same parent manifest,
-            # so they must be associated with (parentmanifest, filename).
-            # |defaults| contains the defaults of the parent manifest, plus any
-            # variables from the "[include:...]" section.
-            self.manifest_defaults[(parentmanifest, filename)] = defaults.copy()
-
         # read the configuration
         sections = read_ini(fp=fp, variables=defaults, strict=self.strict,
                             handle_defaults=self._handle_defaults)
-        if parentmanifest is None:
-            self.manifest_defaults[filename] = defaults
+        self.manifest_defaults[filename] = defaults
 
         parent_section_found = False
 
         # get the tests
         for section, data in sections:
             # In case of defaults only, no other section than parent: has to
             # be processed.
             if defaults_only and not section.startswith('parent:'):
@@ -346,27 +336,20 @@ class ManifestParser(object):
             return [test[_key] for test in tests]
 
         # return the tests
         return tests
 
     def manifests(self, tests=None):
         """
         return manifests in order in which they appear in the tests
-        If |tests| is not set, the order of the manifests is unspecified.
         """
         if tests is None:
-            manifests = []
             # Make sure to return all the manifests, even ones without tests.
-            for manifest in self.manifest_defaults.keys():
-                if isinstance(manifest, tuple):
-                    (parentmanifest, manifest) = manifest
-                if manifest not in manifests:
-                    manifests.append(manifest)
-            return manifests
+            return self.manifest_defaults.keys()
 
         manifests = []
         for test in tests:
             manifest = test.get('manifest')
             if not manifest:
                 continue
             if manifest not in manifests:
                 manifests.append(manifest)
--- a/testing/mozbase/manifestparser/tests/test_manifestparser.py
+++ b/testing/mozbase/manifestparser/tests/test_manifestparser.py
@@ -123,131 +123,16 @@ foo = bar
 [include/flowers]
 blue = ocean
 red = roses
 yellow = submarine"""  # noqa
 
         self.assertEqual(buffer.getvalue().strip(),
                          expected_output)
 
-    def test_include_manifest_defaults(self):
-        """
-        Test that manifest_defaults and manifests() are correctly populated
-        when includes are used.
-        """
-
-        include_example = os.path.join(here, 'include-example.ini')
-        noinclude_example = os.path.join(here, 'just-defaults.ini')
-        bar_path = os.path.join(here, 'include', 'bar.ini')
-        foo_path = os.path.join(here, 'include', 'foo.ini')
-
-        parser = ManifestParser(manifests=(include_example, noinclude_example))
-
-        # Standalone manifests must be appear as-is.
-        self.assertTrue(include_example in parser.manifest_defaults)
-        self.assertTrue(noinclude_example in parser.manifest_defaults)
-
-        # Included manifests must only appear together with the parent manifest
-        # that included the manifest.
-        self.assertFalse(bar_path in parser.manifest_defaults)
-        self.assertFalse(foo_path in parser.manifest_defaults)
-        self.assertTrue((include_example, bar_path) in parser.manifest_defaults)
-        self.assertTrue((include_example, foo_path) in parser.manifest_defaults)
-
-        # manifests() must only return file paths (strings).
-        manifests = parser.manifests()
-        self.assertEqual(len(manifests), 4)
-        self.assertIn(foo_path, manifests)
-        self.assertIn(bar_path, manifests)
-        self.assertIn(include_example, manifests)
-        self.assertIn(noinclude_example, manifests)
-
-    def test_include_repeated(self):
-        """
-        Test that repeatedly included manifests are independent of each other.
-        """
-        include_example = os.path.join(here, 'include-example.ini')
-        included_foo = os.path.join(here, 'include', 'foo.ini')
-
-        # In the expected output, blue and yellow have the values from foo.ini
-        # (ocean, submarine) instead of the ones from include-example.ini
-        # (violets, daffodils), because the defaults in the included file take
-        # precedence over the values from the parent.
-        include_output = """[include/crash-handling]
-foo = fleem
-
-[fleem]
-foo = bar
-
-[include/flowers]
-blue = ocean
-foo = bar
-red = roses
-yellow = submarine
-
-"""
-        included_output = """[include/flowers]
-blue = ocean
-yellow = submarine
-
-"""
-
-        parser = ManifestParser(manifests=(include_example, included_foo),
-                                rootdir=here)
-        self.assertEqual(parser.get('name'),
-                         ['crash-handling', 'fleem', 'flowers', 'flowers'])
-        self.assertEqual([(test['name'], os.path.basename(test['manifest']))
-                          for test in parser.tests],
-                         [('crash-handling', 'bar.ini'),
-                          ('fleem', 'include-example.ini'),
-                          ('flowers', 'foo.ini'),
-                          ('flowers', 'foo.ini')])
-        self.check_included_repeat(parser, parser.tests[3], parser.tests[2],
-                                   "%s%s" % (include_output, included_output))
-
-        # Same tests, but with the load order of the manifests swapped.
-        parser = ManifestParser(manifests=(included_foo, include_example),
-                                rootdir=here)
-        self.assertEqual(parser.get('name'),
-                         ['flowers', 'crash-handling', 'fleem', 'flowers'])
-        self.assertEqual([(test['name'], os.path.basename(test['manifest']))
-                          for test in parser.tests],
-                         [('flowers', 'foo.ini'),
-                          ('crash-handling', 'bar.ini'),
-                          ('fleem', 'include-example.ini'),
-                          ('flowers', 'foo.ini')])
-        self.check_included_repeat(parser, parser.tests[0], parser.tests[3],
-                                   "%s%s" % (included_output, include_output))
-
-    def check_included_repeat(self, parser, isolated_test, included_test,
-                              expected_output):
-        include_example = os.path.join(here, 'include-example.ini')
-        included_foo = os.path.join(here, 'include', 'foo.ini')
-        manifest_default_key = (include_example, included_foo)
-
-        self.assertFalse('ancestor-manifest' in isolated_test)
-        self.assertEqual(included_test['ancestor-manifest'],
-                         os.path.join(here, 'include-example.ini'))
-
-        self.assertTrue(include_example in parser.manifest_defaults)
-        self.assertTrue(included_foo in parser.manifest_defaults)
-        self.assertTrue(manifest_default_key in parser.manifest_defaults)
-        self.assertEqual(parser.manifest_defaults[manifest_default_key],
-                         {
-                             'foo': 'bar',
-                             'here': os.path.join(here, 'include'),
-                             'red': 'roses',
-                             'blue': 'violets',
-                             'yellow': 'daffodils',
-                         })
-
-        buffer = StringIO()
-        parser.write(fp=buffer)
-        self.assertEqual(buffer.getvalue(), expected_output)
-
     def test_invalid_path(self):
         """
         Test invalid path should not throw when not strict
         """
         manifest = os.path.join(here, 'include-invalid.ini')
         ManifestParser(manifests=(manifest,), strict=False)
 
     def test_parent_inheritance(self):
--- a/testing/mozbase/moztest/moztest/resolve.py
+++ b/testing/mozbase/moztest/moztest/resolve.py
@@ -326,17 +326,17 @@ class TestMetadata(object):
                 defaults = pickle.load(fh)
         for path, tests in test_data.items():
             for metadata in tests:
                 if defaults:
                     defaults_manifests = [metadata['manifest']]
 
                     ancestor_manifest = metadata.get('ancestor-manifest')
                     if ancestor_manifest:
-                        defaults_manifests.append((ancestor_manifest, metadata['manifest']))
+                        defaults_manifests.append(ancestor_manifest)
 
                     for manifest in defaults_manifests:
                         manifest_defaults = defaults.get(manifest)
                         if manifest_defaults:
                             metadata = manifestparser.combine_fields(manifest_defaults,
                                                                      metadata)
                 self._tests_by_path[path].append(metadata)
                 self._test_dirs.add(os.path.dirname(path))