-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add a wasm-pack test
subcommand
#271
Conversation
a7dc79b
to
a6ad544
Compare
@mgattozzi I think this is ready for review to start. Still todo:
|
Laying out some infra for properly downloading, un-gzipping, and untaring in #273 Will rebase on that to make use of it once that merges |
Working on it 👍 |
c4bc8f0
to
031d70e
Compare
All that is left is
|
ffbff90
to
238781c
Compare
Ok, I think this is ready for review! @mgattozzi @ashleygwilliams whoever wants to take this on, it is a little bit of a behemoth, sorry :-p I'd like to merge this fairly soon, just so that I don't have to keep rebasing. |
238781c
to
a4013f4
Compare
wasm-pack test
subcommandwasm-pack test
subcommand
Hrmmm still getting some windows failures in appveyor:
|
a4013f4
to
6ec0d1a
Compare
Pretty sure this is because of the |
57a4cfd
to
db86bb5
Compare
This is a wrapper over `cargo test --target wasm32-unknown-unknown` and the `wasm-bindgen-test` crate. It will run tests in both node and browsers using WebDriver clients. Fixes rustwasm#248
db86bb5
to
041438e
Compare
CI is green! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok! this took me nearly an hour to review- but YAY nice work.
so overall the comments are nits with a few reminders to add some stuff we discussed in IRC. overall- if at all possible, i'd like to see the larger functions in the binary fetching and some of the test functions be made into smaller functions. additionally- i think it'd be nice to see some unit tests for those, and making them smaller will make them way easier to test :) in the long run it might actually make much more sense for the binary fetching to be it's own crate, but we don't have to necessarily decide that right now. great work and just ping me when the PR is updated!
@@ -1,14 +1,17 @@ | |||
install: | |||
- ps: Install-Product node 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not entirely sure how this works, but we might want to use a node version manager for this as well? there are windows ones, last time i tried (admittedly a while ago), i like nodist (which now that i link to it looks like it needs a maintainer...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd also like to not hardcode a version but specify LTS, not sure how Install Product
works, but if we switched to a version manager i'm sure we could
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, Install-Product
cannot do LTS.
As for using a node version manager, I'd like to punt on that until if/when it becomes an issue, unless you feel strongly about it. Tinkering with CI for a different OS is not fun...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing! i think that makes sense
.travis.yml
Outdated
rustup target add wasm32-unknown-unknown | ||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash | ||
source ~/.nvm/nvm.sh | ||
nvm install v10.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using a hardcoded version, we could use LTS... nvm support page is here: https://github.com/creationix/nvm#long-term-support
nvm install lts
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
wasm-bindgen = "0.2.17" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hardcoding wasm-bindgen version has proved to be a mess for us before- probably want to use "0.2"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be hard coded until we support reading from the Cargo.lock
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this says test fail, but this test looks as though it should pass....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this was the default cargo project, and I'll remove it. The important part is in tests/
4053222
to
ccc2158
Compare
ccc2158
to
dab809d
Compare
Thanks for the review -- I think this is ready for another round!
Done!
We have tests that we can download teh binaries and unpack them -- did you want tests for isolated parts of that? Like the string interpolation that does URL construction? If you're unsatisfied with this new iteration, then some more specific requests along this line would be appreciated :) |
dab809d
to
8f40e5d
Compare
Oh no, something happened with rebasing/merging and everything got lost :-p Time to dig into the reflog. |
8f40e5d
to
dab809d
Compare
Ok, this has the up-to-date changes again, but I somehow accidentally squashed a bunch of work into a merge commit (that is somehow authored by you, @ashleygwilliams??) and I can't figure out how to pull that apart without losing a bunch of the review fixups. So this is the weird history it has now, I guess.... |
i am so confused about what happened here... anyways, will give this a review later today! |
btw, I've added some docs for |
@@ -0,0 +1,215 @@ | |||
//! Utilities for finding and installing binaries that we depend on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's land this but open an isue to potentially move it out. i could see it being useful for other CLI projects potentially (might even want to add it to cargo at somepoint?)
let output = { | ||
let mut cmd = Command::new("cargo"); | ||
cmd.current_dir(path) | ||
.arg("+nightly") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to be forcing nightly here? there's an issue open about forcing nightly- im' happy to keep this for now but then review it with that issue later?
r+ from me once the rebase happens :) |
Moved to #306 |
Still need to write some tests and figure out how to get CI integration working.