Skip to content

Commit

Permalink
Merge pull request #89 from Polochon-street/add-integrations-test
Browse files Browse the repository at this point in the history
Add an integration test feature
  • Loading branch information
Polochon-street authored Sep 23, 2024
2 parents c867708 + 384548e commit 7a896e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ library = [
"dep:indicatif", "ndarray/serde"
]
serde = ["dep:serde", "extended-isolation-forest/serde"]
integration-tests = []

[dependencies]
# Until https://github.com/aubio/aubio/issues/336 is somehow solved
Expand Down
8 changes: 4 additions & 4 deletions src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ use crate::playlist::dedup_playlist_custom_distance;
use crate::playlist::euclidean_distance;
use crate::playlist::DistanceMetricBuilder;
use anyhow::{bail, Context, Result};
#[cfg(not(test))]
#[cfg(all(not(test), not(feature = "integration-tests")))]
use dirs::data_local_dir;
use indicatif::{ProgressBar, ProgressStyle};
use log::warn;
Expand Down Expand Up @@ -1437,9 +1437,9 @@ fn repeat_vars(count: usize) -> String {
s
}

#[cfg(test)]
#[cfg(any(test, feature = "integration-tests"))]
fn data_local_dir() -> Option<PathBuf> {
Some(PathBuf::from("/local/directory"))
Some(PathBuf::from("/tmp/"))
}

#[cfg(test)]
Expand Down Expand Up @@ -3276,7 +3276,7 @@ mod test {
env::remove_var("XDG_DATA_HOME");

assert_eq!(
PathBuf::from("/local/directory/bliss-rs"),
PathBuf::from("/tmp/bliss-rs/"),
BaseConfig::get_default_data_folder().unwrap()
);
}
Expand Down

0 comments on commit 7a896e8

Please sign in to comment.