mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
tests: fix wpt epoch ci job (#10960)
This commit is contained in:
parent
c651757fb7
commit
f48d66b2b0
9 changed files with 29 additions and 23 deletions
14
.github/workflows/wpt_epoch.yml
vendored
14
.github/workflows/wpt_epoch.yml
vendored
|
@ -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
|
||||
|
@ -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'
|
||||
|
@ -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
.gitignore
vendored
4
.gitignore
vendored
|
@ -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
.gitmodules
vendored
7
.gitmodules
vendored
|
@ -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
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 146f12e8df2cac6b1e60152145124a81dad60d38
|
||||
Subproject commit a8e5772a0f1c4d666acc5aee2423c38da7c9a71c
|
16
tools/wpt.ts
16
tools/wpt.ts
|
@ -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(
|
||||
|
@ -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("");
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
026677
|
|
@ -1,11 +1,6 @@
|
|||
{
|
||||
"check_subdomains": false,
|
||||
"ssl": {
|
||||
"type": "openssl",
|
||||
"openssl": {
|
||||
"duration": 365,
|
||||
"force_regenerate": false,
|
||||
"base_path": "../../tools/wpt/certs"
|
||||
}
|
||||
"type": "pregenerated"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue