From 1c9bdf55f0eb247d801766a5e389aebc0adf9b34 Mon Sep 17 00:00:00 2001 From: Matthieu Nicolescu Date: Sat, 7 Oct 2023 18:37:34 +0200 Subject: [PATCH] Add unit tests --- .../tests/resource_naming.tftest.hcl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 terraform/modules/core-convention/tests/resource_naming.tftest.hcl diff --git a/terraform/modules/core-convention/tests/resource_naming.tftest.hcl b/terraform/modules/core-convention/tests/resource_naming.tftest.hcl new file mode 100644 index 00000000..9ea8a96d --- /dev/null +++ b/terraform/modules/core-convention/tests/resource_naming.tftest.hcl @@ -0,0 +1,14 @@ +variables { + team = "team-a" + project = "project-x" + environment = "production" + region = "us-west-1" + delimiter = "-" +} + +run "test_defaults" { + assert { + condition = output.resource_name == "team-a-project-x-production-us-west-1" + error_message = "Resource name is mal formatted" + } +} \ No newline at end of file