pub mod service_runner;
use crate::config::Settings;
use std::sync::Arc;
pub async fn setup_and_run(config: Settings) -> Result<(), Box<dyn std::error::Error>> {
let config = Arc::new(config);
service_runner::run_services(config.clone()).await?;
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
use crate::config::Settings;
#[tokio::test]
async fn test_setup_and_run_with_default_config() {
let config = Settings::default();
let result = setup_and_run(config).await;
assert!(result.is_err() || result.is_ok());
}
#[tokio::test]
async fn test_setup_and_run_config_wrapping() {
let config = Settings::default();
let result = setup_and_run(config).await;
assert!(result.is_err() || result.is_ok());
}
}