You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a procedural macro crate, using a decorator like #[cfg(debug_assertions)] in the macro and [profile.test] in Cargo.toml to modify the configuration appears to result in the configuration being ignored by wasm-pack test, but not by cargo test. When I originally opened this I did not realize what was going on and that it's specific to the procedural macro use case, so this might be very limited to what I am doing. To be honest I still don't really understand what's going on. On writing out steps to reproduce, I'm thinking that wasm-pack test builds twice, and I guess the first time doesn't use the test profile, and that the extra output I see is a result of that. cargo test only builds the test target, so I don't see any output I'm not expecting. I guess this can be closed, or linked as support for not building twice in tests, if there's any discussion on that? I can work around this with --release for my use case.
🤔 Expected Behavior
I am expecting wasm-pack test --headless --firefox to build/run my tests and use the test profile to configure the build, including at the time that the procedural macro is run.
With this setup, wasm-pack test --headless --firefox prints "1" and "2" and then "2" again. cargo test just prints "2", as I would expect.
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.10.3
rustc version: 1.63.0 (4b91a6ea7 2022-08-08)
The text was updated successfully, but these errors were encountered:
skondrashov
changed the title
wasm-pack test ignores [profile.test] in Cargo.toml
wasm-pack test appears to ignore [profile.test] in Cargo.toml in procedural macro invocations
Sep 8, 2022
🐛 Bug description
In a procedural macro crate, using a decorator like
#[cfg(debug_assertions)]
in the macro and[profile.test]
in Cargo.toml to modify the configuration appears to result in the configuration being ignored bywasm-pack test
, but not bycargo test
. When I originally opened this I did not realize what was going on and that it's specific to the procedural macro use case, so this might be very limited to what I am doing. To be honest I still don't really understand what's going on. On writing out steps to reproduce, I'm thinking thatwasm-pack test
builds twice, and I guess the first time doesn't use the test profile, and that the extra output I see is a result of that.cargo test
only builds the test target, so I don't see any output I'm not expecting. I guess this can be closed, or linked as support for not building twice in tests, if there's any discussion on that? I can work around this with--release
for my use case.🤔 Expected Behavior
I am expecting
wasm-pack test --headless --firefox
to build/run my tests and use the test profile to configure the build, including at the time that the procedural macro is run.👟 Steps to reproduce
lib.rs:
tests/test.rs:
Cargo.toml:
With this setup,
wasm-pack test --headless --firefox
prints "1" and "2" and then "2" again.cargo test
just prints "2", as I would expect.🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.10.3
rustc version: 1.63.0 (4b91a6ea7 2022-08-08)
The text was updated successfully, but these errors were encountered: