Skip to content

Commit

Permalink
Remove substrate_test_utils::test (#1321)
Browse files Browse the repository at this point in the history
* Directly use tokio::test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove old code

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Delete substrate-test-utils-test-crate

Also not needed anymore.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
2 people authored and Daanvdplas committed Sep 11, 2023
1 parent 730f955 commit a6fcf10
Show file tree
Hide file tree
Showing 17 changed files with 5 additions and 283 deletions.
20 changes: 0 additions & 20 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,9 @@ members = [
"substrate/test-utils",
"substrate/test-utils/cli",
"substrate/test-utils/client",
"substrate/test-utils/derive",
"substrate/test-utils/runtime",
"substrate/test-utils/runtime/client",
"substrate/test-utils/runtime/transaction-pool",
"substrate/test-utils/test-crate",
"substrate/utils/binary-merkle-tree",
"substrate/utils/build-script-utils",
"substrate/utils/fork-tree",
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/metrics/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::collections::HashMap;

const DEFAULT_PROMETHEUS_PORT: u16 = 9616;

#[substrate_test_utils::test(flavor = "multi_thread")]
#[tokio::test(flavor = "multi_thread")]
async fn runtime_can_publish_metrics() {
let mut alice_config =
node_config(|| {}, tokio::runtime::Handle::current(), Alice, Vec::new(), true);
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/test/service/tests/build-blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use futures::{future, pin_mut, select, FutureExt};
use polkadot_test_service::*;
use sp_keyring::Sr25519Keyring;

#[substrate_test_utils::test(flavor = "multi_thread")]
#[tokio::test(flavor = "multi_thread")]
async fn ensure_test_service_build_blocks() {
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_colors(false);
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/test/service/tests/call-function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use polkadot_test_service::*;
use sp_keyring::Sr25519Keyring::{Alice, Bob, Charlie};

#[substrate_test_utils::test(flavor = "multi_thread")]
#[tokio::test(flavor = "multi_thread")]
async fn call_function_actually_work() {
let alice_config =
node_config(|| {}, tokio::runtime::Handle::current(), Alice, Vec::new(), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const PUPPET_EXE: &str = env!("CARGO_BIN_EXE_adder_collator_puppet_worker");
// If this test is failing, make sure to run all tests with the `real-overseer` feature being
// enabled.

#[substrate_test_utils::test(flavor = "multi_thread")]
#[tokio::test(flavor = "multi_thread")]
async fn collating_using_adder_collator() {
use polkadot_primitives::Id as ParaId;
use sp_keyring::AccountKeyring::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const PUPPET_EXE: &str = env!("CARGO_BIN_EXE_undying_collator_puppet_worker");

// If this test is failing, make sure to run all tests with the `real-overseer` feature being
// enabled.
#[substrate_test_utils::test(flavor = "multi_thread")]
#[tokio::test(flavor = "multi_thread")]
async fn collating_using_undying_collator() {
use polkadot_primitives::Id as ParaId;
use sp_keyring::AccountKeyring::*;
Expand Down
1 change: 0 additions & 1 deletion substrate/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
futures = "0.3.16"
tokio = { version = "1.22.0", features = ["macros", "time"] }
substrate-test-utils-derive = { path = "derive" }

[dev-dependencies]
trybuild = { version = "1.0.74", features = [ "diff" ] }
Expand Down
19 changes: 0 additions & 19 deletions substrate/test-utils/derive/Cargo.toml

This file was deleted.

73 changes: 0 additions & 73 deletions substrate/test-utils/derive/src/lib.rs

This file was deleted.

20 changes: 0 additions & 20 deletions substrate/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,6 @@

//! Test utils

#[doc(hidden)]
pub use futures;
/// Marks async function to be executed by an async runtime suitable to test environment.
///
/// # Requirements
///
/// You must have tokio in the `[dev-dependencies]` of your crate to use this macro.
///
/// # Example
///
/// ```
/// #[substrate_test_utils::test]
/// async fn basic_test() {
/// assert!(true);
/// }
/// ```
pub use substrate_test_utils_derive::test;
#[doc(hidden)]
pub use tokio;

/// Panic when the vectors are different, without taking the order into account.
///
/// # Examples
Expand Down
17 changes: 0 additions & 17 deletions substrate/test-utils/test-crate/Cargo.toml

This file was deleted.

25 changes: 0 additions & 25 deletions substrate/test-utils/test-crate/src/main.rs

This file was deleted.

49 changes: 0 additions & 49 deletions substrate/test-utils/tests/basic.rs

This file was deleted.

23 changes: 0 additions & 23 deletions substrate/test-utils/tests/ui.rs

This file was deleted.

24 changes: 0 additions & 24 deletions substrate/test-utils/tests/ui/too-many-func-parameters.rs

This file was deleted.

5 changes: 0 additions & 5 deletions substrate/test-utils/tests/ui/too-many-func-parameters.stderr

This file was deleted.

0 comments on commit a6fcf10

Please sign in to comment.