pub mod common; mod can_run_for_env; mod cuddle_vars; use cuddle_clusters::{ catalog::{ cluster_vars::ClusterVars, crdb_database::CockroachDB, cuddle_vars::CuddleVars, ingress::Ingress, postgres_database::PostgresDatabase, vault_secret::VaultSecret, }, IntoComponent, }; use crate::common::{run_test, run_test_with_components}; #[tokio::test] async fn raw_files() -> anyhow::Result<()> { run_test("raw_files").await?; Ok(()) } #[tokio::test] async fn template_files() -> anyhow::Result<()> { run_test("template_files").await?; Ok(()) } #[tokio::test] async fn both() -> anyhow::Result<()> { run_test("both").await?; Ok(()) } #[tokio::test] async fn nested() -> anyhow::Result<()> { run_test("nested").await?; Ok(()) } #[tokio::test] async fn jinja() -> anyhow::Result<()> { run_test("jinja").await?; Ok(()) } #[tokio::test] async fn environment() -> anyhow::Result<()> { run_test("environment").await?; Ok(()) } #[tokio::test] async fn with_cuddle_vars() -> anyhow::Result<()> { let current_dir = std::env::current_dir()?.join("tests/with_cuddle_vars"); run_test_with_components( "with_cuddle_vars", vec![CuddleVars::new(¤t_dir).await?], ) .await?; Ok(()) } #[tokio::test] async fn with_cluster_vars() -> anyhow::Result<()> { run_test_with_components("with_cluster_vars", vec![ClusterVars::default()]).await?; Ok(()) } #[tokio::test] async fn with_vault_secrets() -> anyhow::Result<()> { let current_dir = std::env::current_dir()?.join("tests/with_vault_secrets"); run_test_with_components( "with_vault_secrets", vec![ CuddleVars::new(¤t_dir).await?.into_component(), ClusterVars::default().into_component(), VaultSecret::default().into_component(), ], ) .await?; Ok(()) } #[tokio::test] async fn with_crdb() -> anyhow::Result<()> { let current_dir = std::env::current_dir()?.join("tests/with_crdb"); run_test_with_components( "with_crdb", vec![ CuddleVars::new(¤t_dir).await?.into_component(), ClusterVars::default().into_component(), VaultSecret::default().into_component(), CockroachDB::new(¤t_dir).await?.into_component(), ], ) .await?; Ok(()) } #[tokio::test] async fn with_ingress() -> anyhow::Result<()> { let current_dir = std::env::current_dir()?.join("tests/with_ingress"); run_test_with_components( "with_ingress", vec![ CuddleVars::new(¤t_dir).await?.into_component(), ClusterVars::default().into_component(), Ingress::new(¤t_dir).await?.into_component(), ], ) .await?; Ok(()) } #[tokio::test] async fn with_postgres_databse() -> anyhow::Result<()> { let current_dir = std::env::current_dir()?.join("tests/with_postgres_database"); run_test_with_components( "with_postgres_database", vec![ CuddleVars::new(¤t_dir).await?.into_component(), ClusterVars::default().into_component(), VaultSecret::default().into_component(), PostgresDatabase::new(¤t_dir).await?.into_component(), ], ) .await?; Ok(()) }