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

Support running just the server component standalone #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dpogue
Copy link

@dpogue dpogue commented Oct 4, 2019

Separates the server for the WPT files into its own component that can be run standalone for debugging tests in a web browser.

Also introduces a wpt-server command to run the server standalone:

$ node bin/wpt-server.js --help
Serves the web platform tests at the given path, e.g. wpt/dom/nodes/

wpt-server.js <path> [--root-url=<url/of/tests/>] [--port=<number>]

Options:
  --help          Show help                                                       [boolean]
  --version       Show version number                                             [boolean]
  --root-url, -u  The relative URL path for the tests at <path>, e.g. dom/nodes/  [string]
  --port, -p      The port number on which to run the server, e.g. 8000           [number]

@domenic
Copy link
Owner

domenic commented Oct 5, 2019

Can you say more about the motivation for this, or where you are using this project? I am not super-excited about duplicating the canonical wpt serve... we're mostly using this to test the Streams Standard at this point, due to a series of past decisions which at this point I'd consider tech debt, and not something to be emulated.

@dpogue
Copy link
Author

dpogue commented Oct 5, 2019

My use case is probably exactly what you're wanting to avoid, and I don't actually disagree on that point. 😛

I'm trying to write a polyfill for the <dialog> element and want to run it against the WPT dialog tests. However, I need to modify them such that my polyfill is always loaded in each test case.

I did look into trying to use the wpt tool, but the documentation isn't great and I struggled to get the python environment set up and couldn't find a way to use it as a dependency of a project for something like npm test. This project, by comparison, is just a standard npm package that integrates well with the node environment that someone would already have set up to work on the polyfill.

Unfortunately, in my case, there are some subtleties of JSDom behaviour that are causing race conditions between my polyfill loading and the tests trying to open dialogs, so I wanted a way to run just the server so that I could open the tests in various browsers and manually test myself.

If you know of any projects that have the wpt tool set up as part of their CI workflow, I'd love to take a look and see if I can do the same.

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