Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: automate WPT updates with drivers in test/wpt #24035

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,9 @@ test-debug: test-build
test-message: test-build
$(PYTHON) tools/test.py $(PARALLEL_ARGS) message

test-wpt: all
watilde marked this conversation as resolved.
Show resolved Hide resolved
$(PYTHON) tools/test.py $(PARALLEL_ARGS) wpt

test-simple: | cctest bench-addons-build # Depends on 'all'.
$(PYTHON) tools/test.py $(PARALLEL_ARGS) parallel sequential

Expand Down
23 changes: 1 addition & 22 deletions doc/guides/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,27 +310,7 @@ functions worked correctly with the `beforeExit` event, then it might be named

### Web Platform Tests

Some of the tests for the WHATWG URL implementation (named
`test-whatwg-url-*.js`) are imported from the [Web Platform Tests Project][].
These imported tests will be wrapped like this:

```js
/* The following tests are copied from WPT. Modifications to them should be
upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-stringifier.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/
/* eslint-disable */

// Test code

/* eslint-enable */
```

To improve tests that have been imported this way, please send
a PR to the upstream project first. When the proposed change is merged in
the upstream project, send another PR here to update Node.js accordingly.
Be sure to update the hash in the URL following `WPT Refs:`.
See [`test/wpt`](../../test/wpt/README.md) for more information.

## C++ Unit test

Expand Down Expand Up @@ -418,7 +398,6 @@ To generate a test coverage report, see the

[ASCII]: http://man7.org/linux/man-pages/man7/ascii.7.html
[Google Test]: https://github.com/google/googletest
[Web Platform Tests Project]: https://github.com/w3c/web-platform-tests/tree/master/url
[`common` module]: https://github.com/nodejs/node/blob/master/test/common/README.md
[all maintained branches]: https://github.com/nodejs/lts
[node.green]: http://node.green/
Expand Down
21 changes: 15 additions & 6 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -770,12 +770,19 @@ Deletes and recreates the testing temporary directory.

## WPT Module

The wpt.js module is a port of parts of
[W3C testharness.js](https://github.com/w3c/testharness.js) for testing the
Node.js
[WHATWG URL API](https://nodejs.org/api/url.html#url_the_whatwg_url_api)
implementation with tests from
[W3C Web Platform Tests](https://github.com/w3c/web-platform-tests).
### harness

A legacy port of [Web Platform Tests][] harness.

See the source code for definitions. Please avoid using it in new
code - the current usage of this port in tests is being migrated to
the original WPT harness, see [the WPT tests README][].

### Class: WPTRunner

A driver class for running WPT with the WPT harness in a vm.

See [the WPT tests README][] for details.


[<Array>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
Expand All @@ -790,3 +797,5 @@ implementation with tests from
[`hijackstdio.hijackStdErr()`]: #hijackstderrlistener
[`hijackstdio.hijackStdOut()`]: #hijackstdoutlistener
[internationalization]: https://github.com/nodejs/node/wiki/Intl
[Web Platform Tests]: https://github.com/web-platform-tests/wpt
[the WPT tests README]: ../wpt/README.md
Loading