-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: [#656] E2E runner. Pass config as env var to Tracker Checker
This was we don't even need a temp dir to run E2E tests.
- Loading branch information
1 parent
1bab582
commit 392ffab
Showing
4 changed files
with
31 additions
and
144 deletions.
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,5 +1,5 @@ | ||
pub mod docker; | ||
pub mod logs_parser; | ||
pub mod runner; | ||
pub mod temp_dir; | ||
pub mod tracker_checker; | ||
pub mod tracker_container; |
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 was deleted.
Oops, something went wrong.
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,25 @@ | ||
use std::io; | ||
use std::process::Command; | ||
|
||
use log::info; | ||
|
||
/// Runs the Tracker Checker. | ||
/// | ||
/// # Errors | ||
/// | ||
/// Will return an error if the Tracker Checker fails. | ||
pub fn run(config_content: &str) -> io::Result<()> { | ||
info!("Running Tracker Checker: TORRUST_CHECKER_CONFIG=[config] cargo run --bin tracker_checker"); | ||
info!("Tracker Checker config:\n{config_content}"); | ||
|
||
let status = Command::new("cargo") | ||
.env("TORRUST_CHECKER_CONFIG", config_content) | ||
.args(["run", "--bin", "tracker_checker"]) | ||
.status()?; | ||
|
||
if status.success() { | ||
Ok(()) | ||
} else { | ||
Err(io::Error::new(io::ErrorKind::Other, "Failed to run Tracker Checker")) | ||
} | ||
} | ||