Skip to content

Commit

Permalink
fix: Integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
igamigo committed Jul 1, 2024
1 parent f715555 commit 23c8ede
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ repository.workspace = true
rust-version.workspace = true
edition.workspace = true

[features]
integration = ["miden-client/integration"]

[dev-dependencies]
figment = { version = "0.10", features = ["toml", "env"] }
miden-client = { path = "../crates/miden-client", features = ["testing"] }
Expand All @@ -23,3 +26,4 @@ tokio = { workspace = true }
[[test]]
name = "integration"
path = "integration/main.rs"
required-features = ["integration"]
17 changes: 14 additions & 3 deletions tests/integration/cli_tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
use std::{env::temp_dir, fs::File, io::Read, path::Path, rc::Rc};
use std::{
env::{self, temp_dir},
fs::File,
io::Read,
path::Path,
rc::Rc,
};

use assert_cmd::Command;
use miden_client::{
Expand Down Expand Up @@ -167,8 +173,13 @@ fn test_import_genesis_accounts_can_be_used_for_transactions() {
for genesis_account_filename in GENESIS_ACCOUNTS_FILENAMES {
let mut new_file_path = temp_dir.clone();
new_file_path.push(genesis_account_filename);
std::fs::copy(format!("./miden-node/accounts/{}", genesis_account_filename), new_file_path)
.unwrap();

let cargo_workspace_dir =
env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR is not set");
let source_path =
format!("{}/../miden-node/accounts/{}", cargo_workspace_dir, genesis_account_filename);

std::fs::copy(source_path, new_file_path).unwrap();
}

let mut init_cmd = Command::cargo_bin("miden").unwrap();
Expand Down

0 comments on commit 23c8ede

Please sign in to comment.