Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
add test-utils for polkadot and malus
Browse files Browse the repository at this point in the history
  • Loading branch information
jpserrat committed Aug 9, 2023
1 parent f8e10ce commit 735344a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ path = "src/main.rs"
[[bin]]
name = "polkadot-execute-worker"
path = "src/bin/execute-worker.rs"
required-features = ["test-utils"]

[[bin]]
name = "polkadot-prepare-worker"
path = "src/bin/prepare-worker.rs"
required-features = ["test-utils"]

[package]
name = "polkadot"
Expand Down Expand Up @@ -38,8 +40,8 @@ polkadot-node-core-pvf-prepare-worker = { path = "node/core/pvf/prepare-worker"
polkadot-overseer = { path = "node/overseer" }

# Needed for worker binaries.
polkadot-node-core-pvf-common = { path = "node/core/pvf/common" }
polkadot-node-core-pvf-execute-worker = { path = "node/core/pvf/execute-worker" }
polkadot-node-core-pvf-common = { path = "node/core/pvf/common", features = ["test-utils"], optional = true }
polkadot-node-core-pvf-execute-worker = { path = "node/core/pvf/execute-worker", optional = true }

[dev-dependencies]
assert_cmd = "2.0.4"
Expand Down Expand Up @@ -226,7 +228,8 @@ fast-runtime = [ "polkadot-cli/fast-runtime" ]
runtime-metrics = [ "polkadot-cli/runtime-metrics" ]
pyroscope = ["polkadot-cli/pyroscope"]
jemalloc-allocator = ["polkadot-node-core-pvf-prepare-worker/jemalloc-allocator", "polkadot-overseer/jemalloc-allocator"]

# Needed for worker binaries.
test-util = ["polkadot-node-core-pvf-common/test-utils", "polkadot-node-core-pvf-execute-worker"]
# Enables timeout-based tests supposed to be run only in CI environment as they may be flaky
# when run locally depending on system load
ci-only-tests = ["polkadot-node-core-pvf/ci-only-tests"]
Expand Down
10 changes: 7 additions & 3 deletions node/malus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ path = "src/malus.rs"
[[bin]]
name = "polkadot-execute-worker"
path = "../../src/bin/execute-worker.rs"
required-features = ["test-utils"]
# Prevent rustdoc error. Already documented from top-level Cargo.toml.
doc = false
[[bin]]
name = "polkadot-prepare-worker"
path = "../../src/bin/prepare-worker.rs"
required-features = ["test-utils"]
# Prevent rustdoc error. Already documented from top-level Cargo.toml.
doc = false

Expand All @@ -48,9 +50,9 @@ erasure = { package = "polkadot-erasure-coding", path = "../../erasure-coding" }
rand = "0.8.5"

# Required for worker binaries to build.
polkadot-node-core-pvf-common = { path = "../core/pvf/common" }
polkadot-node-core-pvf-execute-worker = { path = "../core/pvf/execute-worker" }
polkadot-node-core-pvf-prepare-worker = { path = "../core/pvf/prepare-worker" }
polkadot-node-core-pvf-common = { path = "../core/pvf/common", features = ["test-utils"], optional = true }
polkadot-node-core-pvf-execute-worker = { path = "../core/pvf/execute-worker", optional = true }
polkadot-node-core-pvf-prepare-worker = { path = "../core/pvf/prepare-worker", optional = true }

[dev-dependencies]
polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" }
Expand All @@ -63,3 +65,5 @@ substrate-build-script-utils = { git = "https://github.com/paritytech/substrate"
[features]
default = []
fast-runtime = ["polkadot-cli/fast-runtime"]
# Needed for worker binaries.
test-utils = ["polkadot-node-core-pvf-common/test-utils", "polkadot-node-core-pvf-execute-worker", "polkadot-node-core-pvf-prepare-worker"]

0 comments on commit 735344a

Please sign in to comment.