diff --git a/Revolt.test.toml b/crates/core/config/Revolt.test.toml similarity index 100% rename from Revolt.test.toml rename to crates/core/config/Revolt.test.toml diff --git a/crates/core/config/src/lib.rs b/crates/core/config/src/lib.rs index af375b6f..61948e97 100644 --- a/crates/core/config/src/lib.rs +++ b/crates/core/config/src/lib.rs @@ -13,7 +13,12 @@ static CONFIG_BUILDER: Lazy> = Lazy::new(|| { FileFormat::Toml, )); - if std::path::Path::new("Revolt.toml").exists() { + if std::env::var("TEST_DB").is_ok() { + builder = builder.add_source(File::from_str( + include_str!("../Revolt.test.toml"), + FileFormat::Toml, + )); + } else if std::path::Path::new("Revolt.toml").exists() { builder = builder.add_source(File::new("Revolt.toml", FileFormat::Toml)); } diff --git a/crates/core/database/src/models/admin_migrations/model.rs b/crates/core/database/src/models/admin_migrations/model.rs index 70bbc62c..2c65c811 100644 --- a/crates/core/database/src/models/admin_migrations/model.rs +++ b/crates/core/database/src/models/admin_migrations/model.rs @@ -18,7 +18,7 @@ mod tests { db.migrate_database().await.unwrap(); // Migrate the existing database - db.migrate_database().await.unwrap() + db.migrate_database().await.unwrap(); }); } } diff --git a/crates/core/database/src/util/idempotency.rs b/crates/core/database/src/util/idempotency.rs index 791a61dd..94448c04 100644 --- a/crates/core/database/src/util/idempotency.rs +++ b/crates/core/database/src/util/idempotency.rs @@ -1,6 +1,9 @@ use std::num::NonZeroUsize; -use revolt_result::{create_error, Result, Error}; +use revolt_result::{create_error, Result}; + +#[cfg(feature = "rocket-impl")] +use revolt_result::Error; use async_std::sync::Mutex; use once_cell::sync::Lazy;