Bug 1317101 - Part 8a: Read defaults from ancestor manifests when processing test metadata. r=chmanchester
authorKris Maglione <maglione.k@gmail.com>
Sat, 12 Nov 2016 18:30:47 -0800
changeset 323249 2fa61db0ad05e0d55f58ed2046c8a41503a3ce13
parent 323248 3330301202ab60286f826d61a473f1e1a8057301
child 323250 7651bcf89bf1669c7cd3c1d954ccd440f91599bf
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.