Skip to content

Commit

Permalink
serial attribute to force cargo test to run chain sim tests sequentially
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaicalinluca committed Nov 27, 2024
1 parent 5b74562 commit e7f4f69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ version = "{last_release_version}"
clap = {{ version = "4.4.7", features = ["derive"] }}
serde = {{ version = "1.0", features = ["derive"] }}
toml = "0.8.6"
serial_test = {{ version = "3.2.0" }}
[features]
chain-simulator-tests = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,16 @@ pub(crate) fn write_chain_sim_test_to_file(file: &mut File, crate_name: &str) {
file,
r#"use multiversx_sc_snippets::imports::*;
use rust_interact::ContractInteract;
use serial_test::serial;
// Simple deploy test that runs using the chain simulator configuration.
// In order for this test to work, make sure that the `config.toml` file contains the chain simulator config (or choose it manually)
// The chain simulator should already be installed and running before attempting to run this test.
// The chain-simulator-tests feature should be present in Cargo.toml.
// Can be run with `sc-meta test -c`.
// The `#[serial]` attribute should be added to all interactor tests so that we avoid racing problems.
#[tokio::test]
#[serial]
#[cfg_attr(not(feature = "chain-simulator-tests"), ignore)]
async fn deploy_test_{crate_name}_cs() {{
let mut interactor = ContractInteract::new().await;
Expand Down

0 comments on commit e7f4f69

Please sign in to comment.