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

A shared testing multi-staging framework #411

Merged
merged 11 commits into from
Feb 6, 2017

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Jan 24, 2017

TL;DR: http://bnjbvr.github.io/wasm-spec/test/out/ (expect failures; harness is a bit broken at the moment)

Some rough explanation there.

Not ready for merge yet:

  • the harness is a bit broken (because of top level calls but also other issues I need to investigate first). Tests not passing in Chromium are mainly the harness failing in a dumb way; in Firefox we've diverged a bit from the spec, so many more failures are expected (a failed compilation or instanciation may lead to a big amount of failures).
  • not sure where to merge it: ideally, it'd be on the gh-pages branch so people can use the landing page there. But the master and gh-pages branches have diverged long time ago on this repository, and my gh-pages branch on my fork is based off this master. Opinions?

@rossberg
Copy link
Member

The way the gh-pages branch is used by GH is very weird -- it requires a structure that is pretty much incompatible with how anybody would want to organise master. So no sources should live there, I think, you only push stuff over (in custom ways) for publishing. At least that's the recommended workflow as I understood it from some tutorials.

On the other hand, the converted JS files should not be checked into master, they only need to exist on the published page. So I think we should have some script for performing the build+publish step, part of which would be (re)generating the converted files.

@jfbastien
Copy link
Member

Can the live pages be part of webassembly.org instead of some github page? @s3ththompson

I'd rather minimize the number of web pages we have. We can squirrel this two levels deep to avoid confusion.

@s3ththompson
Copy link
Member

Yes. We can pull in the source into the webassembly/website the same way we do for the design docs.

If others are on board with this, can you open an issue on the website repo?

@bnjbvr
Copy link
Member Author

bnjbvr commented Jan 26, 2017

Can the live pages be part of webassembly.org instead of some github page?

If we do so, then each new test added by a PR to this repository (be it a wast, JS or HTML) test will need another build / PR to the webassembly.org repository. This sounds like something we'd like to avoid (because of the manual sync need and scattering), ideally, but @rossberg-chromium previous comment about using the master and gh-pages seems to imply the same (modulo we'd need to have 1 PR for each branch, instead of 1 PR per repo).

It sound to me the only way to have a single consistent repository would be having a completely separate repository test, using only on a gh-pages branch (thus browsable at webassembly.org/test, iiuc), but I have heard the intent was to remove repositories, not add any new ones.

@jfbastien
Copy link
Member

I'd like webassembly.org to be automated anyways.

@bnjbvr
Copy link
Member Author

bnjbvr commented Jan 31, 2017

For the sake of simplicity, and after some struggle to respect the order of execution (involving a queue of Promise factories), I've reverted back to using a simple synchronous test harness for the wast harness, since we can now (thanks to the functional run and call abstractions).

To wit: if a module can't be instantiated (because of an impl quirk, for instance), and this module is used in further tests, we have the choice of either not running the further tests using what should be a module, or failing them too. I think the latter is simpler, less error-prone and more explicit, even thought it inflates the number of failures by large factors. Any disagreements?

bnjbvr and others added 10 commits February 1, 2017 18:08
- can compile wast to JS file
- can convert JS files to WPT test cases
- can create a front page with all the JS tests
HTML test cases (in opposition to pure JS test cases) are JS test cases that
need a full browser (DOM) environment. For the sake of example, here is a test
for indexeddb loading and storing a WebAssembly module.
@bnjbvr
Copy link
Member Author

bnjbvr commented Feb 1, 2017

To not block other people from working on these tests, I propose to review and merge this one. Subsequent work will include being able to pass misc command-line options to the build.py script (to build only the front page for webassembly.org, or to build the JS tests or the HTML tests for browser CI, or a combination of these).

@rossberg-chromium @mtrofin, PTAL.

@mtrofin
Copy link
Contributor

mtrofin commented Feb 1, 2017

lgtm

test/README.md Outdated

* [`core/`](core/), tests for the core semantics
* [`js-api/`](js-api/), tests for the JavaScript API
* [`js-api/`](js-api/), tests for the JavaScript API. These tests can be run in
a pure JavaScript environment, that is, a JS shell (like v8 or spidermonkey's
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: V8

test/README.md Outdated

* [`core/`](core/), tests for the core semantics
* [`js-api/`](js-api/), tests for the JavaScript API
* [`js-api/`](js-api/), tests for the JavaScript API. These tests can be run in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd prefer not to front-load the bullet list with too much information. Maybe we should have sections on each one below.

Copy link
Member

@rossberg rossberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Din't look at all the details, but LGTM so far. The only nit I have is the name lib for the infrastructure directory, since test/lib sounds too much like "tests of the library" next to the other dirs. How about util or something else?

@rossberg
Copy link
Member

rossberg commented Feb 3, 2017

Or, in fact, why not simply call the lib dir test/harness?

@bnjbvr
Copy link
Member Author

bnjbvr commented Feb 3, 2017

Or, in fact, why not simply call the lib dir test/harness?

lib/ is often used as a placeholder name in web development for putting utilities, but harness is more descriptive, so I'll take this. Thanks!

@bnjbvr
Copy link
Member Author

bnjbvr commented Feb 3, 2017

Din't look at all the details,

If that can make reviewing easier: from all the files in this PR,

  • testharness.js and testharness.css have been been taken from the WPT repository. testharnessreport.js contains parameters for testharness.js and is very small and contained.
  • wasm-constants and wasm-module-builder have been taken from V8's repository.
  • build.py is likely to change in future PRs to allow building only for the shell, for the WPT, or the front page (since building everything all the time doesn't quite make sense).

@rossberg
Copy link
Member

rossberg commented Feb 3, 2017

Thanks, lgtm

@bnjbvr
Copy link
Member Author

bnjbvr commented Feb 6, 2017

This is ready for merge, whenever everybody is agreeing and comfortable doing so.

@rossberg rossberg merged commit 3d7325a into WebAssembly:master Feb 6, 2017
ngzhian pushed a commit to ngzhian/spec that referenced this pull request Nov 4, 2021
ngzhian added a commit to ngzhian/spec that referenced this pull request Nov 4, 2021
These instructions were added in WebAssembly#381 and WebAssembly#411 respectively.

The binary opcodes for these are still not finalized, I'm using what V8
is using for now.
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Oct 3, 2023
Fix WebAssembly#399 and a couple of other small bugs with conversion to/from JS numbers.
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.

5 participants