Skip to content

Commit

Permalink
tests: fix wpt epoch ci job (denoland#10960)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Jun 14, 2021
1 parent c651757 commit f48d66b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 23 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/wpt_epoch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
deno-version: [v1.x, canary]
os: [macOS-latest, ubuntu-latest-xl, windows-2019]
os: [ubuntu-latest-xl]

steps:
- name: Clone repository
Expand All @@ -46,7 +46,12 @@ jobs:
- name: Switch WPT submodule to epochs/daily
working-directory: test_util/wpt/
run: git reset origin/epochs/daily --hard
shell: bash
run: |
git remote set-branches origin '*'
git fetch origin
git checkout origin/epochs/daily
git checkout -b epochs/daily
- name: Configure hosts file for WPT (unix)
if: runner.os != 'Windows'
Expand All @@ -62,8 +67,11 @@ jobs:
shell: bash
run: |
deno run --unstable --allow-write --allow-read --allow-net --allow-env --allow-run ./tools/wpt.ts setup
deno run --unstable --allow-write --allow-read --allow-net --allow-env --allow-run ./tools/wpt.ts run --binary=(which deno) --quiet --release --json=wpt.json --wptreport=wptreport.json || true
deno run --unstable --allow-write --allow-read --allow-net --allow-env --allow-run ./tools/wpt.ts run --binary=$(which deno) --quiet --release --json=wpt.json --wptreport=wptreport.json || true
- name: Upload wpt results to wpt.fyi
env:
WPT_FYI_STAGING_USER: ${{ secrets.WPT_FYI_STAGING_USER }}
WPT_FYI_STAGING_PW: ${{ secrets.WPT_FYI_STAGING_PW }}
run: |
deno run -A ./tools/upload_wptfyi.js wptreport.json --from-raw-file
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ cli/tests/.test_coverage/
# Flamegraphs
/flamebench*.svg
/flamegraph*.svg

# WPT generated cert files
/tools/wpt/certs/index.txt*
/tools/wpt/certs/serial*
7 changes: 3 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
path = third_party
url = https://github.com/denoland/deno_third_party.git
shallow = true
[submodule "test_util/wpt"]
path = test_util/wpt
url = https://github.com/web-platform-tests/wpt.git
shallow = true
[submodule "test_util/std"]
path = test_util/std
url = https://github.com/denoland/deno_std
shallow = true
[submodule "test_util/wpt"]
path = test_util/wpt
url = https://github.com/web-platform-tests/wpt.git
2 changes: 1 addition & 1 deletion test_util/wpt
Submodule wpt updated 40 files
+37 −0 css/css-multicol/crashtests/multicol-dynamic-contain-crash.html
+13 −0 css/css-sizing/aspect-ratio/select-element-001-ref.html
+20 −0 css/css-sizing/aspect-ratio/select-element-001.html
+1 −0 css/css-transforms/transform3d-sorting-006.html
+11 −0 css/css-writing-modes/crashtests/wm-body-propagation-crash.html
+2 −0 fetch/api/request/request-bad-port.any.js
+16 −0 forced-colors-mode/forced-colors-mode-48-ref.html
+11 −0 forced-colors-mode/forced-colors-mode-48.html
+16 −0 forced-colors-mode/forced-colors-mode-49-ref.html
+11 −0 forced-colors-mode/forced-colors-mode-49.html
+0 −0 html/rendering/the-details-element/summary-display-list-item-001-ref.html
+1 −1 html/rendering/the-details-element/summary-display-list-item-001.html
+13 −0 html/rendering/the-details-element/summary-display-list-item-002-ref.html
+23 −0 html/rendering/the-details-element/summary-display-list-item-002.html
+4 −10 inert/inert-retargeting-iframe.tentative.html
+2 −0 lint.ignore
+1 −1 mathml/META.yml
+43 −0 mediacapture-insertable-streams/MediaStreamTrackProcessor-video.https.html
+32 −16 resource-timing/cors-preflight.any.js
+8 −7 resource-timing/resources/preflight.py
+28 −28 tools/certs/cacert.key
+313 −313 tools/certs/cacert.pem
+26 −26 tools/certs/web-platform.test.key
+195 −195 tools/certs/web-platform.test.pem
+4 −1 tools/mypy.ini
+8 −10 tools/serve/serve.py
+1 −1 tools/serve/test_functional.py
+1 −1 tools/serve/test_serve.py
+4 −1 tools/serve/wave.py
+1 −1 tools/wave/tests/test_wave.py
+1 −1 tools/wpt/tests/test_wpt.py
+1 −1 tools/wptrunner/wptrunner/browsers/base.py
+1 −1 tools/wptrunner/wptrunner/browsers/chrome_spki_certs.py
+1 −1 tools/wptrunner/wptrunner/environment.py
+4 −4 tools/wptrunner/wptrunner/webdriver_server.py
+2 −3 tools/wptserve/wptserve/response.py
+3 −3 tools/wptserve/wptserve/server.py
+2 −0 tools/wptserve/wptserve/utils.py
+1 −1 webauthn/createcredential-badargs-rp.https.html
+2 −0 websockets/Create-blocked-port.any.js
16 changes: 8 additions & 8 deletions tools/wpt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,27 @@ More details at https://deno.land/manual@main/contributing/web_platform_tests
}

async function setup() {
const hostsPath = Deno.build.os == "windows"
? `${Deno.env.get("SystemRoot")}\\System32\\drivers\\etc\\hosts`
: "/etc/hosts";
// TODO(lucacsonato): use this when 1.7.1 is released.
// const records = await Deno.resolveDns("web-platform.test", "A");
// const etcHostsConfigured = records[0] == "127.0.0.1";
const hostsFile = await Deno.readTextFile("/etc/hosts");
const hostsFile = await Deno.readTextFile(hostsPath);
const etcHostsConfigured = hostsFile.includes("web-platform.test");

if (etcHostsConfigured) {
console.log("/etc/hosts is already configured.");
console.log(hostsPath + " is already configured.");
} else {
const autoConfigure = autoConfig ||
confirm(
"The WPT require certain entries to be present in your /etc/hosts file. Should these be configured automatically?",
`The WPT require certain entries to be present in your ${hostsPath} file. Should these be configured automatically?`,
);
if (autoConfigure) {
const proc = runPy(["wpt", "make-hosts-file"], { stdout: "piped" });
const status = await proc.status();
assert(status.success, "wpt make-hosts-file should not fail");
const entries = new TextDecoder().decode(await proc.output());
const hostsPath = Deno.build.os == "windows"
? `${Deno.env.get("SystemRoot")}\\System32\\drivers\\etc\\hosts`
: "/etc/hosts";
const file = await Deno.open(hostsPath, { append: true }).catch((err) => {
if (err instanceof Deno.errors.PermissionDenied) {
throw new Error(
Expand All @@ -116,9 +116,9 @@ async function setup() {
"\n\n# Configured for Web Platform Tests (Deno)\n" + entries,
),
);
console.log("Updated /etc/hosts");
console.log(`Updated ${hostsPath}`);
} else {
console.log("Please configure the /etc/hosts entries manually.");
console.log(`Please configure the ${hostsPath} entries manually.`);
if (Deno.build.os == "windows") {
console.log("To do this run the following command in PowerShell:");
console.log("");
Expand Down
Empty file removed tools/wpt/certs/index.txt
Empty file.
1 change: 0 additions & 1 deletion tools/wpt/certs/serial

This file was deleted.

7 changes: 1 addition & 6 deletions tools/wpt/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"check_subdomains": false,
"ssl": {
"type": "openssl",
"openssl": {
"duration": 365,
"force_regenerate": false,
"base_path": "../../tools/wpt/certs"
}
"type": "pregenerated"
}
}
1 change: 1 addition & 0 deletions tools/wpt/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export async function checkPy3Available() {
}

export async function cargoBuild() {
if (binary) return;
const proc = Deno.run({
cmd: ["cargo", "build", ...(release ? ["--release"] : [])],
cwd: ROOT_PATH,
Expand Down

0 comments on commit f48d66b

Please sign in to comment.