Skip to content

Commit

Permalink
Make sure our test features depend on their dependencies test features (
Browse files Browse the repository at this point in the history
#2627)

## Motivation

Currently our `test` features are not necessarily depending on the `test` features from the crate's dependencies

## Proposal

Fix that and make sure our `test` feature depends on the `test` feature from our dependencies

## Test Plan

CI

## Release Plan

- Nothing to do / These changes follow the usual release cycle.
  • Loading branch information
Andre da Silva authored Oct 16, 2024
1 parent 7be4931 commit 8765058
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 11 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion linera-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ repository.workspace = true
version.workspace = true

[features]
test = ["tokio/macros", "linera-base/test", "linera-execution/test"]
test = [
"tokio/macros",
"linera-base/test",
"linera-execution/test",
"linera-views/test",
]
metrics = ["prometheus", "linera-views/metrics", "linera-execution/metrics"]
web = ["linera-base/web", "linera-views/web", "linera-execution/web"]

Expand All @@ -35,7 +40,10 @@ tracing.workspace = true
[dev-dependencies]
assert_matches.workspace = true
bcs.workspace = true
linera-base = { workspace = true, features = ["test"] }
linera-chain = { path = ".", features = ["test"] }
linera-execution = { workspace = true, features = ["test"] }
linera-views = { workspace = true, features = ["test"] }

[build-dependencies]
cfg_aliases.workspace = true
Expand Down
14 changes: 12 additions & 2 deletions linera-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ version.workspace = true

[features]
default = ["fs"]
test = ["linera-views/test", "linera-execution/test"]
test = [
"linera-base/test",
"linera-chain/test",
"linera-core/test",
"linera-execution/test",
"linera-rpc/test",
"linera-storage/test",
"linera-views/test",
]
benchmark = ["linera-base/test", "dep:linera-sdk"]
wasmer = [
"linera-core/wasmer",
Expand Down Expand Up @@ -104,7 +112,9 @@ counter.workspace = true
crowd-funding.workspace = true
ethereum-tracker.workspace = true
fungible.workspace = true
linera-alloy = { workspace = true, default-features = false, features = [ "rpc-types-eth" ] }
linera-alloy = { workspace = true, default-features = false, features = [
"rpc-types-eth",
] }
linera-base = { workspace = true, features = ["test"] }
linera-chain = { workspace = true, features = ["test"] }
linera-client = { path = ".", features = ["test"] }
Expand Down
8 changes: 7 additions & 1 deletion linera-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ assert_matches.workspace = true
counter.workspace = true
criterion.workspace = true
fungible.workspace = true
linera-base = { workspace = true, features = ["test"] }
linera-chain = { workspace = true, features = ["test"] }
linera-core = { path = ".", features = ["test"] }
linera-execution = { workspace = true, features = ["test"] }
linera-storage = { workspace = true, features = ["test"] }
linera-views.workspace = true
meta-counter.workspace = true
serde_json.workspace = true
Expand All @@ -98,7 +102,9 @@ test-case.workspace = true
tracing-subscriber = { workspace = true, features = ["fmt"] }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = { workspace = true, default-features = true, features = ["async_tokio"] }
criterion = { workspace = true, default-features = true, features = [
"async_tokio",
] }

[package.metadata.cargo-machete]
ignored = ["async-graphql", "proptest"]
Expand Down
14 changes: 11 additions & 3 deletions linera-execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository.workspace = true
version.workspace = true

[features]
test = ["tokio/macros", "linera-views/test"]
test = ["tokio/macros", "linera-base/test", "linera-views/test"]
fs = ["tokio/fs"]
metrics = ["prometheus", "linera-views/metrics"]
unstable-oracles = []
Expand Down Expand Up @@ -65,12 +65,18 @@ wasmtime = { workspace = true, optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { workspace = true, features = ["rt-multi-thread"] }
wasmer = { workspace = true, optional = true, features = ["cranelift", "singlepass"] }
wasmer = { workspace = true, optional = true, features = [
"cranelift",
"singlepass",
] }
wasmer-compiler-singlepass.workspace = true

[target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { workspace = true, features = ["rt"] }
wasmer = { workspace = true, optional = true, features = ["js-default", "js-serializable-module"] }
wasmer = { workspace = true, optional = true, features = [
"js-default",
"js-serializable-module",
] }

[dev-dependencies]
anyhow.workspace = true
Expand All @@ -79,6 +85,8 @@ bcs.workspace = true
counter.workspace = true
linera-base = { workspace = true, features = ["test"] }
linera-execution = { path = ".", features = ["test"] }
linera-storage = { workspace = true, features = ["test"] }
linera-views = { workspace = true, features = ["test"] }
linera-witty = { workspace = true, features = ["log", "macros", "test"] }
test-case.workspace = true
test-log = { workspace = true, features = ["trace"] }
Expand Down
5 changes: 5 additions & 0 deletions linera-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ tracing.workspace = true

[dev-dependencies]
insta = { workspace = true, features = ["yaml"] }
linera-base = { workspace = true, features = ["test"] }
linera-chain = { workspace = true, features = ["test"] }
linera-core = { workspace = true, features = ["test"] }
linera-execution = { workspace = true, features = ["test"] }
linera-rpc = { path = ".", features = ["test"] }
linera-storage = { workspace = true, features = ["test"] }
proptest.workspace = true
serde-reflection.workspace = true
test-strategy.workspace = true
Expand Down
4 changes: 4 additions & 0 deletions linera-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ wasmtime.workspace = true

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
linera-sdk = { path = ".", features = ["test"] }
linera-base = { workspace = true, features = ["test"] }
linera-core = { workspace = true, features = ["test"] }
linera-storage = { workspace = true, features = ["test"] }
linera-views = { workspace = true, features = ["test"] }
tokio-test.workspace = true

[build-dependencies]
Expand Down
5 changes: 4 additions & 1 deletion linera-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ ethereum = []
default = ["wasmer", "rocksdb"]
test = [
"linera-base/test",
"linera-views/test",
"linera-chain/test",
"linera-core/test",
"linera-execution/test",
"linera-storage/test",
"linera-views/test",
"dep:stdext",
]
benchmark = ["linera-base/test", "linera-client/benchmark", "dep:linera-sdk"]
Expand Down
4 changes: 3 additions & 1 deletion linera-storage-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ version.workspace = true
metrics = ["linera-views/metrics"]
rocksdb = ["linera-views/rocksdb"]
storage-service = []
test = ["linera-views/test"]
test = ["linera-base/test", "linera-views/test"]

[[bin]]
name = "linera-storage-server"
Expand All @@ -38,7 +38,9 @@ tracing.workspace = true
tracing-subscriber = { workspace = true, features = ["fmt"] }

[dev-dependencies]
linera-base = { workspace = true, features = ["test"] }
linera-storage-service = { path = ".", features = ["test"] }
linera-views = { workspace = true, features = ["test"] }
proptest = { workspace = true, features = ["alloc"] }
serde-reflection.workspace = true
serde_yaml.workspace = true
Expand Down
11 changes: 10 additions & 1 deletion linera-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ repository.workspace = true
version.workspace = true

[features]
test = ["linera-execution/test", "linera-views/test"]
test = [
"linera-base/test",
"linera-chain/test",
"linera-execution/test",
"linera-views/test",
]
wasmer = ["linera-execution/wasmer"]
wasmtime = ["linera-execution/wasmtime"]
metrics = [
Expand Down Expand Up @@ -42,7 +47,11 @@ serde.workspace = true

[dev-dependencies]
anyhow.workspace = true
linera-base = { workspace = true, features = ["test"] }
linera-chain = { workspace = true, features = ["test"] }
linera-execution = { workspace = true, features = ["test"] }
linera-storage = { path = ".", features = ["test"] }
linera-views = { workspace = true, features = ["test"] }

[build-dependencies]
cfg_aliases.workspace = true
4 changes: 3 additions & 1 deletion linera-views/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]

[features]
metrics = ["dep:hex", "linera-base/metrics", "linera-views-derive/metrics"]
test = ["tokio/macros"]
test = ["tokio/macros", "linera-base/test", "linera-witty/test"]
web = ["linera-base/web"]
indexeddb = ["indexed_db_futures", "wasm-bindgen"]
web-default = ["web", "indexeddb"]
Expand Down Expand Up @@ -68,7 +68,9 @@ wasm-bindgen-test.workspace = true

[dev-dependencies]
criterion = { workspace = true, features = ["async_tokio"] }
linera-base = { workspace = true, features = ["test"] }
linera-views = { path = ".", features = ["test"] }
linera-witty = { workspace = true, features = ["test"] }
rand.workspace = true
test-case.workspace = true
tokio-test.workspace = true
Expand Down

0 comments on commit 8765058

Please sign in to comment.