diff options
author | Luca Casonato <hello@lcas.dev> | 2021-06-14 13:48:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-14 13:48:57 +0200 |
commit | d837445e44c9ed5c29901813d73818f84e97b294 (patch) | |
tree | da40539191c48bee852b7b500f070558db00307e /tools | |
parent | a6f1edd9533ae52f6d7c4841c395a34021dbdb71 (diff) |
build: add wpt epoch/daily run (#10937)
This adds a daily scheduled CI pipeline that runs WPT tests against
the most recent epochs/daily every night. Results are uploaded to
wpt.fyi.
WPTs are run on all supported platforms, on both stable and canary.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/upload_wptfyi.js | 23 | ||||
-rw-r--r-- | tools/wpt/runner.ts | 4 | ||||
-rw-r--r-- | tools/wpt/utils.ts | 16 |
3 files changed, 30 insertions, 13 deletions
diff --git a/tools/upload_wptfyi.js b/tools/upload_wptfyi.js index 2eb4dcefa..862523167 100644 --- a/tools/upload_wptfyi.js +++ b/tools/upload_wptfyi.js @@ -2,14 +2,28 @@ // passed, will automatically add a status check to the commit with a link to // the wpt.fyi page. +import { gzip } from "https://deno.land/x/compress@v0.3.8/gzip/mod.ts"; + const user = Deno.env.get("WPT_FYI_STAGING_USER"); const password = Deno.env.get("WPT_FYI_STAGING_PW"); -const commit = Deno.args[0]; +const fromRawFile = Deno.args.includes("--from-raw-file"); const form = new FormData(); -form.set("labels", "experimental"); -form.set("result_url", `https://dl.deno.land/wpt/${commit}-wptreport.json.gz`); +form.set("labels", "master,actions"); + +if (fromRawFile) { + const file = Deno.args[0]; + const raw = Deno.readFileSync(file); + const gzipped = gzip(raw); + form.set("result_file", new Blob([gzipped])); +} else { + const commit = Deno.args[0]; + form.set( + "result_url", + `https://dl.deno.land/wpt/${commit}-wptreport.json.gz`, + ); +} const basicAuthToken = btoa(`${user}:${password}`); @@ -30,10 +44,11 @@ if (!resp.ok) { Deno.exit(1); } -if (Deno.args.includes("--ghstatus")) { +if (!fromRawFile && Deno.args.includes("--ghstatus")) { const githubToken = Deno.env.get("GITHUB_TOKEN"); const taskId = body.split(" ")[1]; const url = `https://staging.wpt.fyi/results/?run_id=${taskId}`; + const commit = Deno.args[0]; const resp = await fetch( `https://api.github.com/repos/denoland/deno/statuses/${commit}`, { diff --git a/tools/wpt/runner.ts b/tools/wpt/runner.ts index 0cf625f01..3eb476fc9 100644 --- a/tools/wpt/runner.ts +++ b/tools/wpt/runner.ts @@ -1,6 +1,6 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. import { delay, join, readLines, ROOT_PATH, toFileUrl } from "../util.js"; -import { assert, ManifestTestOptions, release, runPy } from "./utils.ts"; +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"; export async function runWithTestUtil<T>( @@ -88,7 +88,7 @@ export async function runSingleTest( const proc = Deno.run({ cmd: [ - join(ROOT_PATH, `./target/${release ? "release" : "debug"}/deno`), + denoBinary(), "run", "-A", "--unstable", diff --git a/tools/wpt/utils.ts b/tools/wpt/utils.ts index 3b1eb9965..0eb9a89e7 100644 --- a/tools/wpt/utils.ts +++ b/tools/wpt/utils.ts @@ -12,13 +12,19 @@ export const { rebuild, ["--"]: rest, ["auto-config"]: autoConfig, + binary, } = parse(Deno.args, { "--": true, boolean: ["quiet", "release", "no-interactive"], - string: ["json", "wptreport"], + string: ["json", "wptreport", "binary"], }); -/// PAGE ROOT +export function denoBinary() { + if (binary) { + return binary; + } + return join(ROOT_PATH, `./target/${release ? "release" : "debug"}/deno`); +} /// WPT TEST MANIFEST @@ -164,11 +170,7 @@ export async function generateRunInfo(): Promise<unknown> { const revision = (new TextDecoder().decode(await proc.output())).trim(); proc.close(); const proc2 = Deno.run({ - cmd: [ - join(ROOT_PATH, `./target/${release ? "release" : "debug"}/deno`), - "eval", - "console.log(JSON.stringify(Deno.version))", - ], + cmd: [denoBinary(), "eval", "console.log(JSON.stringify(Deno.version))"], cwd: join(ROOT_PATH, "test_util", "wpt"), stdout: "piped", }); |