mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Set better logging defaults for Docker tests
This commit is contained in:
@@ -117,16 +117,18 @@ pub fn build(name: String) {
|
|||||||
|
|
||||||
println!("Building {}...", &name);
|
println!("Building {}...", &name);
|
||||||
|
|
||||||
assert!(Command::new("docker")
|
let res = Command::new("docker")
|
||||||
.current_dir(deploy_path)
|
.current_dir(deploy_path)
|
||||||
.arg("compose")
|
.arg("compose")
|
||||||
.arg("build")
|
.arg("build")
|
||||||
.arg(&name)
|
.arg(&name)
|
||||||
.spawn()
|
.output()
|
||||||
.unwrap()
|
.unwrap();
|
||||||
.wait()
|
if !res.status.success() {
|
||||||
.unwrap()
|
dbg!(res.stdout);
|
||||||
.success());
|
dbg!(res.stderr);
|
||||||
|
panic!("failed to build {name}");
|
||||||
|
}
|
||||||
|
|
||||||
println!("Built!");
|
println!("Built!");
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,6 @@ const RPC_PASS: &str = "seraidex";
|
|||||||
|
|
||||||
static UNIQUE_ID: OnceLock<Mutex<u16>> = OnceLock::new();
|
static UNIQUE_ID: OnceLock<Mutex<u16>> = OnceLock::new();
|
||||||
|
|
||||||
fn log_options() -> Option<LogOptions> {
|
|
||||||
Some(LogOptions {
|
|
||||||
action: LogAction::Forward,
|
|
||||||
policy: LogPolicy::Always,
|
|
||||||
source: LogSource::Both,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn bitcoin_instance() -> (Composition, u16) {
|
pub fn bitcoin_instance() -> (Composition, u16) {
|
||||||
serai_docker_tests::build("bitcoin".to_string());
|
serai_docker_tests::build("bitcoin".to_string());
|
||||||
|
|
||||||
@@ -142,7 +134,11 @@ pub fn processor_stack(
|
|||||||
composition
|
composition
|
||||||
.with_start_policy(StartPolicy::Strict)
|
.with_start_policy(StartPolicy::Strict)
|
||||||
.with_container_name(format!("{handle}-{}", &unique_id))
|
.with_container_name(format!("{handle}-{}", &unique_id))
|
||||||
.with_log_options(log_options()),
|
.with_log_options(Some(LogOptions {
|
||||||
|
action: LogAction::Forward,
|
||||||
|
policy: if handle.contains("processor") { LogPolicy::Always } else { LogPolicy::OnError },
|
||||||
|
source: LogSource::Both,
|
||||||
|
})),
|
||||||
);
|
);
|
||||||
handles.push(compositions.last().unwrap().handle());
|
handles.push(compositions.last().unwrap().handle());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user