Skip to content

Commit

Permalink
Update WPT (use workerd-tools archive) (#3286)
Browse files Browse the repository at this point in the history
  • Loading branch information
npaun authored Jan 2, 2025
1 parent e32af7a commit 16853b4
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 43 deletions.
11 changes: 0 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
11 changes: 10 additions & 1 deletion build/deps/build_deps.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
2 changes: 2 additions & 0 deletions build/deps/gen/build_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -56,3 +57,4 @@ def deps_gen():
dep_ruff_darwin_arm64()
dep_ruff_linux_arm64()
dep_ruff_linux_amd64()
dep_wpt()
19 changes: 19 additions & 0 deletions build/deps/gen/dep_wpt.bzl
Original file line number Diff line number Diff line change
@@ -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",
)
65 changes: 34 additions & 31 deletions src/workerd/api/wpt/urlpattern-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down

0 comments on commit 16853b4

Please sign in to comment.