Skip to content

Conversation

@jcscottiii
Copy link
Contributor

@jcscottiii jcscottiii commented Dec 18, 2025

This commit introduces the foundational infrastructure for the WPT manifest to recognize and process Test262 tests. This is the first step towards the goal of running the entire Test262 suite within the WPT infrastructure, as outlined in the approved RFC.

The core of this change is a new TestRecord parser in test262.py which is responsible for extracting the YAML frontmatter from Test262 .js files (similar to how test262 does it using monkeyYaml). This metadata is then used by the manifest generation process to correctly identify and classify the tests.

Key changes included in this commit:

  • A new tools/manifest/test262.py module containing the YAML frontmatter parser.
  • A corresponding Test262Test manifest item type defined in tools/manifest/item.py to represent these tests.
  • Updates to tools/manifest/sourcefile.py to identify Test262 files by their directory path (/test262/) and invoke the new parser.
  • The addition of pyyaml as a project dependency to handle the YAML parsing to tools/wpt/requirements.txt
    • Note to reviewers: PyYaml is lazily loaded. This is to prevent the modification of too many commands.json files. This may not be preferred since WPT does not do that often but open to other options. Please check failing checks for commits on the original PR for how I kept trying to track down the next commands.json file to fix.
  • New unit tests for the parser and the manifest generation logic for Test262 files.

This work is part of the effort to add Test262 support as laid out in the RFC: web-platform-tests/rfcs#229

This commit is the first in a series of smaller PRs split from the larger, original implementation in #55997. Subsequent PRs will add the server-side logic to serve the tests and the wptrunner integration to execute them.

jcscottiii pushed a commit that referenced this pull request Dec 18, 2025
…e tests

This commit completes the core integration of Test262 into the WPT
runner (`wptrunner`), enabling the execution of Test262 JavaScript
conformance tests within the browser environment. This work builds upon
the manifest tooling (PR 1 #56840) and server-side handling (PR 2 #56841) to provide
a full end-to-end testing solution for Test262.

Key components introduced and integrated:
- **Client-Side Harness:** New JavaScript files (`harness-adapter.js`,
  `testharness-client.js`, `testharness.js`) under `resources/test262/`
  provide the necessary environment for Test262 tests to execute in an
  `iframe` and report results back to the main WPT testharness.
- **Test262 Assertion Libraries (Vendored):** For the purpose of enabling these
  initial smoke tests, the standard Test262 assertion libraries (`assert.js`
  and `sta.js`) are directly placed into `third_party/test262/harness/`.
  This provides the immediate dependencies required by the smoke tests.
  An autoamted vendoring solution, including version tracking via
  `vendored.toml`, will be implemented in a subsequent PR focused on
  automated updates, as described in the RFC.
- **Wptrunner Integration:** Modifications to `tools/wptrunner/wpttest.py`
  and `tools/wptrunner/browsers/*.py` enable `wptrunner` to recognize the
  `test262` test type and execute it using existing testharness executors.
- **Smoke Tests and Metadata:** A suite of basic Test262 smoke tests
  (`infrastructure/test262/`) and their corresponding expected results
  (`infrastructure/metadata/infrastructure/test262/`) are added to verify
  the correct functioning of the entire integration.
- **Linting Exemption:** `lint.ignore` is updated to exclude the vendored
  Test262 harness files from linting, respecting their upstream style.

This integration allows browser vendors to run Test262 directly with `wptrunner`,
streamlining conformance testing efforts as specified in the RFC:
web-platform-tests/rfcs#229

This commit is the third in a series of smaller PRs split from the larger,
original implementation in #55997.
@jcscottiii jcscottiii changed the title feat(manifest): Add initial tooling for Test262 test types feat(manifest): Add initial tooling for Test262 test types [pt 1/4] Dec 18, 2025
@jcscottiii jcscottiii changed the title feat(manifest): Add initial tooling for Test262 test types [pt 1/4] feat(manifest): Add initial tooling for Test262 test types [pt 1/5] Dec 18, 2025
jcscottiii pushed a commit that referenced this pull request Dec 18, 2025
…e tests

This commit completes the core integration of Test262 into the WPT
runner (`wptrunner`), enabling the execution of Test262 JavaScript
conformance tests within the browser environment. This work builds upon
the manifest tooling (PR 1 #56840) and server-side handling (PR 2 #56841) to provide
a full end-to-end testing solution for Test262.

Key components introduced and integrated:
- **Client-Side Harness:** New JavaScript files (`harness-adapter.js`,
  `testharness-client.js`, `testharness.js`) under `resources/test262/`
  provide the necessary environment for Test262 tests to execute in an
  `iframe` and report results back to the main WPT testharness.
- **Test262 Assertion Libraries (Vendored):** For the purpose of enabling these
  initial smoke tests, the standard Test262 assertion libraries (`assert.js`
  and `sta.js`) are directly placed into `third_party/test262/harness/`.
  This provides the immediate dependencies required by the smoke tests.
  An autoamted vendoring solution, including version tracking via
  `vendored.toml`, will be implemented in a subsequent PR focused on
  automated updates, as described in the RFC.
- **Wptrunner Integration:** Modifications to `tools/wptrunner/wpttest.py`
  and `tools/wptrunner/browsers/*.py` enable `wptrunner` to recognize the
  `test262` test type and execute it using existing testharness executors.
- **Smoke Tests and Metadata:** A suite of basic Test262 smoke tests
  (`infrastructure/test262/`) and their corresponding expected results
  (`infrastructure/metadata/infrastructure/test262/`) are added to verify
  the correct functioning of the entire integration.
- **Linting Exemption:** `lint.ignore` is updated to exclude the vendored
  Test262 harness files from linting, respecting their upstream style.

This integration allows browser vendors to run Test262 directly with `wptrunner`,
streamlining conformance testing efforts as specified in the RFC:
web-platform-tests/rfcs#229

This commit is the third in a series of smaller PRs split from the larger,
original implementation in #55997.
jcscottiii pushed a commit that referenced this pull request Dec 18, 2025
…e tests

This commit completes the core integration of Test262 into the WPT
runner (`wptrunner`), enabling the execution of Test262 JavaScript
conformance tests within the browser environment. This work builds upon
the manifest tooling (PR 1 #56840) and server-side handling (PR 2 #56841) to provide
a full end-to-end testing solution for Test262.

Key components introduced and integrated:
- **Client-Side Harness:** New JavaScript files (`harness-adapter.js`,
  `testharness-client.js`, `testharness.js`) under `resources/test262/`
  provide the necessary environment for Test262 tests to execute in an
  `iframe` and report results back to the main WPT testharness.
- **Test262 Assertion Libraries (Vendored):** For the purpose of enabling these
  initial smoke tests, the standard Test262 assertion libraries (`assert.js`
  and `sta.js`) are directly placed into `third_party/test262/harness/`.
  This provides the immediate dependencies required by the smoke tests.
  An autoamted vendoring solution, including version tracking via
  `vendored.toml`, will be implemented in a subsequent PR focused on
  automated updates, as described in the RFC.
- **Wptrunner Integration:** Modifications to `tools/wptrunner/wpttest.py`
  and `tools/wptrunner/browsers/*.py` enable `wptrunner` to recognize the
  `test262` test type and execute it using existing testharness executors.
- **Smoke Tests and Metadata:** A suite of basic Test262 smoke tests
  (`infrastructure/test262/`) and their corresponding expected results
  (`infrastructure/metadata/infrastructure/test262/`) are added to verify
  the correct functioning of the entire integration.
- **Linting Exemption:** `lint.ignore` is updated to exclude the vendored
  Test262 harness files from linting, respecting their upstream style.

This integration allows browser vendors to run Test262 directly with `wptrunner`,
streamlining conformance testing efforts as specified in the RFC:
web-platform-tests/rfcs#229

This commit is the third in a series of smaller PRs split from the larger,
original implementation in #55997.
This commit introduces the foundational infrastructure for the WPT manifest
to recognize and process Test262 ECMA-262 conformance tests. This is
the first step towards the goal of running the entire Test262 suite
within the WPT infrastructure, as outlined in the approved RFC.

The core of this change is a new `TestRecord` parser in `test262.py`
which is responsible for extracting the YAML frontmatter from Test262
`.js` files. This metadata is then used by the manifest generation
process to correctly identify and classify the tests.

Key changes included in this commit:
- A new `tools/manifest/test262.py` module containing the YAML
  frontmatter parser.
- A corresponding `Test262Test` manifest item type defined in
  `tools/manifest/item.py` to represent these tests.
- Updates to `tools/manifest/sourcefile.py` to identify Test262 files
  by their directory path (`/test262/`) and invoke the new parser.
- The addition of `pyyaml` as a project dependency to handle the YAML
  parsing to tools/wpt/requirements.txt
  - **Note to reviewers:**  PyYaml is lazily loaded. This is to prevent
    the modification of too many commands.json files. This may not be
    preferred since WPT does not do that often but open to other
    options. Please check failing checks for commits on the original PR
    for how I kept trying to track down the next commands.json file to
    fix.
- New unit tests for the parser and the manifest generation logic for
  Test262 files.

This work is part of the effort to add Test262 support as laid out in
the RFC: web-platform-tests/rfcs#229

This commit is the first in a series of smaller PRs split from the larger,
original implementation in #55997.
Subsequent PRs will add the server-side logic to serve the tests and the
wptrunner integration to execute them.
@jcscottiii jcscottiii force-pushed the feat/test262-manifest-tooling branch from ad5fa6b to 72ff9c7 Compare December 18, 2025 14:01
jcscottiii added a commit that referenced this pull request Dec 18, 2025
…e tests

This commit completes the core integration of Test262 into the WPT
runner (`wptrunner`), enabling the execution of Test262 JavaScript
conformance tests within the browser environment. This work builds upon
the manifest tooling (PR 1 #56840) and server-side handling (PR 2 #56841) to provide
a full end-to-end testing solution for Test262.

Key components introduced and integrated:
- **Client-Side Harness:** New JavaScript files (`harness-adapter.js`,
  `testharness-client.js`, `testharness.js`) under `resources/test262/`
  provide the necessary environment for Test262 tests to execute in an
  `iframe` and report results back to the main WPT testharness.
- **Test262 Assertion Libraries (Vendored):** For the purpose of enabling these
  initial smoke tests, the standard Test262 assertion libraries (`assert.js`
  and `sta.js`) are directly placed into `third_party/test262/harness/`.
  This provides the immediate dependencies required by the smoke tests.
  An autoamted vendoring solution, including version tracking via
  `vendored.toml`, will be implemented in a subsequent PR focused on
  automated updates, as described in the RFC.
- **Wptrunner Integration:** Modifications to `tools/wptrunner/wpttest.py`
  and `tools/wptrunner/browsers/*.py` enable `wptrunner` to recognize the
  `test262` test type and execute it using existing testharness executors.
- **Smoke Tests and Metadata:** A suite of basic Test262 smoke tests
  (`infrastructure/test262/`) and their corresponding expected results
  (`infrastructure/metadata/infrastructure/test262/`) are added to verify
  the correct functioning of the entire integration.
- **Linting Exemption:** `lint.ignore` is updated to exclude the vendored
  Test262 harness files from linting, respecting their upstream style.

This integration allows browser vendors to run Test262 directly with `wptrunner`,
streamlining conformance testing efforts as specified in the RFC:
web-platform-tests/rfcs#229

This commit is the third in a series of smaller PRs split from the larger,
original implementation in #55997.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants