8
crates/cuddle-clusters/tests/can_run_for_env.rs
Normal file
8
crates/cuddle-clusters/tests/can_run_for_env.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use crate::common::run_test;
|
||||
|
||||
#[tokio::test]
|
||||
async fn can_run_for_env() -> anyhow::Result<()> {
|
||||
run_test("can_run_for_env").await?;
|
||||
|
||||
Ok(())
|
||||
}
|
2
crates/cuddle-clusters/tests/can_run_for_env/cuddle.yaml
Normal file
2
crates/cuddle-clusters/tests/can_run_for_env/cuddle.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
cuddle/clusters:
|
||||
dev:
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
hello = "world",
|
||||
some = {
|
||||
thing = "some"
|
||||
}
|
||||
}
|
16
crates/cuddle-clusters/tests/common.rs
Normal file
16
crates/cuddle-clusters/tests/common.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use cuddle_clusters::process::ProcessOpts;
|
||||
|
||||
pub(crate) async fn run_test(name: &str) -> anyhow::Result<()> {
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
println!("running for: {name}");
|
||||
|
||||
let current_dir = std::env::current_dir()?;
|
||||
|
||||
cuddle_clusters::process_opts(ProcessOpts {
|
||||
path: current_dir.join("tests").join(name),
|
||||
})
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
3
crates/cuddle-clusters/tests/tests.rs
Normal file
3
crates/cuddle-clusters/tests/tests.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
pub mod common;
|
||||
|
||||
mod can_run_for_env;
|
Reference in New Issue
Block a user