Skip to content

Commit 8512a28

Browse files
committed
fix broken test due cache key reuse
1 parent 419b432 commit 8512a28

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

payjoin-cli/src/app/v2/ohttp.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ struct CachedOhttpKeys {
141141

142142
fn get_cache_file() -> PathBuf {
143143
let dir = dirs::cache_dir().unwrap();
144-
println!("Getting cache file {:?}", dir);
145144
dirs::cache_dir().unwrap().join("payjoin-cli").join("ohttp-keys.json")
146145
}
147146

payjoin-cli/tests/e2e.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ mod e2e {
6464
res
6565
}
6666

67+
fn clear_payjoin_cache() -> std::io::Result<()> {
68+
let cache_dir = dirs::cache_dir().unwrap().join("payjoin-cli");
69+
70+
if cache_dir.exists() {
71+
std::fs::remove_dir_all(cache_dir)?;
72+
}
73+
Ok(())
74+
}
75+
6776
#[cfg(feature = "v1")]
6877
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
6978
async fn send_receive_payjoin_v1() -> Result<(), BoxError> {
@@ -203,6 +212,8 @@ mod e2e {
203212
use tempfile::TempDir;
204213
use tokio::process::Child;
205214

215+
clear_payjoin_cache()?;
216+
206217
type Result<T> = std::result::Result<T, BoxError>;
207218

208219
init_tracing();

0 commit comments

Comments
 (0)