Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandervantrijffel committed Sep 17, 2023
1 parent 7acde5f commit 5955e76
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,12 @@ mutation {

fn init_env() -> Result<String> {
let tempdir = std::env::temp_dir().join("photomanager-tests");

let mut rng = rand::thread_rng();
let path = photomanagerlib::fsops::get_unique_filepath(tempdir.to_str().unwrap())
.map(|p| p + "--" + rng.gen_range(1..10000).into().as_str())?;
let random_suffix: u32 = rng.gen_range(1..10000);

let unique_filepath = photomanagerlib::fsops::get_unique_filepath(tempdir.to_str().unwrap())?;
let path = format!("{}--{}", unique_filepath, random_suffix);

std::env::set_var("PUBLIC_URL", "http://integration-test");
Ok(path)
Expand Down

0 comments on commit 5955e76

Please sign in to comment.