feat: add more tests
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
f04b0a2e54
commit
f0b4c91c63
@ -98,7 +98,7 @@ async fn load_template_files(path: &Path) -> anyhow::Result<TemplateFiles> {
|
|||||||
templates: read_dir(path)
|
templates: read_dir(path)
|
||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|i| !i.ends_with(".jinja2"))
|
.filter(|i| i.extension().and_then(|e| e.to_str()) == Some("jinja2"))
|
||||||
.collect(),
|
.collect(),
|
||||||
raw: read_dir(&path.join("raw")).await.unwrap_or_default(),
|
raw: read_dir(&path.join("raw")).await.unwrap_or_default(),
|
||||||
})
|
})
|
||||||
@ -149,7 +149,7 @@ async fn process_cluster(
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn process_template_file(
|
async fn process_template_file(
|
||||||
cluster_name: &str,
|
_cluster_name: &str,
|
||||||
template_file: &PathBuf,
|
template_file: &PathBuf,
|
||||||
dest: &Path,
|
dest: &Path,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
|
2
crates/cuddle-clusters/tests/both/cuddle.yaml
Normal file
2
crates/cuddle-clusters/tests/both/cuddle.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cuddle/clusters:
|
||||||
|
dev:
|
2
crates/cuddle-clusters/tests/template_files/cuddle.yaml
Normal file
2
crates/cuddle-clusters/tests/template_files/cuddle.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cuddle/clusters:
|
||||||
|
dev:
|
@ -10,3 +10,16 @@ async fn raw_files() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
Ok(())
|
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(())
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user