Skip to content

Commit

Permalink
chore: move tools/wpt to tests/wpt/runner (denoland#22545)
Browse files Browse the repository at this point in the history
Towards denoland#22525

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
  • Loading branch information
iuioiua and mmastrac authored Mar 5, 2024
1 parent c559e81 commit 0022c35
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
{
Expand All @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wpt_epoch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/wpt/runner/config.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
File renamed without changes.
14 changes: 10 additions & 4 deletions tools/wpt/runner.ts → tests/wpt/runner/runner.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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",
Expand Down Expand Up @@ -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,
"[]",
);
Expand Down Expand Up @@ -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]);
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions tools/wpt/utils.ts → tests/wpt/runner/utils.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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(
Expand All @@ -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[];
Expand Down
18 changes: 6 additions & 12 deletions tools/wpt.ts → tests/wpt/wpt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
runWithTestUtil,
TestCaseResult,
TestResult,
} from "./wpt/runner.ts";
} from "./runner/runner.ts";
import {
assert,
autoConfig,
Expand All @@ -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[];
Expand Down
11 changes: 0 additions & 11 deletions tools/wpt/config.json

This file was deleted.

0 comments on commit 0022c35

Please sign in to comment.