Skip to content

Add pinned WPT source preparation - #630

Merged
andrewiggins merged 4 commits into
mainfrom
wpt-runner-source-preparation
Aug 27, 2026
Merged

Add pinned WPT source preparation#630
andrewiggins merged 4 commits into
mainfrom
wpt-runner-source-preparation

Conversation

@andrewiggins

@andrewiggins andrewiggins commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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:

  • add a private workspace package for preparing upstream Web Platform Test sources
  • pin the WPT revision and archive SHA-256 checksum
  • validate archive paths and links before extraction
  • publish revision-addressed caches atomically
  • serialize concurrent preparation with abandoned-lock recovery

Executable outcome

Run pnpm wpt:prepare to prepare or reuse the verified checkout. Set WPT_ROOT to use an existing checkout or WPT_CACHE_DIR to override the cache.

This PR does not add Vite, browser serving, WPT execution, capability claims, or CI.

Validation

  • pnpm run lint
  • pnpm run type-check
  • pnpm exec vitest run
  • pnpm wpt:prepare

Changeset

An empty changeset records that this private test infrastructure releases no public package.

@andrewiggins
andrewiggins force-pushed the wpt-runner-source-preparation branch from 358200c to a7e6b31 Compare August 26, 2026 01:14
@andrewiggins
andrewiggins merged commit bccc838 into main Aug 27, 2026
6 checks passed
@andrewiggins
andrewiggins deleted the wpt-runner-source-preparation branch August 27, 2026 22:46
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants