Bug 1317101 - Part 8a: Read defaults from ancestor manifests when processing test metadata. r=chmanchester
☠☠ backed out by ed48815cbe18 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Sat, 12 Nov 2016 18:30:47 -0800
changeset 322938 e06d269a5d4f35b608b5bc7f1c61e875f2322b45
parent 322937 1e1bfb578dcd24433d43fb67cc1f75e87ba48d21
child 322939 a8cdc81cdcce558592d01d3cc6d0ee66269f1077
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewerschmanchester
bugs1317101
milestone53.0a1
Bug 1317101 - Part 8a: Read defaults from ancestor manifests when processing test metadata. r=chmanchester MozReview-Commit-ID: 90ldX6DuKBy
python/mozbuild/mozbuild/testing.py
--- a/python/mozbuild/mozbuild/testing.py
+++ b/python/mozbuild/mozbuild/testing.py
@@ -60,21 +60,27 @@ class TestMetadata(object):
             test_data = pickle.load(fh)
         defaults = None
         if test_defaults:
             with open(test_defaults, 'rb') as fh:
                 defaults = pickle.load(fh)
         for path, tests in test_data.items():
             for metadata in tests:
                 if defaults:
-                    manifest = metadata['manifest']
-                    manifest_defaults = defaults.get(manifest)
-                    if manifest_defaults:
-                        metadata = manifestparser.combine_fields(manifest_defaults,
-                                                                 metadata)
+                    defaults_manifests = [metadata['manifest']]
+
+                    ancestor_manifest = metadata.get('ancestor-manifest')
+                    if ancestor_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))
                 flavor = metadata.get('flavor')
                 self._tests_by_flavor[flavor].add(path)
 
     def tests_with_flavor(self, flavor):
         """Obtain all tests having the specified flavor.