Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test environment initial setup #5

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions adaptor/tests/bisq_musig_integration_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mod common;

#[test]
fn test_bisq_musig() {
common::setup();
assert_eq!(2 + 2, 4);
}
55 changes: 55 additions & 0 deletions adaptor/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
pub fn setup() {
use std::process::Command;

println!("Starting the setup...");

// Step 1: Run the curl command to download and install Nigiri
let curl_output = Command::new("sh")
.arg("-c")
.arg("curl https://getnigiri.vulpem.com | bash")
.output();

match curl_output {
Ok(output) => {
if output.status.success() {
println!("Successfully ran the curl command.");
} else {
eprintln!(
"Failed to run the curl command. Error: {}",
String::from_utf8_lossy(&output.stderr)
);
std::process::exit(1);
}
}
Err(e) => {
eprintln!("Error while running the curl command: {}", e);
std::process::exit(1);
}
}

// Step 2: Run 'nigiri start' to start Nigiri
let nigiri_output = Command::new("nigiri")
.arg("start")
.output();

match nigiri_output {
Ok(output) => {
if output.status.success() {
println!("Nigiri started successfully.");
} else {
eprintln!(
"Failed to start Nigiri. Error: {}",
String::from_utf8_lossy(&output.stderr)
);
std::process::exit(1);
}
}
Err(e) => {
eprintln!("Error while starting Nigiri: {}", e);
std::process::exit(1);
}
}

println!("Setup completed successfully.");
}