Bug 1346782 - Use full path when searching for wpt directory metadata, r=Ms2ger
This avoids a cache collision between directories in the main test set
and vendor-specific tests under some different metadata root.
MozReview-Commit-ID: 5WaEtaLJkVD
--- a/testing/web-platform/harness/wptrunner/manifestexpected.py
+++ b/testing/web-platform/harness/wptrunner/manifestexpected.py
@@ -232,25 +232,23 @@ def get_manifest(metadata_root, test_pat
return static.compile(f,
run_info,
data_cls_getter=data_cls_getter,
test_path=test_path,
url_base=url_base)
except IOError:
return None
-def get_dir_manifest(metadata_root, path, run_info):
+def get_dir_manifest(path, run_info):
"""Get the ExpectedManifest for a particular test path, or None if there is no
metadata stored for that test path.
- :param metadata_root: Absolute path to the root of the metadata directory
- :param path: Path to the ini file relative to the metadata root
+ :param path: Full path to the ini file
:param run_info: Dictionary of properties of the test run for which the expectation
values should be computed.
"""
- full_path = os.path.join(metadata_root, path)
try:
- with open(full_path) as f:
+ with open(path) as f:
return static.compile(f,
run_info,
data_cls_getter=lambda x,y: DirectoryManifest)
except IOError:
return None
--- a/testing/web-platform/harness/wptrunner/testloader.py
+++ b/testing/web-platform/harness/wptrunner/testloader.py
@@ -491,20 +491,20 @@ class TestLoader(object):
test_metadata = test_metadata.get_test(manifest_test.id)
return wpttest.from_manifest(manifest_test, inherit_metadata, test_metadata)
def load_dir_metadata(self, test_manifest, metadata_path, test_path):
rv = []
path_parts = os.path.dirname(test_path).split(os.path.sep)
for i in xrange(1,len(path_parts) + 1):
- path = os.path.join(os.path.sep.join(path_parts[:i]), "__dir__.ini")
+ path = os.path.join(metadata_path, os.path.sep.join(path_parts[:i]), "__dir__.ini")
if path not in self.directory_manifests:
- self.directory_manifests[path] = manifestexpected.get_dir_manifest(
- metadata_path, path, self.run_info)
+ self.directory_manifests[path] = manifestexpected.get_dir_manifest(path,
+ self.run_info)
manifest = self.directory_manifests[path]
if manifest is not None:
rv.append(manifest)
return rv
def load_metadata(self, test_manifest, metadata_path, test_path):
inherit_metadata = self.load_dir_metadata(test_manifest, metadata_path, test_path)
test_metadata = manifestexpected.get_manifest(