From 846c3ba1a3659270384061759317b8631ced82ca Mon Sep 17 00:00:00 2001 From: Tom Servo Date: Fri, 23 Nov 2018 11:03:43 -0500 Subject: [PATCH] Update manifest integration to reflect upstream API changes. --- .gitignore | 1 + tests/wpt/manifestupdate.py | 23 +++++++----- tests/wpt/metadata/MANIFEST.json | 37 +------------------ tests/wpt/run.py | 3 ++ .../wptrunner/wptrunner/wptcommandline.py | 5 ++- 5 files changed, 22 insertions(+), 47 deletions(-) diff --git a/.gitignore b/.gitignore index 55bd1fc1ce4..bf0df10791c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /.cargo/* !/.cargo/config.* /.servobuild +/.wpt /android-toolchains /target /ports/android/bin diff --git a/tests/wpt/manifestupdate.py b/tests/wpt/manifestupdate.py index 7c8fb53dead..5326993b1f7 100644 --- a/tests/wpt/manifestupdate.py +++ b/tests/wpt/manifestupdate.py @@ -14,6 +14,11 @@ from wptrunner.wptcommandline import get_test_paths, set_from_config manifest = None +servo_root = os.path.join(os.path.dirname(__file__), + os.pardir, + os.pardir) + + def do_delayed_imports(wpt_dir): global manifest sys.path.insert(0, os.path.join(wpt_dir, "tools", "manifest")) @@ -54,16 +59,14 @@ def update(logger, wpt_dir, check_clean=True, rebuild=False): def _update(logger, test_paths, rebuild): for url_base, paths in test_paths.iteritems(): manifest_path = os.path.join(paths["metadata_path"], "MANIFEST.json") - m = None - if not rebuild: - 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) - manifest.update.update(paths["tests_path"], m, working_copy=True) - manifest.manifest.write(m, manifest_path) + cache_subdir = os.path.relpath(os.path.dirname(manifest_path), + os.path.dirname(__file__)) + manifest.manifest.load_and_update(paths["tests_path"], + manifest_path, + url_base, + working_copy=True, + cache_root=os.path.join(servo_root, ".wpt", + cache_subdir)) return 0 diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 61c0619c6a7..eb91df78de1 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -309438,11 +309438,6 @@ {} ] ], - "tools/.coveragerc": [ - [ - {} - ] - ], "tools/.gitattributes": [ [ {} @@ -310683,11 +310678,6 @@ {} ] ], - "tools/third_party/attrs/.coveragerc": [ - [ - {} - ] - ], "tools/third_party/attrs/.github/CODE_OF_CONDUCT.rst": [ [ {} @@ -311238,11 +311228,6 @@ {} ] ], - "tools/third_party/funcsigs/.coveragerc": [ - [ - {} - ] - ], "tools/third_party/funcsigs/.travis.yml": [ [ {} @@ -311348,11 +311333,6 @@ {} ] ], - "tools/third_party/h2/.coveragerc": [ - [ - {} - ] - ], "tools/third_party/h2/.gitignore": [ [ {} @@ -311993,11 +311973,6 @@ {} ] ], - "tools/third_party/html5lib/.coveragerc": [ - [ - {} - ] - ], "tools/third_party/html5lib/.gitignore": [ [ {} @@ -313778,11 +313753,6 @@ {} ] ], - "tools/third_party/pytest/.coveragerc": [ - [ - {} - ] - ], "tools/third_party/pytest/.gitattributes": [ [ {} @@ -316393,11 +316363,6 @@ {} ] ], - "tools/wptserve/.coveragerc": [ - [ - {} - ] - ], "tools/wptserve/.gitignore": [ [ {} @@ -667555,7 +667520,7 @@ "support" ], "tools/wptrunner/wptrunner/wptcommandline.py": [ - "8c0b8d74a160046d7d6976235c97acbafc634cf6", + "6881477a3c04de798ee3c30edfa00384da38961a", "support" ], "tools/wptrunner/wptrunner/wptlogging.py": [ diff --git a/tests/wpt/run.py b/tests/wpt/run.py index 005da29b7e3..3820f7c41dd 100644 --- a/tests/wpt/run.py +++ b/tests/wpt/run.py @@ -58,6 +58,9 @@ def set_defaults(kwargs): if kwargs["include_manifest"] is None and "include_manifest" in paths: kwargs["include_manifest"] = paths["include_manifest"] + if kwargs["manifest_update"] is None: + kwargs["manifest_update"] = False + if kwargs["binary"] is None: bin_dir = "release" if kwargs["release"] else "debug" bin_name = "servo" diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptcommandline.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptcommandline.py index 8c0b8d74a16..6881477a3c0 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptcommandline.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptcommandline.py @@ -47,7 +47,7 @@ def create_parser(product_choices=None): TEST is either the full path to a test file to run, or the URL of a test excluding scheme host and port.""") - parser.add_argument("--manifest-update", action="store_true", default=True, + parser.add_argument("--manifest-update", action="store_true", default=None, help="Regenerate the test manifest.") parser.add_argument("--no-manifest-update", action="store_false", dest="manifest_update", help="Prevent regeneration of the test manifest.") @@ -431,6 +431,9 @@ def check_args(kwargs): if kwargs["product"] is None: kwargs["product"] = "firefox" + if kwargs["manifest_update"] is None: + kwargs["manifest_update"] = True + if "sauce" in kwargs["product"]: kwargs["pause_after_test"] = False