mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-01 16:08:30 +00:00
fix lint and test failures
This commit is contained in:
1 parent
331a0ce518
commit
4930629a3a
7 files changed
+63
-7
No files matched your search
@@ -7,7 +7,6 @@ use config::shared_constants::DEFAULT_RUST_LOG;
|
||||
use errors::AnyhowResult;
|
||||
|
||||
use crate::delete_pods_threaded::delete_pods_threaded;
|
||||
use crate::list_pods::list_pods;
|
||||
|
||||
pub mod delete_pods;
|
||||
pub mod delete_pods_threaded;
|
||||
|
||||
@@ -84,7 +84,21 @@ mod tests {
|
||||
let mut expected = fake_storyteller.clone();
|
||||
expected.push("storyteller-frontend");
|
||||
|
||||
assert_eq!(get_storyteller_frontend_root(), expected);
|
||||
let actual = get_storyteller_frontend_root();
|
||||
|
||||
if actual.starts_with("/private") && !expected.starts_with("/private") {
|
||||
// NB: For Mac, TempDir creates in /var/... which is an alias of /private/var/...
|
||||
// We'll make sure to canonicalize both paths.
|
||||
let mut corrected = PathBuf::from("/private");
|
||||
|
||||
expected.iter()
|
||||
.filter(|component| !component.to_string_lossy().eq("/"))
|
||||
.for_each(|component| corrected.push(component));
|
||||
|
||||
expected = corrected;
|
||||
}
|
||||
|
||||
assert_eq!(actual, expected);
|
||||
|
||||
std::env::remove_var(TEST_HOME);
|
||||
|
||||
|
||||
@@ -84,7 +84,21 @@ mod tests {
|
||||
let mut expected = fake_storyteller.clone();
|
||||
expected.push("storyteller-ml");
|
||||
|
||||
assert_eq!(get_storyteller_ml_root(), expected);
|
||||
let actual = get_storyteller_ml_root();
|
||||
|
||||
if actual.starts_with("/private") && !expected.starts_with("/private") {
|
||||
// NB: For Mac, TempDir creates in /var/... which is an alias of /private/var/...
|
||||
// We'll make sure to canonicalize both paths.
|
||||
let mut corrected = PathBuf::from("/private");
|
||||
|
||||
expected.iter()
|
||||
.filter(|component| !component.to_string_lossy().eq("/"))
|
||||
.for_each(|component| corrected.push(component));
|
||||
|
||||
expected = corrected;
|
||||
}
|
||||
|
||||
assert_eq!(actual, expected);
|
||||
|
||||
std::env::remove_var(TEST_HOME);
|
||||
|
||||
|
||||
@@ -127,7 +127,22 @@ mod tests {
|
||||
// test variable so we never infect other tests.
|
||||
std::env::set_var(TEST_HOME, fake_home.to_str().expect("should be string"));
|
||||
|
||||
assert_eq!(get_storyteller_root(), fake_storyteller);
|
||||
let actual = get_storyteller_root();
|
||||
let mut expected = fake_storyteller.clone();
|
||||
|
||||
if actual.starts_with("/private") && !expected.starts_with("/private") {
|
||||
// NB: For Mac, TempDir creates in /var/... which is an alias of /private/var/...
|
||||
// We'll make sure to canonicalize both paths.
|
||||
let mut corrected = PathBuf::from("/private");
|
||||
|
||||
expected.iter()
|
||||
.filter(|component| !component.to_string_lossy().eq("/"))
|
||||
.for_each(|component| corrected.push(component));
|
||||
|
||||
expected = corrected;
|
||||
}
|
||||
|
||||
assert_eq!(actual, expected);
|
||||
|
||||
std::env::remove_var(TEST_HOME);
|
||||
|
||||
|
||||
@@ -84,7 +84,21 @@ mod tests {
|
||||
let mut expected = fake_storyteller.clone();
|
||||
expected.push("storyteller-rust");
|
||||
|
||||
assert_eq!(get_storyteller_rust_root(), expected);
|
||||
let actual = get_storyteller_rust_root();
|
||||
|
||||
if actual.starts_with("/private") && !expected.starts_with("/private") {
|
||||
// NB: For Mac, TempDir creates in /var/... which is an alias of /private/var/...
|
||||
// We'll make sure to canonicalize both paths.
|
||||
let mut corrected = PathBuf::from("/private");
|
||||
|
||||
expected.iter()
|
||||
.filter(|component| !component.to_string_lossy().eq("/"))
|
||||
.for_each(|component| corrected.push(component));
|
||||
|
||||
expected = corrected;
|
||||
}
|
||||
|
||||
assert_eq!(actual, expected);
|
||||
|
||||
std::env::remove_var(TEST_HOME);
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ mod tests {
|
||||
|
||||
use crate::clean_symbols::clean_symbols;
|
||||
|
||||
const TIME_BOMB_EPOCH_STR : &str = "2023-11-01T00:00:00.00Z";
|
||||
const TIME_BOMB_EPOCH_STR : &str = "2024-04-01T00:00:00.00Z";
|
||||
|
||||
static TIME_BOMB_EPOCH: Lazy<DateTime<Utc>> = Lazy::new(|| {
|
||||
let datetime = DateTime::parse_from_rfc3339(TIME_BOMB_EPOCH_STR)
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ pub async fn list_voices_by_session_handler(
|
||||
})?
|
||||
.ok_or_else(|| {
|
||||
warn!("not logged in");
|
||||
return ListVoicesByUserError::NotAuthorized;
|
||||
ListVoicesByUserError::NotAuthorized
|
||||
})?;
|
||||
|
||||
let creator_user_token = user_session.user_token.clone();
|
||||
|
||||
Reference in new issue
Block a user