From 8024581d7b9570153d89e5700f68f2ea90a8bbb7 Mon Sep 17 00:00:00 2001 From: Nicholas Paun Date: Thu, 2 Jan 2025 10:55:12 -0800 Subject: [PATCH] Update WPT (use workerd-tools archive) --- WORKSPACE | 11 ----- build/deps/build_deps.jsonc | 11 ++++- build/deps/gen/build_deps.bzl | 2 + build/deps/gen/dep_wpt.bzl | 19 ++++++++ src/workerd/api/wpt/urlpattern-test.js | 65 ++++++++++++++------------ 5 files changed, 65 insertions(+), 43 deletions(-) create mode 100644 build/deps/gen/dep_wpt.bzl diff --git a/WORKSPACE b/WORKSPACE index 03fd4d1c63a..b4330515343 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -393,14 +393,3 @@ new_local_repository( build_file = "@workerd//deps/rust:BUILD.lolhtml", path = "empty", ) - -# ======================================================================================== -# Web Platform Tests - -http_archive( - name = "wpt", - build_file = "//:build/BUILD.wpt", - integrity = "sha256-Hxn/D6x6lI9ISlCQFq620sb8x9iXplVzXPV6zumX84A=", - strip_prefix = "wpt-merge_pr_48695", - url = "https://github.com/web-platform-tests/wpt/archive/refs/tags/merge_pr_48695.tar.gz", -) diff --git a/build/deps/build_deps.jsonc b/build/deps/build_deps.jsonc index 2ae62e7d8c3..97b1ba10979 100644 --- a/build/deps/build_deps.jsonc +++ b/build/deps/build_deps.jsonc @@ -219,6 +219,15 @@ "repo": "ruff", "file_regex": "^ruff-x86_64-unknown-linux-gnu.tar.gz$", "build_file_content": "filegroup(name='file', srcs=glob(['**']))" - } + }, + //wpt + { + "name": "wpt", + "type": "github_release", + "owner": "cloudflare", + "repo": "workerd-tools", + "file_regex": "wpt-.*.tar.gz", + "build_file": "//:build/BUILD.wpt" + } ] } diff --git a/build/deps/gen/build_deps.bzl b/build/deps/gen/build_deps.bzl index 2f050524397..b92e293778d 100644 --- a/build/deps/gen/build_deps.bzl +++ b/build/deps/gen/build_deps.bzl @@ -27,6 +27,7 @@ load("@//build/deps:gen/dep_rules_nodejs.bzl", "dep_rules_nodejs") load("@//build/deps:gen/dep_rules_pkg.bzl", "dep_rules_pkg") load("@//build/deps:gen/dep_rules_python.bzl", "dep_rules_python") load("@//build/deps:gen/dep_rules_rust.bzl", "dep_rules_rust") +load("@//build/deps:gen/dep_wpt.bzl", "dep_wpt") def deps_gen(): dep_bazel_skylib() @@ -56,3 +57,4 @@ def deps_gen(): dep_ruff_darwin_arm64() dep_ruff_linux_arm64() dep_ruff_linux_amd64() + dep_wpt() diff --git a/build/deps/gen/dep_wpt.bzl b/build/deps/gen/dep_wpt.bzl new file mode 100644 index 00000000000..41346cae32b --- /dev/null +++ b/build/deps/gen/dep_wpt.bzl @@ -0,0 +1,19 @@ +# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT + +load("@//:build/http.bzl", "http_archive") + +TAG_NAME = "wpt-af83b77e2" +URL = "https://github.com/cloudflare/workerd-tools/releases/download/wpt-af83b77e2/wpt-af83b77e2.tar.gz" +STRIP_PREFIX = "wpt-af83b77e2" +SHA256 = "ce7f09bc8ab6604362897c484a1ee044afd7254741e3cecd7cf609d93d779d51" +TYPE = "tgz" + +def dep_wpt(): + http_archive( + name = "wpt", + url = URL, + strip_prefix = STRIP_PREFIX, + type = TYPE, + sha256 = SHA256, + build_file = "//:build/BUILD.wpt", + ) diff --git a/src/workerd/api/wpt/urlpattern-test.js b/src/workerd/api/wpt/urlpattern-test.js index b20be359d41..a2b1e0113cb 100644 --- a/src/workerd/api/wpt/urlpattern-test.js +++ b/src/workerd/api/wpt/urlpattern-test.js @@ -4,37 +4,40 @@ import { run } from 'harness'; -export const urlpatternCompareTests = run('urlpattern-compare-tests.js', { - expectedFailures: [ - // Each of these *ought* to pass. They are included here because we - // know they currently do not. Each needs to be investigated. - 'Component: pathname Left: {"pathname":"/foo/a"} Right: {"pathname":"/foo/b"}', - 'Component: pathname Left: {"pathname":"/foo/b"} Right: {"pathname":"/foo/bar"}', - 'Component: pathname Left: {"pathname":"/foo/bar"} Right: {"pathname":"/foo/:bar"}', - 'Component: pathname Left: {"pathname":"/foo/"} Right: {"pathname":"/foo/:bar"}', - 'Component: pathname Left: {"pathname":"/foo/:bar"} Right: {"pathname":"/foo/*"}', - 'Component: pathname Left: {"pathname":"/foo/{bar}"} Right: {"pathname":"/foo/(bar)"}', - 'Component: pathname Left: {"pathname":"/foo/{bar}"} Right: {"pathname":"/foo/{bar}+"}', - 'Component: pathname Left: {"pathname":"/foo/{bar}+"} Right: {"pathname":"/foo/{bar}?"}', - 'Component: pathname Left: {"pathname":"/foo/{bar}?"} Right: {"pathname":"/foo/{bar}*"}', - 'Component: pathname Left: {"pathname":"/foo/(123)"} Right: {"pathname":"/foo/(12)"}', - 'Component: pathname Left: {"pathname":"/foo/:b"} Right: {"pathname":"/foo/:a"}', - 'Component: pathname Left: {"pathname":"*/foo"} Right: {"pathname":"*"}', - 'Component: port Left: {"port":"9"} Right: {"port":"100"}', - 'Component: pathname Left: {"pathname":"foo/:bar?/baz"} Right: {"pathname":"foo/{:bar}?/baz"}', - 'Component: pathname Left: {"pathname":"foo/:bar?/baz"} Right: {"pathname":"foo{/:bar}?/baz"}', - 'Component: pathname Left: {"pathname":"foo/:bar?/baz"} Right: {"pathname":"fo{o/:bar}?/baz"}', - 'Component: pathname Left: {"pathname":"foo/:bar?/baz"} Right: {"pathname":"foo{/:bar/}?baz"}', - 'Component: pathname Left: "https://a.example.com/b?a" Right: "https://b.example.com/a?b"', - 'Component: pathname Left: {"pathname":"/foo/{bar}/baz"} Right: {"pathname":"/foo/bar/baz"}', - 'Component: protocol Left: {"protocol":"a"} Right: {"protocol":"b"}', - 'Component: username Left: {"username":"a"} Right: {"username":"b"}', - 'Component: password Left: {"password":"a"} Right: {"password":"b"}', - 'Component: hostname Left: {"hostname":"a"} Right: {"hostname":"b"}', - 'Component: search Left: {"search":"a"} Right: {"search":"b"}', - 'Component: hash Left: {"hash":"a"} Right: {"hash":"b"}', - ], -}); +export const urlpatternCompareTests = run( + 'urlpattern-compare-tests.tentative.js', + { + expectedFailures: [ + // Each of these *ought* to pass. They are included here because we + // know they currently do not. Each needs to be investigated. + 'Component: pathname Left: {"pathname":"/foo/a"} Right: {"pathname":"/foo/b"}', + 'Component: pathname Left: {"pathname":"/foo/b"} Right: {"pathname":"/foo/bar"}', + 'Component: pathname Left: {"pathname":"/foo/bar"} Right: {"pathname":"/foo/:bar"}', + 'Component: pathname Left: {"pathname":"/foo/"} Right: {"pathname":"/foo/:bar"}', + 'Component: pathname Left: {"pathname":"/foo/:bar"} Right: {"pathname":"/foo/*"}', + 'Component: pathname Left: {"pathname":"/foo/{bar}"} Right: {"pathname":"/foo/(bar)"}', + 'Component: pathname Left: {"pathname":"/foo/{bar}"} Right: {"pathname":"/foo/{bar}+"}', + 'Component: pathname Left: {"pathname":"/foo/{bar}+"} Right: {"pathname":"/foo/{bar}?"}', + 'Component: pathname Left: {"pathname":"/foo/{bar}?"} Right: {"pathname":"/foo/{bar}*"}', + 'Component: pathname Left: {"pathname":"/foo/(123)"} Right: {"pathname":"/foo/(12)"}', + 'Component: pathname Left: {"pathname":"/foo/:b"} Right: {"pathname":"/foo/:a"}', + 'Component: pathname Left: {"pathname":"*/foo"} Right: {"pathname":"*"}', + 'Component: port Left: {"port":"9"} Right: {"port":"100"}', + 'Component: pathname Left: {"pathname":"foo/:bar?/baz"} Right: {"pathname":"foo/{:bar}?/baz"}', + 'Component: pathname Left: {"pathname":"foo/:bar?/baz"} Right: {"pathname":"foo{/:bar}?/baz"}', + 'Component: pathname Left: {"pathname":"foo/:bar?/baz"} Right: {"pathname":"fo{o/:bar}?/baz"}', + 'Component: pathname Left: {"pathname":"foo/:bar?/baz"} Right: {"pathname":"foo{/:bar/}?baz"}', + 'Component: pathname Left: "https://a.example.com/b?a" Right: "https://b.example.com/a?b"', + 'Component: pathname Left: {"pathname":"/foo/{bar}/baz"} Right: {"pathname":"/foo/bar/baz"}', + 'Component: protocol Left: {"protocol":"a"} Right: {"protocol":"b"}', + 'Component: username Left: {"username":"a"} Right: {"username":"b"}', + 'Component: password Left: {"password":"a"} Right: {"password":"b"}', + 'Component: hostname Left: {"hostname":"a"} Right: {"hostname":"b"}', + 'Component: search Left: {"search":"a"} Right: {"search":"b"}', + 'Component: hash Left: {"hash":"a"} Right: {"hash":"b"}', + ], + } +); export const urlpatternHasRegexGroups = run( 'urlpattern-hasregexpgroups-tests.js', {