chore: move `tools/wpt` to `tests/wpt/runner` (#22545)

Towards #22525

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
This commit is contained in:
Asher Gomez 2024-03-05 11:41:16 +11:00 committed by GitHub
parent c559e813e1
commit 0022c35a23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 50 additions and 50 deletions

View File

@ -51,8 +51,8 @@
"third_party",
"tools/node_compat/TODO.md",
"tools/node_compat/node",
"tools/wpt/expectation.json",
"tools/wpt/manifest.json",
"tests/wpt/runner/expectation.json",
"tests/wpt/runner/manifest.json",
"ext/websocket/autobahn/reports"
],
"plugins": [

View File

@ -850,11 +850,11 @@ const ci = {
"deno run --allow-env --allow-net --allow-read --allow-run \\",
" --allow-write --unstable \\",
" --lock=tools/deno.lock.json \\",
" ./tools/wpt.ts setup",
" ./tests/wpt/runner/runner.ts setup",
"deno run --allow-env --allow-net --allow-read --allow-run \\",
" --allow-write --unstable \\",
" --lock=tools/deno.lock.json \\",
' ./tools/wpt.ts run --quiet --binary="$DENO_BIN"',
' ./tests/wpt/runner/runner.ts run --quiet --binary="$DENO_BIN"',
].join("\n"),
},
{
@ -867,11 +867,11 @@ const ci = {
"deno run --allow-env --allow-net --allow-read --allow-run \\",
" --allow-write --unstable \\",
" --lock=tools/deno.lock.json \\",
" ./tools/wpt.ts setup",
" ./tests/wpt/runner/runner.ts setup",
"deno run --allow-env --allow-net --allow-read --allow-run \\",
" --allow-write --unstable \\",
" --lock=tools/deno.lock.json \\",
" ./tools/wpt.ts run --quiet --release \\",
" ./tests/wpt/runner/runner.ts run --quiet --release \\",
' --binary="$DENO_BIN" \\',
" --json=wpt.json \\",
" --wptreport=wptreport.json",

View File

@ -519,11 +519,11 @@ jobs:
deno run --allow-env --allow-net --allow-read --allow-run \
--allow-write --unstable \
--lock=tools/deno.lock.json \
./tools/wpt.ts setup
./tests/wpt/runner/runner.ts setup
deno run --allow-env --allow-net --allow-read --allow-run \
--allow-write --unstable \
--lock=tools/deno.lock.json \
./tools/wpt.ts run --quiet --binary="$DENO_BIN"
./tests/wpt/runner/runner.ts run --quiet --binary="$DENO_BIN"
- name: Run web platform tests (release)
if: '!(matrix.skip) && (matrix.wpt && matrix.profile == ''release'')'
env:
@ -532,11 +532,11 @@ jobs:
deno run --allow-env --allow-net --allow-read --allow-run \
--allow-write --unstable \
--lock=tools/deno.lock.json \
./tools/wpt.ts setup
./tests/wpt/runner/runner.ts setup
deno run --allow-env --allow-net --allow-read --allow-run \
--allow-write --unstable \
--lock=tools/deno.lock.json \
./tools/wpt.ts run --quiet --release \
./tests/wpt/runner/runner.ts run --quiet --release \
--binary="$DENO_BIN" \
--json=wpt.json \
--wptreport=wptreport.json

View File

@ -68,10 +68,10 @@ jobs:
run: |
deno run --unstable --allow-write --allow-read --allow-net \
--allow-env --allow-run --lock=tools/deno.lock.json \
./tools/wpt.ts setup
./tests/wpt/runner/runner.ts setup
deno run --unstable --allow-write --allow-read --allow-net \
--allow-env --allow-run --lock=tools/deno.lock.json \
./tools/wpt.ts run \
./tests/wpt/runner/runner.ts run \ \
--binary=$(which deno) --quiet --release --no-ignore --json=wpt.json --wptreport=wptreport.json
- name: Upload wpt results to wpt.fyi

6
.gitignore vendored
View File

@ -10,7 +10,7 @@
gclient_config.py_entries
/target/
/std/hash/_wasm/target
/tools/wpt/manifest.json
/tests/wpt/runner/manifest.json
/third_party/
/tests/napi/node_modules
/tests/napi/build
@ -25,8 +25,8 @@ gclient_config.py_entries
/flamegraph*.svg
# WPT generated cert files
/tools/wpt/certs/index.txt*
/tools/wpt/certs/serial*
/tests/wpt/runner/certs/index.txt*
/tests/wpt/runner/certs/serial*
/ext/websocket/autobahn/reports

View File

@ -23,8 +23,8 @@ index 87a8cc9cc7..bbf500d8ca 100644
4. Run:
```
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
cp tests/wpt/suite/tools/certs/cacert.key tests/wpt/runner/certs/cacert.key
cp tests/wpt/suite/tools/certs/cacert.pem tests/wpt/runner/certs/cacert.pem
cp tests/wpt/suite/tools/certs/web-platform.test.key tests/wpt/runner/certs/web-platform.test.key
cp tests/wpt/suite/tools/certs/web-platform.test.pem tests/wpt/runner/certs/web-platform.test.pem
```

View File

@ -0,0 +1,11 @@
{
"check_subdomains": false,
"ssl": {
"type": "pregenerated",
"pregenerated": {
"ca_cert_path": "../../../tests/wpt/runner/certs/cacert.pem",
"host_cert_path": "../../../tests/wpt/runner/certs/web-platform.test.pem",
"host_key_path": "../../../tests/wpt/runner/certs/web-platform.test.key"
}
}
}

View File

@ -1,5 +1,11 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { delay, join, ROOT_PATH, TextLineStream, toFileUrl } from "../util.js";
import {
delay,
join,
ROOT_PATH,
TextLineStream,
toFileUrl,
} from "../../../tools/util.js";
import { assert, denoBinary, ManifestTestOptions, runPy } from "./utils.ts";
import { DOMParser } from "https://deno.land/x/deno_dom@v0.1.3-alpha2/deno-dom-wasm.ts";
@ -11,7 +17,7 @@ export async function runWithTestUtil<T>(
"wpt",
"serve",
"--config",
"../../../tools/wpt/config.json",
"../../../tests/wpt/runner/config.json",
], {
stdout: verbose ? "inherit" : "piped",
stderr: verbose ? "inherit" : "piped",
@ -123,7 +129,7 @@ export async function runSingleTest(
"--location",
url.toString(),
"--cert",
join(ROOT_PATH, `./tools/wpt/certs/cacert.pem`),
join(ROOT_PATH, `./tests/wpt/runner/certs/cacert.pem`),
tempFile,
"[]",
);
@ -205,7 +211,7 @@ async function generateBundle(location: URL): Promise<string> {
const src = script.getAttribute("src");
if (src === "/resources/testharnessreport.js") {
const url = toFileUrl(
join(ROOT_PATH, "./tools/wpt/testharnessreport.js"),
join(ROOT_PATH, "./tests/wpt/runner/testharnessreport.js"),
);
const contents = await Deno.readTextFile(url);
scriptContents.push([url.href, contents]);

View File

@ -1,8 +1,8 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
/// FLAGS
import { parse } from "../../tests/util/std/flags/mod.ts";
import { join, resolve, ROOT_PATH } from "../util.js";
import { parse } from "../../util/std/flags/mod.ts";
import { join, resolve, ROOT_PATH } from "../../../tools/util.js";
export const {
json,
@ -51,7 +51,7 @@ export interface ManifestTestOptions {
script_metadata: [string, string][];
}
const MANIFEST_PATH = join(ROOT_PATH, "./tools/wpt/manifest.json");
const MANIFEST_PATH = join(ROOT_PATH, "./tests/wpt/runner/manifest.json");
export async function updateManifest() {
const status = await runPy(
@ -76,7 +76,7 @@ export function getManifest(): Manifest {
/// WPT TEST EXPECTATIONS
const EXPECTATION_PATH = join(ROOT_PATH, "./tools/wpt/expectation.json");
const EXPECTATION_PATH = join(ROOT_PATH, "./tests/wpt/runner/expectation.json");
export interface Expectation {
[key: string]: Expectation | boolean | string[];

View File

@ -8,7 +8,7 @@ import {
runWithTestUtil,
TestCaseResult,
TestResult,
} from "./wpt/runner.ts";
} from "./runner/runner.ts";
import {
assert,
autoConfig,
@ -31,17 +31,11 @@ import {
runPy,
updateManifest,
wptreport,
} from "./wpt/utils.ts";
import { pooledMap } from "../tests/util/std/async/pool.ts";
import {
blue,
bold,
green,
red,
yellow,
} from "../tests/util/std/fmt/colors.ts";
import { writeAll, writeAllSync } from "../tests/util/std/streams/write_all.ts";
import { saveExpectation } from "./wpt/utils.ts";
} from "./runner/utils.ts";
import { pooledMap } from "../util/std/async/pool.ts";
import { blue, bold, green, red, yellow } from "../util/std/fmt/colors.ts";
import { writeAll, writeAllSync } from "../util/std/streams/write_all.ts";
import { saveExpectation } from "./runner/utils.ts";
class TestFilter {
filter?: string[];

View File

@ -1,11 +0,0 @@
{
"check_subdomains": false,
"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"
}
}
}