Bug 1493674 - Use in-tree metadata rather than relying on links in the objdir r=ato
authorJames Graham <james@hoppipolla.co.uk>
Tue, 25 Sep 2018 12:03:34 +0000
changeset 438112 56894c8957aecf7ce0336691b24a55469bccbd06
parent 438111 c8c69f954c9ec39159e411602ba5477454a34fa0
child 438113 b61f58586c264fa6192a70a33a3b47e187c94e95
push id34710
push useraciure@mozilla.com
push dateTue, 25 Sep 2018 21:48:21 +0000
treeherdermozilla-central@17254f49a52e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1493674
milestone64.0a1
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
Bug 1493674 - Use in-tree metadata rather than relying on links in the objdir r=ato Differential Revision: https://phabricator.services.mozilla.com/D6673
testing/web-platform/manifestdownload.py
testing/web-platform/manifestupdate.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
--- a/testing/web-platform/manifestdownload.py
+++ b/testing/web-platform/manifestdownload.py
@@ -158,36 +158,45 @@ def create_parser():
     return parser
 
 
 def download_from_taskcluster(logger, wpt_dir, repo_root, force=False):
     return download_manifest(logger, wpt_dir, lambda: get_commits(logger, repo_root),
                              taskcluster_url, force)
 
 
-def generate_config(path):
+def generate_config(obj_base_path):
     """Generate the local wptrunner.ini file to use locally"""
     import ConfigParser
     here = os.path.split(os.path.abspath(__file__))[0]
     config_path = os.path.join(here, 'wptrunner.ini')
-    path = os.path.join(path, 'wptrunner.local.ini')
+    path = os.path.join(obj_base_path, 'wptrunner.local.ini')
 
     if os.path.exists(path):
         return True
 
     parser = ConfigParser.SafeConfigParser()
     success = parser.read(config_path)
     assert config_path in success, success
 
-    parser.set('manifest:upstream', 'tests', os.path.join(here, 'tests'))
-    parser.set('manifest:mozilla', 'tests', os.path.join(here, 'mozilla', 'tests'))
-    parser.set('paths', 'prefs', os.path.join(os.getcwd(), 'testing', 'profiles'))
+    for name, path_prefix in [("upstream", ""),
+                              ("mozilla", "mozilla")]:
+        obj_path = os.path.join(obj_base_path, path_prefix)
+        src_path = os.path.join(here, path_prefix)
+        parser.set('manifest:%s' % name, 'manifest',
+                   os.path.join(obj_path, 'meta', 'MANIFEST.json'))
+
+        for key, dir_path in [("tests", "tests"), ("metadata", "meta")]:
+            parser.set("manifest:%s" % name, key, os.path.join(src_path, dir_path))
+
+    parser.set('paths', 'prefs', os.path.abspath(os.path.join(here, "..", 'profiles')))
 
     with open(path, 'wb') as config_file:
         parser.write(config_file)
+
     return True
 
 
 def update_manifest(logger, config_dir, manifest_update=True):
     if manifest_update:
         logger.info("Updating manifests")
         import manifestupdate
         here = os.path.split(os.path.abspath(__file__))[0]
--- a/testing/web-platform/manifestupdate.py
+++ b/testing/web-platform/manifestupdate.py
@@ -21,41 +21,45 @@ def create_parser():
     p = argparse.ArgumentParser()
     p.add_argument("--rebuild", action="store_true",
                    help="Rebuild the manifest from scratch")
     commandline.add_logging_group(p)
 
     return p
 
 
-def update(logger, wpt_dir, rebuild=False, config_dir=None,):
+def update(logger, wpt_dir, rebuild=False, config_dir=None):
     localpaths = imp.load_source("localpaths",
                                  os.path.join(wpt_dir, "tests", "tools", "localpaths.py"))
 
-    if not config_dir or not os.path.exists(os.path.join(config_dir, 'wptrunner.local.ini')):
+    if not config_dir:
         config_dir = wpt_dir
         config_name = "wptrunner.ini"
     else:
+        if not os.path.exists(os.path.join(config_dir, 'wptrunner.local.ini')):
+            from manifestdownload import generate_config
+            generate_config(config_dir)
         config_name = "wptrunner.local.ini"
 
     kwargs = {"config": os.path.join(config_dir, config_name),
               "tests_root": None,
               "metadata_root": None}
 
     set_from_config(kwargs)
-    config = kwargs["config"]
-    test_paths = get_test_paths(config)
     do_delayed_imports(wpt_dir)
 
-    return _update(logger, test_paths, rebuild)
+    return _update(logger, kwargs["test_paths"], rebuild)
 
 
 def _update(logger, test_paths, rebuild):
     for url_base, paths in test_paths.iteritems():
-        manifest_path = os.path.join(paths["metadata_path"], "MANIFEST.json")
+        if "manifest_path" in paths:
+            manifest_path = paths["manifest_path"]
+        else:
+            manifest_path = os.path.join(paths["metadata_path"], "MANIFEST.json")
         m = None
         if not rebuild and os.path.exists(manifest_path):
             try:
                 m = manifest.manifest.load(paths["tests_path"], manifest_path)
             except manifest.manifest.ManifestVersionMismatch:
                 logger.info("Manifest format changed, rebuilding")
         if m is None:
             m = manifest.manifest.Manifest(url_base)
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
@@ -360,16 +360,17 @@ def set_from_config(kwargs):
             kwargs["test_paths"]["/"] = {}
         kwargs["test_paths"]["/"]["manifest_path"] = kwargs["manifest_path"]
 
     kwargs["suite_name"] = kwargs["config"].get("web-platform-tests", {}).get("name", "web-platform-tests")
 
 
     check_paths(kwargs)
 
+
 def get_test_paths(config):
     # Set up test_paths
     test_paths = OrderedDict()
 
     for section in config.iterkeys():
         if section.startswith("manifest:"):
             manifest_opts = config.get(section)
             url_base = manifest_opts.get("url_base", "/")