Bug 1317101 - Part 8a: Read defaults from ancestor manifests when processing test metadata. r?chmanchester draft
authorKris Maglione <maglione.k@gmail.com>
Sat, 12 Nov 2016 18:30:47 -0800
changeset 438078 3509bfa191c5520bafe8ce066bea872f46389a02
parent 438077 5781a884fc0640acaf166632fb64fe244e900906
child 438079 02913757cfe6c0c0de832482a69e57d19e448c06
push id35614
push usermaglione.k@gmail.com
push dateSun, 13 Nov 2016 03:28:59 +0000
reviewerschmanchester
bugs1317101
milestone52.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.