chore: move test_util/wpt to tests/wpt/suite (#22412)

As discussed with @mmastrac. I'll move `tools/wpt` to `tests/wpt` in a
follow-up PR.

---------

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
This commit is contained in:
Asher Gomez 2024-02-16 14:32:28 +11:00 committed by GitHub
parent 4f80d83774
commit 5596de8081
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 52 additions and 30 deletions

View File

@ -47,7 +47,7 @@
"target",
"tests/ffi/tests/test.js",
"tests/util/std",
"test_util/wpt",
"tests/wpt/suite",
"third_party",
"tools/node_compat/TODO.md",
"tools/node_compat/node",

View File

@ -447,7 +447,7 @@ const ci = {
...cloneRepoStep,
submoduleStep("./tests/util/std"),
{
...submoduleStep("./test_util/wpt"),
...submoduleStep("./tests/wpt/suite"),
if: "matrix.wpt",
},
{
@ -833,7 +833,7 @@ const ci = {
name: "Configure hosts file for WPT",
if: "matrix.wpt",
run: "./wpt make-hosts-file | sudo tee -a /etc/hosts",
"working-directory": "test_util/wpt/",
"working-directory": "tests/wpt/suite/",
},
{
name: "Run web platform tests (debug)",

View File

@ -152,8 +152,8 @@ jobs:
- name: Clone submodule ./tests/util/std
run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
if: '!(matrix.skip)'
- name: Clone submodule ./test_util/wpt
run: git submodule update --init --recursive --depth=1 -- ./test_util/wpt
- name: Clone submodule ./tests/wpt/suite
run: git submodule update --init --recursive --depth=1 -- ./tests/wpt/suite
if: '!(matrix.skip) && (matrix.wpt)'
- name: Clone submodule ./tools/node_compat/node
run: git submodule update --init --recursive --depth=1 -- ./tools/node_compat/node
@ -506,7 +506,7 @@ jobs:
- name: Configure hosts file for WPT
if: '!(matrix.skip) && (matrix.wpt)'
run: ./wpt make-hosts-file | sudo tee -a /etc/hosts
working-directory: test_util/wpt/
working-directory: tests/wpt/suite/
- name: Run web platform tests (debug)
if: '!(matrix.skip) && (matrix.wpt && matrix.profile == ''debug'')'
env:

View File

@ -45,7 +45,7 @@ jobs:
deno --version
- name: Switch WPT submodule to epochs/daily
working-directory: test_util/wpt/
working-directory: tests/wpt/suite/
shell: bash
run: |
git remote set-branches origin '*'
@ -55,12 +55,12 @@ jobs:
- name: Configure hosts file for WPT (unix)
if: runner.os != 'Windows'
working-directory: test_util/wpt/
working-directory: tests/wpt/suite/
run: ./wpt make-hosts-file | sudo tee -a /etc/hosts
- name: Configure hosts file for WPT (windows)
if: runner.os == 'Windows'
working-directory: test_util/wpt/
working-directory: tests/wpt/suite/
run: python wpt make-hosts-file | Out-File $env:SystemRoot\System32\drivers\etc\hosts -Encoding ascii -Append
- name: Run web platform tests

4
.gitmodules vendored
View File

@ -2,8 +2,8 @@
path = tests/util/std
url = https://github.com/denoland/deno_std
shallow = true
[submodule "test_util/wpt"]
path = test_util/wpt
[submodule "tests/wpt/suite"]
path = tests/wpt/suite
url = https://github.com/web-platform-tests/wpt.git
[submodule "tools/node_compat/node"]

View File

@ -29,7 +29,7 @@ export async function checkCopyright() {
":!:cli/tsc/dts/**",
":!:cli/tsc/*typescript.js",
":!:cli/tsc/compiler.d.ts",
":!:test_util/wpt/**",
":!:tests/wpt/suite/**",
":!:cli/tools/init/templates/**",
":!:tests/unit_node/testdata/**",
":!:tests/node_compat/test/**",

View File

@ -1,5 +1,5 @@
{
"version": "2",
"version": "3",
"remote": {
"https://cdn.skypack.dev/-/@octokit/auth-token@v2.5.0-63e6RmuUEnR1eflFvHL4/dist=es2019,mode=imports/optimized/@octokit/auth-token.js": "5247df74f0bd63d994d1ab5b52265761cf2eb1b67f12171a030ebef4027d5eb6",
"https://cdn.skypack.dev/-/@octokit/core@v3.6.0-OHRgZVmYvb8jBujJr5vE/dist=es2019,mode=imports/optimized/@octokit/core.js": "a1f82f18dccc5b09d753690a8addd839e4fe0b5a6f6831b17437f136c8921db3",
@ -108,6 +108,7 @@
"https://deno.land/std@0.108.0/path/win32.ts": "2edb2f71f10578ee1168de01a8cbd3c65483e45a46bc2fa3156a0c6bfbd2720d",
"https://deno.land/std@0.108.0/testing/_diff.ts": "ccd6c3af6e44c74bf1591acb1361995f5f50df64323a6e7fb3f16c8ea792c940",
"https://deno.land/std@0.108.0/testing/asserts.ts": "6b0d6ba564bdff807bd0f0e93e02c48aa3177acf19416bf84a7f420191ef74cd",
"https://deno.land/std@0.170.0/fmt/colors.ts": "03ad95e543d2808bc43c17a3dd29d25b43d0f16287fe562a0be89bf632454a12",
"https://deno.land/std@0.173.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462",
"https://deno.land/std@0.173.0/bytes/bytes_list.ts": "b4cbdfd2c263a13e8a904b12d082f6177ea97d9297274a4be134e989450dfa6a",
"https://deno.land/std@0.173.0/bytes/concat.ts": "d26d6f3d7922e6d663dacfcd357563b7bf4a380ce5b9c2bbe0c8586662f25ce2",
@ -261,6 +262,19 @@
"https://deno.land/x/deno_dom@v0.1.3-alpha2/src/parser.ts": "bda4ab4a1c9a2e156877f33ee4e60caac935a7c995a86bbe026bdc0f0d31b8c1",
"https://deno.land/x/dir@1.5.1/data_local_dir/mod.ts": "91eb1c4bfadfbeda30171007bac6d85aadacd43224a5ed721bbe56bc64e9eb66",
"https://deno.land/x/outdent@v0.8.0/src/index.ts": "6dc3df4108d5d6fedcdb974844d321037ca81eaaa16be6073235ff3268841a22",
"https://deno.land/x/tty@0.1.4/ansi_regex.ts": "1d3b0c7289164f93c9ebafe3bbd05a723568a250cc5c29c0cc922ff55af9a238",
"https://deno.land/x/tty@0.1.4/combining.ts": "a615e9479d8bc901e3a727e5cae83c0aa1d4ca1e75fa040861d9905d16b30ffc",
"https://deno.land/x/tty@0.1.4/is_interactive.ts": "37080d92399827215e60a57d97013aefbdbc038e7a5d2346abd298a7010525e6",
"https://deno.land/x/tty@0.1.4/mod.ts": "65f44c03d7c3daee2b87c6a2a20b0653dec9e3b4ece8183bb0a82233a0e05ff0",
"https://deno.land/x/tty@0.1.4/strip_ansi.ts": "6671d8d44da192a713aac06fb9a0959a3c0b11a161438fdf540856e2208857d9",
"https://deno.land/x/tty@0.1.4/tty_async.ts": "cbcdc8132754084153680dd3fbc73acb58e0b9232aff09897a46edcf6f637967",
"https://deno.land/x/tty@0.1.4/tty_sync.ts": "ad5d986dbd561e5768c49bf48a54580521bdfe95aa41869e8c84d99dbae0ff08",
"https://deno.land/x/tty@0.1.4/util.ts": "fd50eb009b46f01461f3d38decaf4366c4970bbd818edc39b58a574efe67dbb7",
"https://deno.land/x/tty@0.1.4/wcwidth.ts": "ab712adbbe4a07c27cc0ab89b99c3a77d28fe911c0fd1c8cebd867efc1fb4416",
"https://deno.land/x/wait@0.1.13/deps.ts": "df762b698a00cd71463cf24cea0737d5ae49f50957c9cfcc15f7e15a5a5cad9f",
"https://deno.land/x/wait@0.1.13/log_symbols.ts": "cdf2d0aa44754d10fddd55999e933886a4d753f2acfc1219f629427ccc776ac7",
"https://deno.land/x/wait@0.1.13/mod.ts": "83211441439cd0f794f4e95fbb6c766929dd6886169100d3bdf2ea1ea5e3adfe",
"https://deno.land/x/wait@0.1.13/spinners.ts": "289346d54f8d6152a5dcd67b67e47784cf9b7a8a8f6f0b6dc041ebc2ef6bb76c",
"https://deno.land/x/which@0.2.2/mod.ts": "fd5335ef1c89bda4c7942d69dd8f895270207ba0384a97c4862ac65bba1f2343",
"https://raw.githubusercontent.com/denoland/automation/0.19.0/cargo.ts": "c686a658dca9ef5865a67ed3967affdc0d3e30c1b0b98ac85e17bf11843b46c2",
"https://raw.githubusercontent.com/denoland/automation/0.19.0/crate.ts": "47f0504eca340db871d5978915b2700345cfdd1d2875bd8dd86dbe828dc9cfca",

View File

@ -59,7 +59,7 @@ async function dlint() {
":!:tests/testdata/test/glob/**",
":!:cli/tsc/*typescript.js",
":!:cli/tsc/compiler.d.ts",
":!:test_util/wpt/**",
":!:tests/wpt/suite/**",
]);
if (!sourceFiles.length) {

View File

@ -149,7 +149,7 @@ async function setup() {
if (Deno.build.os == "windows") {
console.log("To do this run the following command in PowerShell:");
console.log("");
console.log(" cd test_util/wpt/");
console.log(" cd tests/wpt/suite/");
console.log(
" python.exe wpt make-hosts-file | Out-File $env:SystemRoot\\System32\\drivers\\etc\\hosts -Encoding ascii -Append",
);
@ -157,7 +157,7 @@ async function setup() {
} else {
console.log("To do this run the following command in your shell:");
console.log("");
console.log(" cd test_util/wpt/");
console.log(" cd tests/wpt/suite/");
console.log(
" python3 ./wpt make-hosts-file | sudo tee -a /etc/hosts",
);

View File

@ -18,13 +18,13 @@ index 87a8cc9cc7..bbf500d8ca 100644
"duration": duration,
```
2. `cd test_util/wpt/`
2. `cd tests/wpt/suite/`
3. `./wpt serve --config tools/certs/config.json`
4. Run:
```
cp test_util/wpt/tools/certs/cacert.key tools/wpt/certs/cacert.key
cp test_util/wpt/tools/certs/cacert.pem tools/wpt/certs/cacert.pem
cp test_util/wpt/tools/certs/web-platform.test.key tools/wpt/certs/web-platform.test.key
cp test_util/wpt/tools/certs/web-platform.test.pem tools/wpt/certs/web-platform.test.pem
cp tests/wpt/suite/tools/certs/cacert.key tools/wpt/certs/cacert.key
cp tests/wpt/suite/tools/certs/cacert.pem tools/wpt/certs/cacert.pem
cp tests/wpt/suite/tools/certs/web-platform.test.key tools/wpt/certs/web-platform.test.key
cp tests/wpt/suite/tools/certs/web-platform.test.pem tools/wpt/certs/web-platform.test.pem
```

View File

@ -3,9 +3,9 @@
"ssl": {
"type": "pregenerated",
"pregenerated": {
"ca_cert_path": "../../tools/wpt/certs/cacert.pem",
"host_cert_path": "../../tools/wpt/certs/web-platform.test.pem",
"host_key_path": "../../tools/wpt/certs/web-platform.test.key"
"ca_cert_path": "../../../tools/wpt/certs/cacert.pem",
"host_cert_path": "../../../tools/wpt/certs/web-platform.test.pem",
"host_key_path": "../../../tools/wpt/certs/web-platform.test.key"
}
}
}

View File

@ -11,7 +11,7 @@ export async function runWithTestUtil<T>(
"wpt",
"serve",
"--config",
"../../tools/wpt/config.json",
"../../../tools/wpt/config.json",
], {
stdout: verbose ? "inherit" : "piped",
stderr: verbose ? "inherit" : "piped",
@ -31,7 +31,11 @@ export async function runWithTestUtil<T>(
}
const passedTime = performance.now() - start;
if (passedTime > 15000) {
proc.kill("SIGINT");
try {
proc.kill("SIGINT");
} catch {
// Might have already died
}
await proc.status;
throw new Error("Timed out while trying to start wpt test util.");
}
@ -43,7 +47,11 @@ export async function runWithTestUtil<T>(
return await f();
} finally {
if (verbose) console.log("Killing wpt test util.");
proc.kill("SIGINT");
try {
proc.kill("SIGINT");
} catch {
// Might have already died
}
await proc.status;
}
}

View File

@ -130,7 +130,7 @@ export function runPy<T extends Omit<Deno.CommandOptions, "cwd">>(
stdout: "inherit",
stderr: "inherit",
...options,
cwd: join(ROOT_PATH, "./test_util/wpt/"),
cwd: join(ROOT_PATH, "./tests/wpt/suite/"),
}).spawn();
}
@ -181,13 +181,13 @@ export async function generateRunInfo(): Promise<unknown> {
};
const proc = await new Deno.Command("git", {
args: ["rev-parse", "HEAD"],
cwd: join(ROOT_PATH, "test_util", "wpt"),
cwd: join(ROOT_PATH, "tests", "wpt", "suite"),
stderr: "inherit",
}).output();
const revision = (new TextDecoder().decode(proc.stdout)).trim();
const proc2 = await new Deno.Command(denoBinary(), {
args: ["eval", "console.log(JSON.stringify(Deno.version))"],
cwd: join(ROOT_PATH, "test_util", "wpt"),
cwd: join(ROOT_PATH, "tests", "wpt", "suite"),
}).output();
const version = JSON.parse(new TextDecoder().decode(proc2.stdout));
const runInfo = {