diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 406d1bf2e8..9826293bd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -316,7 +316,19 @@ jobs: if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test' && matrix.profile == 'release' 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 --quiet --release + deno run --unstable --allow-write --allow-read --allow-net --allow-env --allow-run ./tools/wpt.ts run --quiet --release --json=wpt.json + + - name: Upload wpt results to dl.deno.land + if: | + runner.os == 'Linux' && + matrix.kind == 'test' && + matrix.profile == 'release' && + github.repository == 'denoland/deno' && + github.ref == 'refs/heads/main' + run: | + gsutil cp ./wpt.json gs://dl.deno.land/wpt/$(git rev-parse HEAD).json + echo $(git rev-parse HEAD) > wpt-latest.txt + gsutil cp wpt-latest.txt gs://dl.deno.land/wpt-latest.txt - name: Run web platform tests (debug) if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test' && matrix.profile == 'debug' diff --git a/tools/wpt.ts b/tools/wpt.ts index 13f8b64673..203b198d17 100755 --- a/tools/wpt.ts +++ b/tools/wpt.ts @@ -165,7 +165,7 @@ async function run() { const result = await runSingleTest( test.url, test.options, - json ? () => {} : createReportTestCase(test.expectation), + createReportTestCase(test.expectation), ); results.push({ test, result }); reportVariation(result, test.expectation); @@ -175,7 +175,21 @@ async function run() { }); if (json) { - await Deno.writeTextFile(json, JSON.stringify(results)); + const minifiedResults = []; + for (const result of results) { + const minified = { + file: result.test.path, + name: + Object.fromEntries(result.test.options.script_metadata ?? []).title ?? + null, + cases: result.result.cases.map((case_) => ({ + name: case_.name, + passed: case_.passed, + })), + }; + minifiedResults.push(minified); + } + await Deno.writeTextFile(json, JSON.stringify(minifiedResults)); } const code = reportFinal(results); Deno.exit(code); diff --git a/tools/wpt/utils.ts b/tools/wpt/utils.ts index 6d982068bb..cb454300b7 100644 --- a/tools/wpt/utils.ts +++ b/tools/wpt/utils.ts @@ -38,7 +38,8 @@ export type ManifestTestVariation = [ options: ManifestTestOptions, ]; export interface ManifestTestOptions { - name?: string; + // deno-lint-ignore camelcase + script_metadata: [string, string][]; } const MANIFEST_PATH = join(ROOT_PATH, "./tools/wpt/manifest.json");