jsdom / jsdom

A JavaScript implementation of various web standards, for use with Node.js
MIT License
20.54k stars 1.7k forks source link

New WPT runner design #1958

Open domenic opened 7 years ago

domenic commented 7 years ago

Edit: most of this was taken care of in #1966. What remains is summarized in https://github.com/tmpvar/jsdom/issues/1958#issuecomment-333435727.

Here are the problems I want to solve:

Here's the plan:

The first part of this is mostly working on my local machine, actually. The biggest work is just converting all the lines from our big old JS array into appropriate directory-scoped YAML documents, especially since some new tests have been added to our directories along the way.

Would love any feedback the contributors have!

Zirro commented 7 years ago

This looks like a great improvement over the current system. While it's just a small detail among many good things, as someone who's had to balance quotation marks or insert missing commas one time too many I'm glad you went with YAML for the manifest ;-)

I am currently looking for a WPT-testing solution for css-object-model that I can keep within the repo rather than having to run it through the separate jsdom repository, without necessarily having to duplicate the whole setup.

As part of this overhaul, perhaps it would make sense to move the infrastructure for the runner to a separate package, which jsdom and its various dependencies can require and run their own list of tests through?

I only recently found that you've put together something along these lines before in wpt-runner, though it's not been updated for a while. Could this replace that, perhaps?

domenic commented 7 years ago

Good thinking. It might not be so easy to pull out in the first pass, especially for jsdom itself where the setup code isn't just shimming certain globals. Similarly I'm not sure how you'd envision it working with CSSOM if you wanted to test e.g. <link rel="stylesheet"> parsing. More detail would be helpful.

Zirro commented 7 years ago

I figured that the test runner could allow supplying an instance of jsdom - this repo would use require("../../") with jsdom already located here, while css-object-model could require jsdom as a dependency. Of course, I'd still have to npm link that if I make local changes to jsdom.

domenic commented 7 years ago

Here's what's left after #1966:

TimothyGu commented 7 years ago

Run these tests in the browser!

WPT runner currently uses a custom resource loader. It would probably be easiest if we add some kind of parsing hooks for modifying the URL to fetch.

Run failing tests and check that they still fail. Fail the test run if the expectation is incorrect (i.e if we unexpectedly pass).

:+1:

Add the ability to partially pass a test. Where should we store the information?

The main YAML file sounds fine to me, though I'd argue just knowing when a previously failing test started passing is a more important priority.

Have some way of running the timeout tests and check that they still timeout, maybe? But don't do this by default since it will take a long time?

We can do a cron job or something and run it once a week. Travis CI supports that.