-
Notifications
You must be signed in to change notification settings - Fork 413
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
wasm-pack test <extra_options> does not work as expected #698
Comments
Added reproduction https://github.com/alexlapa/wasm-pack-698-reproduction |
yes, this is an annoying bug. |
@ashleygwilliams is the label |
I am using it with [target.wasm32-unknown-unknown]
runner = 'wasm-bindgen-test-runner'
Update: sorry for the confusion. I just tested it again and it seems to be working with both Update 2: I know what happened now. It doesn't combine with |
Retested reproduction with latest wasm-pack (0.9.1), it is still reproducible.
It also prints full command:
So features are not propagated properly. |
strange:
This is version:
|
@alexlapa I had a look at your reproduction case. It will work as expected if you add this line to the top of your integration test: #![cfg(feature = "some_feature")] This will indicate that this test file requires the feature. It will be excluded when running I also checked |
Isn't that even the behaviour as declared in the command help? It says:
So it explicity tells the user that these extra arguments get passed to |
|
I had a look into this a bit deeper. The code responsible comes from here: #525 Right now everything after Trying to solve the issue raises the question as to why we run
I don't quite understand why this is necessary and why this requirement is not met by just running So I can imagine 3 solutions here:
|
I checked the integration tests of |
Turns out it wasn't a hassle -- it's only called in one place in the repository. |
It would be cool to have this functionality |
🐛 Bug description
wasm-pack test
does not pass <extra_options> tocargo build --tests --target wasm32-unknown-unknown
.🤔 Expected Behavior
should invoke
👟 Steps to reproduce
Running
Causes error during tested crate compilation, since
some_feature
is not enabled.Last log entry:
However, running:
works.
Code example: https://github.com/alexlapa/wasm-pack-698-reproduction
Possible solution
It seems to me that there is no reason to run
cargo build --tests --target wasm32-unknown-unknown
when runningwasm-pack test
.wasm-pack test
will runwasm-bindgen-test
, which will runcargo test
, which will runcargo build --tests
correctly propagating all extra options.i.e. you can just remove step_build_tests
🌍 Your environment
wasm-pack version: 0.8.1
rustc version: 1.36.0 (a53f9df32 2019-07-03)
The text was updated successfully, but these errors were encountered: