-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chain sim - sc-meta test-interactors
- Loading branch information
1 parent
3146233
commit 6815700
Showing
7 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
slow-tests: | ||
@docker compose -f docker-compose.yml build | ||
@docker compose -f docker-compose.yml up & cargo test --features chain_simulator --quiet | ||
@docker compose -f docker-compose.yml up & sc-meta test-interactors | ||
@docker compose -f docker-compose.yml down -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use std::process::Command; | ||
|
||
use colored::Colorize; | ||
|
||
use crate::cli::TestInteractorsArgs; | ||
|
||
pub fn test_interactors(args: &TestInteractorsArgs) { | ||
let path = args.path.as_deref().unwrap_or("./"); | ||
let command = "cargo"; | ||
let mut command_args = Vec::new(); | ||
|
||
let no_capture = args.nocapture; | ||
|
||
command_args.push("test"); | ||
|
||
command_args.extend(["--features", "chain_simulator"]); | ||
|
||
if no_capture { | ||
command_args.extend(["--", "--nocapture"]); | ||
} | ||
|
||
let args_str = command_args.join(" "); | ||
|
||
println!( | ||
"{}\n{}", | ||
format!("Running tests in {path} ...").green(), | ||
format!("Executing {command} {args_str} ...").green() | ||
); | ||
|
||
let status = Command::new(command) | ||
.args(command_args.clone()) | ||
.current_dir(path) | ||
.status() | ||
.unwrap_or_else(|_| { | ||
panic!( | ||
"{}", | ||
format!("Failed to run program: {command} {args_str}").bright_red() | ||
) | ||
}); | ||
|
||
println!("Process finished with: {status}"); | ||
assert!(status.success()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters