diff --git a/Cargo.lock b/Cargo.lock index b9cd7c98..960a7a26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3527,6 +3527,7 @@ dependencies = [ "radicle-registry-test-utils", "rand 0.7.3", "sc-rpc-api", + "serial_test", "sp-core", "sp-io", "sp-rpc", @@ -4730,6 +4731,28 @@ dependencies = [ "serde", ] +[[package]] +name = "serial_test" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f74862f16557830c73deefde614c906f8af0157e064b64f156e32a0b12d7114c" +dependencies = [ + "lazy_static", + "parking_lot 0.9.0", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c188479c8b700998829c168d7a4c21032660b0dd2ed87a0b166c85811750740" +dependencies = [ + "proc-macro2 1.0.7", + "quote 1.0.2", + "syn 1.0.13", +] + [[package]] name = "sha-1" version = "0.8.2" diff --git a/DEVELOPING.md b/DEVELOPING.md index 27fb12a6..ef37ed69 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -92,7 +92,11 @@ Black-box tests for the runtime logic are implemented with the client emulator in `runtime/tests/main.rs`. End-to-end tests that run against a real node are implemented in -`client/tests/end_to_end.rs` +`client/tests/end_to_end.rs`. + +To run specific tests sequentially as opposed to the parallel default, +we use the [serial-test](https://crates.io/crates/serial_test) crate, simply +having to mark the targeted tests with `#[serial]`. Changelog diff --git a/client/Cargo.toml b/client/Cargo.toml index b3fe0555..ea37724d 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -69,3 +69,4 @@ rev = "4c4ee3d5b91c4c825aef4fde2b096f014a89346a" [dev-dependencies] rand = "0.7.2" radicle-registry-test-utils = { path = "../test-utils"} +serial_test = "0.3.2" diff --git a/client/tests/end_to_end.rs b/client/tests/end_to_end.rs index 1a54b6e7..b2d99830 100644 --- a/client/tests/end_to_end.rs +++ b/client/tests/end_to_end.rs @@ -3,10 +3,13 @@ //! Note that chain state is shared between the test runs. use async_std; +use serial_test::serial; + use radicle_registry_client::*; use radicle_registry_test_utils::*; #[async_std::test] +#[serial] async fn register_project() { let _ = env_logger::try_init(); let node_host = url::Host::parse("127.0.0.1").unwrap(); @@ -64,6 +67,7 @@ async fn register_project() { } #[async_std::test] +#[serial] /// Submit a transaction with an invalid genesis hash and expect an error. async fn invalid_transaction() { let _ = env_logger::try_init();