Skip to content
This repository was archived by the owner on Feb 28, 2021. It is now read-only.

Commit 52f8cdc

Browse files
committed
Add 'serial_test' create to run serial tests
This crate allows us to easily define a specific test to run in a serial fashion instead of in parallel.
1 parent 4c697c2 commit 52f8cdc

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

Cargo.lock

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

DEVELOPING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ Black-box tests for the runtime logic are implemented with the client emulator
9292
in `runtime/tests/main.rs`.
9393

9494
End-to-end tests that run against a real node are implemented in
95-
`client/tests/end_to_end.rs`
95+
`client/tests/end_to_end.rs`.
96+
97+
To run specific tests sequentially as opposed to the parallel default,
98+
we use the [serial-test](https://crates.io/crates/serial_test) crate, simply
99+
having to mark the targeted tests with `#[serial]`.
96100

97101

98102
Changelog

client/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ rev = "4c4ee3d5b91c4c825aef4fde2b096f014a89346a"
6969
[dev-dependencies]
7070
rand = "0.7.2"
7171
radicle-registry-test-utils = { path = "../test-utils"}
72+
serial_test = "0.3.2"

client/tests/end_to_end.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
//! Note that chain state is shared between the test runs.
44
55
use async_std;
6+
use serial_test::serial;
7+
68
use radicle_registry_client::*;
79
use radicle_registry_test_utils::*;
810

911
#[async_std::test]
12+
#[serial]
1013
async fn register_project() {
1114
let _ = env_logger::try_init();
1215
let node_host = url::Host::parse("127.0.0.1").unwrap();

0 commit comments

Comments
 (0)