Skip to content

Commit 70b2710

Browse files
authored
Fix testing wiggle and wiggle-test in isolation (#12286)
* Migrate wiggle and wiggle generate to `wasmtime::error` * Fix testing `wiggle` and `wiggle-test` in isolation When doing plain old `cargo test -p wiggle` (or `wiggle-test`) the test would fail due to linking errors because Wasmtime's `std` cargo feature (and maybe others) wasn't being enabled. The crate's tests would pass when run as part of the whole workspace, however, because of cargo feature resolution and other crates that enabled the necessary features, which is why CI is green.
1 parent fce1739 commit 70b2710

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/wiggle/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ wasmtime-environ = { workspace = true }
2727
wiggle-test = { path = "test-helpers" }
2828
proptest = "1.0.0"
2929
tokio = { version = "1", features = ["rt-multi-thread","time", "macros"] }
30-
wasmtime = { workspace = true }
30+
# Explicitly enable default features so that tests pass even testing only this
31+
# crate in isolation and we can't accidentally rely on cargo feature resolution
32+
# to enable the runtime and compiler.
33+
wasmtime = { workspace = true, features = ["default"] }
3134

3235
[[test]]
3336
name = "atoms_async"

crates/wiggle/test-helpers/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ thiserror = { workspace = true }
2525
tracing = { workspace = true }
2626
tracing-subscriber = { version = "0.3.1", default-features = false, features = ['fmt'] }
2727
env_logger = { workspace = true }
28+
# Explicitly enable default features so that tests pass even testing only this
29+
# crate in isolation and we can't accidentally rely on cargo feature resolution
30+
# to enable the runtime and compiler.
31+
wasmtime = { workspace = true, features = ["default"] }

0 commit comments

Comments
 (0)