Skip to content
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/soroban-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,4 @@ assert_fs = "1.0.7"
predicates = { workspace = true }
walkdir = "2.5.0"
mockito = "1.5.0"
serial_test = "3.0.0"
2 changes: 2 additions & 0 deletions cmd/soroban-cli/src/config/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ fn to_xdr(data: &impl WriteXdr) -> Result<String, xdr::Error> {
#[cfg(test)]
mod test {
use super::*;
use serial_test::serial;

#[test]
#[serial]
fn test_write_read() {
let t = assert_fs::TempDir::new().unwrap();
std::env::set_var("STELLAR_DATA_HOME", t.path().to_str().unwrap());
Expand Down
9 changes: 7 additions & 2 deletions cmd/soroban-cli/src/config/upgrade_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ impl UpgradeCheck {
#[cfg(test)]
mod tests {
use super::*;
use serial_test::serial;
use std::env;

#[test]
#[serial]
fn test_upgrade_check_load_save() {
// Set the `XDG_DATA_HOME` environment variable to a temporary directory
// Use `STELLAR_DATA_HOME` (cross-platform, highest priority) so that
// any `STELLAR_DATA_HOME` or `XDG_DATA_HOME` leaked by parallel tests
// cannot shadow our temp dir.
let temp_dir = tempfile::tempdir().unwrap();
env::set_var("XDG_DATA_HOME", temp_dir.path());
env::remove_var("XDG_DATA_HOME");
env::set_var("STELLAR_DATA_HOME", temp_dir.path());
Comment thread
fnando marked this conversation as resolved.
// Test default loading
let default_check = UpgradeCheck::load().unwrap();
assert_eq!(default_check, UpgradeCheck::default());
Expand Down
Loading