diff --git a/.gitignore b/.gitignore index 8d0893d932c..73c2fce6cda 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ /python/_venv* /python/tidy/servo_tidy.egg-info /tests/wpt/sync +/tests/wpt/**/**/.cache/ /tests/dromaeo/dromaeo *.pkl *.pyc diff --git a/python/wpt/__init__.py b/python/wpt/__init__.py index 8c9e37df750..4ca837a9a9f 100644 --- a/python/wpt/__init__.py +++ b/python/wpt/__init__.py @@ -49,15 +49,15 @@ def create_parser(): def update_args_for_legacy_layout(kwargs: dict): - kwargs["test_paths"]["/"].metadata_path = os.path.join( - WPT_PATH, "meta-legacy-layout" - ) - kwargs["test_paths"]["/_mozilla/"].metadata_path = os.path.join( - WPT_PATH, "mozilla", "meta-legacy-layout" - ) - kwargs["test_paths"]["/_webgl/"].metadata_path = os.path.join( - WPT_PATH, "webgl", "meta-legacy-layout" - ) + def override_metadata_path(url_base, metadata_path): + test_root = kwargs["test_paths"][url_base] + kwargs["test_paths"][url_base] = wptrunner.wptcommandline.TestRoot( + test_root.tests_path, + os.path.join(WPT_PATH, *metadata_path) + ) + override_metadata_path("/", ["meta-legacy-layout"]) + override_metadata_path("/_mozilla/", ["mozilla", "meta-legacy-layout"]) + override_metadata_path("/_webgl/", ["webgl", "meta-legacy-layout"]) def run_tests(): diff --git a/servo-tidy.toml b/servo-tidy.toml index 879e7705a76..64d33117a6a 100644 --- a/servo-tidy.toml +++ b/servo-tidy.toml @@ -123,6 +123,13 @@ directories = [ "./target", "./support/crown/target", "./third_party", + # Cache files generated by wptrunner which fail the EOF newlines check. + "./tests/wpt/meta/.cache", + "./tests/wpt/meta-legacy-layout/.cache", + "./tests/wpt/mozilla/meta/.cache", + "./tests/wpt/mozilla/meta-legacy-layout/.cache", + "./tests/wpt/webgl/meta/.cache", + "./tests/wpt/webgl/meta-legacy-layout/.cache", ] # Directories that are checked for correct file extension