diff --git a/crates/cuddle-clusters/tests/environment/cuddle.yaml b/crates/cuddle-clusters/tests/environment/cuddle.yaml new file mode 100644 index 0000000..0f51812 --- /dev/null +++ b/crates/cuddle-clusters/tests/environment/cuddle.yaml @@ -0,0 +1,3 @@ +cuddle/clusters: + dev: + prod: diff --git a/crates/cuddle-clusters/tests/environment/expected/dev/some.yaml b/crates/cuddle-clusters/tests/environment/expected/dev/some.yaml new file mode 100644 index 0000000..4a067a0 --- /dev/null +++ b/crates/cuddle-clusters/tests/environment/expected/dev/some.yaml @@ -0,0 +1 @@ +env: dev \ No newline at end of file diff --git a/crates/cuddle-clusters/tests/environment/expected/prod/some.yaml b/crates/cuddle-clusters/tests/environment/expected/prod/some.yaml new file mode 100644 index 0000000..46b998b --- /dev/null +++ b/crates/cuddle-clusters/tests/environment/expected/prod/some.yaml @@ -0,0 +1 @@ +env: prod \ No newline at end of file diff --git a/crates/cuddle-clusters/tests/environment/templates/clusters/some.yaml.jinja2 b/crates/cuddle-clusters/tests/environment/templates/clusters/some.yaml.jinja2 new file mode 100644 index 0000000..003e069 --- /dev/null +++ b/crates/cuddle-clusters/tests/environment/templates/clusters/some.yaml.jinja2 @@ -0,0 +1 @@ +env: {{ environment }} diff --git a/crates/cuddle-clusters/tests/jinja/cuddle.yaml b/crates/cuddle-clusters/tests/jinja/cuddle.yaml new file mode 100644 index 0000000..b81909a --- /dev/null +++ b/crates/cuddle-clusters/tests/jinja/cuddle.yaml @@ -0,0 +1,2 @@ +cuddle/clusters: + dev: diff --git a/crates/cuddle-clusters/tests/jinja/expected/dev/some.yaml b/crates/cuddle-clusters/tests/jinja/expected/dev/some.yaml new file mode 100644 index 0000000..f8c3979 --- /dev/null +++ b/crates/cuddle-clusters/tests/jinja/expected/dev/some.yaml @@ -0,0 +1 @@ +some_file: 4 \ No newline at end of file diff --git a/crates/cuddle-clusters/tests/jinja/templates/clusters/some.yaml.jinja2 b/crates/cuddle-clusters/tests/jinja/templates/clusters/some.yaml.jinja2 new file mode 100644 index 0000000..f04a22b --- /dev/null +++ b/crates/cuddle-clusters/tests/jinja/templates/clusters/some.yaml.jinja2 @@ -0,0 +1 @@ +some_file: {{ 2 + 2 }} diff --git a/crates/cuddle-clusters/tests/tests.rs b/crates/cuddle-clusters/tests/tests.rs index 16fb18f..12bf9db 100644 --- a/crates/cuddle-clusters/tests/tests.rs +++ b/crates/cuddle-clusters/tests/tests.rs @@ -23,3 +23,17 @@ async fn both() -> anyhow::Result<()> { 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(()) +}