Add pinned WPT source preparation - #630
Merged
Merged
Conversation
This was referenced Aug 21, 2026
andrewiggins
force-pushed
the
wpt-runner-source-preparation
branch
from
August 21, 2026 17:15
6f1c4f4 to
4958fdf
Compare
andrewiggins
marked this pull request as ready for review
August 21, 2026 20:36
This was referenced Aug 21, 2026
andrewiggins
force-pushed
the
wpt-runner-source-preparation
branch
from
August 26, 2026 01:13
120a9f4 to
358200c
Compare
andrewiggins
force-pushed
the
wpt-runner-source-preparation
branch
from
August 26, 2026 01:14
358200c to
a7e6b31
Compare
marvinhagemeister
approved these changes
Aug 26, 2026
andrewiggins
added a commit
that referenced
this pull request
Aug 31, 2026
## Summary This PR is 2 of 3 (#630, #632) that adds a Web Platform Test runner to this repo, so we can validate our polyfills spec compliance against that test suite. This PR contains the actual runner that executes the WPT test (`main.ts`). It's a webpage (`index.html`) that creates a Web Worker (`run-worker.ts`), loads our DOM polyfill into that worker (`worker.ts`), and parses the WPT test into JS instructions (`adapter.ts`) that it executes in that worker with the DOM polyfill. It uses the WPT test harness to execute the test inside the worker and get the results. Specifically, this PR: - securely serve prepared WPT files with canonical path and symlink containment - adapt supported top-level HTML/SVG markup and classic scripts into generated source - execute each selected file in a fresh worker and polyfill `Window` - keep results on a private transferred `MessagePort` - make the first terminal event final and always clean up the worker - block worker networking and nested workers with a worker-specific CSP - provide an interactive page for running tests and inspecting source and results ## Stacked dependency This PR is stacked on `wpt-runner-source-preparation`, which prepares and validates the pinned WPT checkout. ## Executable outcome Run `pnpm wpt:dev`, enter a WPT path, and inspect the result, warnings, console output, original markup, harness source, and generated source. This PR intentionally does not add capability policy, Playwright CLI automation, or WPT CI. ## Changeset An empty changeset records that this private test infrastructure releases no public package. Squashed commit messages: * Add secure WPT serving and adaptation * Add isolated WPT worker execution * Document the interactive WPT runner * Migrate WPT development launcher to TypeScript * Document WPT runner orchestration * Align WPT runner with repository tooling
andrewiggins
added a commit
that referenced
this pull request
Aug 31, 2026
## Summary This PR is 3 of 3 (#630, #631) that adds a Web Platform Test runner to this repo, so we can validate our polyfills spec compliance against that test suite. This PR adds a CLI to run the webpage from the previous PR in playwright. It also adds a way to specify which tests in WPT are expected to pass/fail, and why (if failure). So overtime we can document behaviors we support, ones we don't support *yet*, and which ones we explicitly don't want to support. Specifically, this PR: - add a canonical TSV inventory of supported and deferred WPT cases - reject supported failures, missing results, unlisted results, duplicates, harness errors, worker errors, and timeouts - report passing deferred cases as promotion candidates - add a Playwright CLI that reuses one control page while creating a fresh worker per file - add a dedicated cached WPT CI job ## Stacked dependency This PR is stacked on `wpt-runner-interactive`, which provides secure serving and isolated worker execution. ## Executable outcome Run `pnpm test:wpt` to execute every classified path and enforce the complete capability table. Use explicit paths for exploratory execution and `--capabilities` to enforce selected classified paths. ## Changeset An empty changeset records that this private test infrastructure releases no public package. Squashed commit messages: * Add WPT capability enforcement * Run WPT capabilities in CI * Migrate WPT capability scripts to TypeScript * Enforce native TypeScript syntax for WPT runner * Separate WPT runner TypeScript environments * Enforce isolated declarations for WPT capability runner * Document WPT capability runner functions * Align WPT capability runner tooling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is 1 of 3 (#631, #632) that adds a Web Platform Test runner to this repo, so we can validate our polyfills spec compliance against that test suite.
This PR focuses on just downloading an archive of the WPT repo we can use to read test files. Future PRs setup the runner to execute them against our DOM polyfills. Since we are on NodeJS 24, all scripts are written in TypeScript and executed directly in Node.
Specifically, this PR:
Executable outcome
Run
pnpm wpt:prepareto prepare or reuse the verified checkout. SetWPT_ROOTto use an existing checkout orWPT_CACHE_DIRto override the cache.This PR does not add Vite, browser serving, WPT execution, capability claims, or CI.
Validation
pnpm run lintpnpm run type-checkpnpm exec vitest runpnpm wpt:prepareChangeset
An empty changeset records that this private test infrastructure releases no public package.