Skip to content

Commit

Permalink
Find path to data
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Aug 14, 2024
1 parent 338441f commit 643278e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dars/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 20,12 @@ pub async fn dars_test() -> impl Filter<Extract = impl warp::Reply, Error = warp
{
let config = config::Config::default();
let db = sled::Config::default().temporary(true).open().unwrap();
let test_data = match std::env::var("CARGO_MANIFEST_DIR") {
Ok(path) => std::path::Path::new(&path).join("..").join("data"),
Err(_) => std::path::Path::new("../data").to_owned(),
};
let data = Arc::new(
data::Datasets::new_with_datadir(config.root_url.clone(), "../data/".into(), db)
data::Datasets::new_with_datadir(config.root_url.clone(), test_data, db)
.await
.unwrap(),
);
Expand Down

0 comments on commit 643278e

Please sign in to comment.