Skip to content

Commit

Permalink
fix(clippy): fixing updated clippy dead code warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother committed Jun 20, 2024
1 parent 8b7d285 commit da52d39
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
32 changes: 25 additions & 7 deletions tests/context/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#[cfg(feature = "functional_tests")]
use echo_server::state::{ClientStoreArc, NotificationStoreArc, TenantStoreArc};
use {
self::server::EchoServer,
async_trait::async_trait,
echo_server::{
config::Config,
state::{ClientStoreArc, NotificationStoreArc, TenantStoreArc},
},
echo_server::config::Config,
sqlx::{Pool, Postgres},
std::{env, sync::Arc},
test_context::{AsyncTestContext, TestContext},
Expand All @@ -19,15 +18,24 @@ pub struct ConfigContext {

pub struct EchoServerContext {
pub server: EchoServer,
#[cfg(all(
feature = "multitenant",
feature = "apns_tests",
feature = "fcm_tests",
feature = "fcmv1_tests"
))]
pub config: Config,
}

pub struct StoreContext {
pub pool: Arc<Pool<Postgres>>,
pub tenant_pool: Arc<Pool<Postgres>>,

#[cfg(feature = "functional_tests")]
pub clients: ClientStoreArc,
#[cfg(feature = "functional_tests")]
pub notifications: NotificationStoreArc,
#[cfg(feature = "functional_tests")]
pub tenants: TenantStoreArc,
}

Expand Down Expand Up @@ -92,9 +100,16 @@ impl TestContext for ConfigContext {
#[async_trait]
impl AsyncTestContext for EchoServerContext {
async fn setup() -> Self {
let config = ConfigContext::setup().config;
let server = EchoServer::start(ConfigContext::setup().config).await;
Self { server, config }
Self {
server: EchoServer::start(ConfigContext::setup().config).await,
#[cfg(all(
feature = "multitenant",
feature = "apns_tests",
feature = "fcm_tests",
feature = "fcmv1_tests"
))]
config: ConfigContext::setup().config,
}
}

async fn teardown(mut self) {
Expand All @@ -115,8 +130,11 @@ impl AsyncTestContext for StoreContext {
Self {
pool: db_arc.clone(),
tenant_pool: tenant_db_arc.clone(),
#[cfg(feature = "functional_tests")]
clients: db_arc.clone(),
#[cfg(feature = "functional_tests")]
notifications: db_arc.clone(),
#[cfg(feature = "functional_tests")]
tenants: tenant_db_arc.clone(),
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/functional/multitenant/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mod apns;
mod fcm;
#[cfg(feature = "fcmv1_tests")]
mod fcm_v1;
#[cfg(feature = "multitenant")]
mod tenancy;

/// Struct to hold claims for JWT validation
Expand Down

0 comments on commit da52d39

Please sign in to comment.