From 2e3231aadbbab7ef7a9b42826e6df9d03e390afc Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 10:41:53 -0300 Subject: [PATCH 01/20] Movendo testes do CustomResourceDefinition/v1alpha1 para a pasta raiz --- .../CustomResourceDefinition_v1alpha1.tftest.hcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename CustomResourceDefinition/v1alpha1/tests/unit.tftest.hcl => tests/CustomResourceDefinition_v1alpha1.tftest.hcl (87%) diff --git a/CustomResourceDefinition/v1alpha1/tests/unit.tftest.hcl b/tests/CustomResourceDefinition_v1alpha1.tftest.hcl similarity index 87% rename from CustomResourceDefinition/v1alpha1/tests/unit.tftest.hcl rename to tests/CustomResourceDefinition_v1alpha1.tftest.hcl index 397ede3..d149768 100644 --- a/CustomResourceDefinition/v1alpha1/tests/unit.tftest.hcl +++ b/tests/CustomResourceDefinition_v1alpha1.tftest.hcl @@ -1,5 +1,8 @@ run "missing_group" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/" + } variables { path = "." @@ -18,6 +21,9 @@ run "missing_group" { run "missing_kind" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/" + } variables { path = "." @@ -38,6 +44,9 @@ run "missing_kind" { run "missing_versions" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/" + } variables { path = "." @@ -59,6 +68,9 @@ run "missing_versions" { run "with_invalid_versions" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/" + } variables { path = "." @@ -82,6 +94,9 @@ run "with_invalid_versions" { run "with_valid_versions" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/" + } variables { path = "." From e8dfb4efdee8638d180744e696af7d680277c927 Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 11:40:19 -0300 Subject: [PATCH 02/20] Movendo testes do modulo manifestValidation --- .../manifestValidation.tftest.hcl | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) rename manifestValidation/tests/unit.tftest.hcl => tests/manifestValidation.tftest.hcl (82%) diff --git a/manifestValidation/tests/unit.tftest.hcl b/tests/manifestValidation.tftest.hcl similarity index 82% rename from manifestValidation/tests/unit.tftest.hcl rename to tests/manifestValidation.tftest.hcl index 747211c..004aa7a 100644 --- a/manifestValidation/tests/unit.tftest.hcl +++ b/tests/manifestValidation.tftest.hcl @@ -1,5 +1,8 @@ run "with_invalid_yaml" { command = plan + module { + source = "./manifestValidation/" + } variables { path = "." @@ -13,6 +16,9 @@ run "with_invalid_yaml" { run "missing_apiVersion" { command = plan + module { + source = "./manifestValidation/" + } variables { path = "." @@ -26,6 +32,9 @@ run "missing_apiVersion" { run "invalid_apiVersion" { command = plan + module { + source = "./manifestValidation/" + } variables { path = "." @@ -41,6 +50,9 @@ run "invalid_apiVersion" { run "missing_kind" { command = plan + module { + source = "./manifestValidation/" + } variables { path = "." @@ -56,6 +68,9 @@ run "missing_kind" { run "missing_metadata" { command = plan + module { + source = "./manifestValidation/" + } variables { path = "." @@ -72,6 +87,9 @@ run "missing_metadata" { run "missing_metadata_name" { command = plan + module { + source = "./manifestValidation/" + } variables { path = "." @@ -89,6 +107,9 @@ run "missing_metadata_name" { run "missing_spec" { command = plan + module { + source = "./manifestValidation/" + } variables { path = "." @@ -107,6 +128,9 @@ run "missing_spec" { run "with_valid_manifest" { command = plan + module { + source = "./manifestValidation/" + } variables { path = "." From 6182bc3f8d3f30a1f667d6b87f68009ff094700b Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 12:04:56 -0300 Subject: [PATCH 03/20] Movendo testes do modulo resourceValidation --- .../resourceValidation.tftest.hcl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) rename resourceValidation/tests/unit.tftest.hcl => tests/resourceValidation.tftest.hcl (96%) diff --git a/resourceValidation/tests/unit.tftest.hcl b/tests/resourceValidation.tftest.hcl similarity index 96% rename from resourceValidation/tests/unit.tftest.hcl rename to tests/resourceValidation.tftest.hcl index da75696..eb42480 100644 --- a/resourceValidation/tests/unit.tftest.hcl +++ b/tests/resourceValidation.tftest.hcl @@ -1,5 +1,8 @@ run "duplicated_custom_resource_definition" { command = plan + module { + source = "./resourceValidation/" + } variables { path = "." @@ -82,6 +85,9 @@ run "duplicated_custom_resource_definition" { run "custom_resource_definition_not_found" { command = plan + module { + source = "./resourceValidation/" + } variables { path = "." @@ -135,6 +141,9 @@ run "custom_resource_definition_not_found" { run "kind_not_found" { command = plan + module { + source = "./resourceValidation/" + } variables { path = "." @@ -188,6 +197,9 @@ run "kind_not_found" { run "disabled_version" { command = plan + module { + source = "./resourceValidation/" + } variables { path = "." @@ -241,6 +253,9 @@ run "disabled_version" { run "deprecated_version" { command = plan + module { + source = "./resourceValidation/" + } variables { path = "." @@ -294,6 +309,9 @@ run "deprecated_version" { run "success" { command = plan + module { + source = "./resourceValidation/" + } variables { path = "." From 049e8c76f2ac5022f3476dec4cdf2fbdc45c591e Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 12:07:30 -0300 Subject: [PATCH 04/20] Movendo testes do modulo schemaValidation/array/v0 --- .../schemaValidation_array_v0.tftest.hcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename schemaValidation/array/v0/tests/unit.tftest.hcl => tests/schemaValidation_array_v0.tftest.hcl (91%) diff --git a/schemaValidation/array/v0/tests/unit.tftest.hcl b/tests/schemaValidation_array_v0.tftest.hcl similarity index 91% rename from schemaValidation/array/v0/tests/unit.tftest.hcl rename to tests/schemaValidation_array_v0.tftest.hcl index accfd6d..011f36d 100644 --- a/schemaValidation/array/v0/tests/unit.tftest.hcl +++ b/tests/schemaValidation_array_v0.tftest.hcl @@ -1,5 +1,8 @@ run "missing_value" { command = plan + module { + source = "./schemaValidation/array/v0/" + } variables { metadata_name = "test" @@ -32,6 +35,9 @@ run "missing_value" { run "with_invalid_value" { command = plan + module { + source = "./schemaValidation/array/v0/" + } variables { metadata_name = "test" @@ -64,6 +70,9 @@ run "with_invalid_value" { run "with_wrong_minItems" { command = plan + module { + source = "./schemaValidation/array/v0/" + } variables { metadata_name = "test" @@ -96,6 +105,9 @@ run "with_wrong_minItems" { run "with_wrong_maxItems" { command = plan + module { + source = "./schemaValidation/array/v0/" + } variables { metadata_name = "test" @@ -128,6 +140,9 @@ run "with_wrong_maxItems" { run "with_valid_value" { command = plan + module { + source = "./schemaValidation/array/v0/" + } variables { metadata_name = "test" From 9325a1d293c8b6ff36b7425adf8a009fac4dee7c Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 12:13:49 -0300 Subject: [PATCH 05/20] Movendo testes do moduleo schemaValidation/reduced_object/v0 --- .../schemaValidation_reduced_object_v0.tftest.hcl | 9 +++++++++ 1 file changed, 9 insertions(+) rename schemaValidation/reduced_object/v0/tests/unit.tftest.hcl => tests/schemaValidation_reduced_object_v0.tftest.hcl (91%) diff --git a/schemaValidation/reduced_object/v0/tests/unit.tftest.hcl b/tests/schemaValidation_reduced_object_v0.tftest.hcl similarity index 91% rename from schemaValidation/reduced_object/v0/tests/unit.tftest.hcl rename to tests/schemaValidation_reduced_object_v0.tftest.hcl index 64c5c8d..f36828c 100644 --- a/schemaValidation/reduced_object/v0/tests/unit.tftest.hcl +++ b/tests/schemaValidation_reduced_object_v0.tftest.hcl @@ -1,5 +1,8 @@ run "missing_value" { command = plan + module { + source = "./schemaValidation/reduced_object/v0/" + } variables { metadata_name = "test" @@ -31,6 +34,9 @@ run "missing_value" { run "with_invalid_value" { command = plan + module { + source = "./schemaValidation/reduced_object/v0/" + } variables { metadata_name = "test" @@ -62,6 +68,9 @@ run "with_invalid_value" { run "with_valid_value" { command = plan + module { + source = "./schemaValidation/reduced_object/v0/" + } variables { metadata_name = "test" From 89c3f82be22d0a86610573d2f7040fbbb6c5314c Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:26:44 -0300 Subject: [PATCH 06/20] Movendo testes do modulo schemaValidation/root_object/v0 --- .../schemaValidation_root_object_v0.tftest.hcl | 9 +++++++++ 1 file changed, 9 insertions(+) rename schemaValidation/root_object/v0/tests/unit.tftest.hcl => tests/schemaValidation_root_object_v0.tftest.hcl (93%) diff --git a/schemaValidation/root_object/v0/tests/unit.tftest.hcl b/tests/schemaValidation_root_object_v0.tftest.hcl similarity index 93% rename from schemaValidation/root_object/v0/tests/unit.tftest.hcl rename to tests/schemaValidation_root_object_v0.tftest.hcl index b5315e6..0dea373 100644 --- a/schemaValidation/root_object/v0/tests/unit.tftest.hcl +++ b/tests/schemaValidation_root_object_v0.tftest.hcl @@ -1,5 +1,8 @@ run "missing_value" { command = plan + module { + source = "./schemaValidation/root_object/v0/" + } variables { metadata_name = "test" @@ -31,6 +34,9 @@ run "missing_value" { run "with_invalid_value" { command = plan + module { + source = "./schemaValidation/root_object/v0/" + } variables { metadata_name = "test" @@ -62,6 +68,9 @@ run "with_invalid_value" { run "with_valid_value" { command = plan + module { + source = "./schemaValidation/root_object/v0/" + } variables { metadata_name = "test" From 8efc249e65627603c4f05762ce5290f1fd344ee6 Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:28:57 -0300 Subject: [PATCH 07/20] Movendo testes do modulo schemaValidation/string/v0 --- .../schemaValidation_string_v0.tftest.hcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename schemaValidation/string/v0/tests/unit.tftest.hcl => tests/schemaValidation_string_v0.tftest.hcl (87%) diff --git a/schemaValidation/string/v0/tests/unit.tftest.hcl b/tests/schemaValidation_string_v0.tftest.hcl similarity index 87% rename from schemaValidation/string/v0/tests/unit.tftest.hcl rename to tests/schemaValidation_string_v0.tftest.hcl index 392d2c6..a88540e 100644 --- a/schemaValidation/string/v0/tests/unit.tftest.hcl +++ b/tests/schemaValidation_string_v0.tftest.hcl @@ -1,5 +1,8 @@ run "missing_value" { command = plan + module { + source = "./schemaValidation/string/v0/" + } variables { metadata_name = "test" @@ -24,6 +27,9 @@ run "missing_value" { run "with_invalid_value" { command = plan + module { + source = "./schemaValidation/string/v0/" + } variables { metadata_name = "test" @@ -48,6 +54,9 @@ run "with_invalid_value" { run "with_wrong_minLegnth" { command = plan + module { + source = "./schemaValidation/string/v0/" + } variables { metadata_name = "test" @@ -72,6 +81,9 @@ run "with_wrong_minLegnth" { run "with_wrong_maxLegnth" { command = plan + module { + source = "./schemaValidation/string/v0/" + } variables { metadata_name = "test" @@ -97,6 +109,9 @@ run "with_wrong_maxLegnth" { run "with_valid_value" { command = plan + module { + source = "./schemaValidation/string/v0/" + } variables { metadata_name = "test" From e43520cd5744a902f879971c978e22fe90ce674a Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:34:17 -0300 Subject: [PATCH 08/20] Movendo testes do modulo schemaValidation/reduced_array/v0 --- .../schemaValidation_reduced_array_v0.tftest.hcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename schemaValidation/reduced_array/v0/tests/unit.tftest.hcl => tests/schemaValidation_reduced_array_v0.tftest.hcl (89%) diff --git a/schemaValidation/reduced_array/v0/tests/unit.tftest.hcl b/tests/schemaValidation_reduced_array_v0.tftest.hcl similarity index 89% rename from schemaValidation/reduced_array/v0/tests/unit.tftest.hcl rename to tests/schemaValidation_reduced_array_v0.tftest.hcl index 3a55bb4..396a3ef 100644 --- a/schemaValidation/reduced_array/v0/tests/unit.tftest.hcl +++ b/tests/schemaValidation_reduced_array_v0.tftest.hcl @@ -1,5 +1,8 @@ run "missing_value" { command = plan + module { + source = "./schemaValidation/reduced_array/v0/" + } variables { metadata_name = "test" @@ -32,6 +35,9 @@ run "missing_value" { run "with_invalid_value" { command = plan + module { + source = "./schemaValidation/reduced_array/v0/" + } variables { metadata_name = "test" @@ -64,6 +70,9 @@ run "with_invalid_value" { run "with_wrong_minItems" { command = plan + module { + source = "./schemaValidation/reduced_array/v0/" + } variables { metadata_name = "test" @@ -96,6 +105,9 @@ run "with_wrong_minItems" { run "with_wrong_maxItems" { command = plan + module { + source = "./schemaValidation/reduced_array/v0/" + } variables { metadata_name = "test" @@ -128,6 +140,9 @@ run "with_wrong_maxItems" { run "with_valid_value" { command = plan + module { + source = "./schemaValidation/reduced_array/v0/" + } variables { metadata_name = "test" From 6998f7a226e87e7feac8070747ac53f6c01101a4 Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:37:10 -0300 Subject: [PATCH 09/20] Movendo testes do modulo schemaValidation/object/v0 --- .../schemaValidation_object_v0.tftest.hcl | 9 +++++++++ 1 file changed, 9 insertions(+) rename schemaValidation/object/v0/tests/unit.tftest.hcl => tests/schemaValidation_object_v0.tftest.hcl (93%) diff --git a/schemaValidation/object/v0/tests/unit.tftest.hcl b/tests/schemaValidation_object_v0.tftest.hcl similarity index 93% rename from schemaValidation/object/v0/tests/unit.tftest.hcl rename to tests/schemaValidation_object_v0.tftest.hcl index e38ddb3..ce585ad 100644 --- a/schemaValidation/object/v0/tests/unit.tftest.hcl +++ b/tests/schemaValidation_object_v0.tftest.hcl @@ -1,5 +1,8 @@ run "missing_value" { command = plan + module { + source = "./schemaValidation/object/v0/" + } variables { metadata_name = "test" @@ -31,6 +34,9 @@ run "missing_value" { run "with_invalid_value" { command = plan + module { + source = "./schemaValidation/object/v0/" + } variables { metadata_name = "test" @@ -62,6 +68,9 @@ run "with_invalid_value" { run "with_valid_value" { command = plan + module { + source = "./schemaValidation/object/v0/" + } variables { metadata_name = "test" From 72b1eece8cd9c397a54e65e8a87063dec8a7e9ab Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:38:49 -0300 Subject: [PATCH 10/20] Movendo testes do modulo schemaValidation/bool/v0 --- .../schemaValidation_bool_v0.tftest.hcl | 9 +++++++++ 1 file changed, 9 insertions(+) rename schemaValidation/bool/v0/tests/unit.tftest.hcl => tests/schemaValidation_bool_v0.tftest.hcl (86%) diff --git a/schemaValidation/bool/v0/tests/unit.tftest.hcl b/tests/schemaValidation_bool_v0.tftest.hcl similarity index 86% rename from schemaValidation/bool/v0/tests/unit.tftest.hcl rename to tests/schemaValidation_bool_v0.tftest.hcl index 4878973..c9607c1 100644 --- a/schemaValidation/bool/v0/tests/unit.tftest.hcl +++ b/tests/schemaValidation_bool_v0.tftest.hcl @@ -1,5 +1,8 @@ run "missing_value" { command = plan + module { + source = "./schemaValidation/bool/v0/" + } variables { metadata_name = "test" @@ -21,6 +24,9 @@ run "missing_value" { run "with_invalid_value" { command = plan + module { + source = "./schemaValidation/bool/v0/" + } variables { metadata_name = "test" @@ -42,6 +48,9 @@ run "with_invalid_value" { run "with_valid_value" { command = plan + module { + source = "./schemaValidation/bool/v0/" + } variables { metadata_name = "test" From fecd9ede4d94c986e0caefd97eaa93cb1c24cafd Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:40:38 -0300 Subject: [PATCH 11/20] Movendo testes do modulo schemaValidation/integer/v0 --- .../schemaValidation_integer_v0.tftest.hcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename schemaValidation/integer/v0/tests/unit.tftest.hcl => tests/schemaValidation_integer_v0.tftest.hcl (86%) diff --git a/schemaValidation/integer/v0/tests/unit.tftest.hcl b/tests/schemaValidation_integer_v0.tftest.hcl similarity index 86% rename from schemaValidation/integer/v0/tests/unit.tftest.hcl rename to tests/schemaValidation_integer_v0.tftest.hcl index da6532e..74a5aa7 100644 --- a/schemaValidation/integer/v0/tests/unit.tftest.hcl +++ b/tests/schemaValidation_integer_v0.tftest.hcl @@ -1,5 +1,8 @@ run "missing_value" { command = plan + module { + source = "./schemaValidation/integer/v0/" + } variables { metadata_name = "test" @@ -24,6 +27,9 @@ run "missing_value" { run "with_invalid_value" { command = plan + module { + source = "./schemaValidation/integer/v0/" + } variables { metadata_name = "test" @@ -48,6 +54,9 @@ run "with_invalid_value" { run "with_wrong_minLegnth" { command = plan + module { + source = "./schemaValidation/integer/v0/" + } variables { metadata_name = "test" @@ -72,6 +81,9 @@ run "with_wrong_minLegnth" { run "with_wrong_maxLegnth" { command = plan + module { + source = "./schemaValidation/integer/v0/" + } variables { metadata_name = "test" @@ -97,6 +109,9 @@ run "with_wrong_maxLegnth" { run "with_valid_value" { command = plan + module { + source = "./schemaValidation/integer/v0/" + } variables { metadata_name = "test" From 64f17fafa6173de33d6b55e4019402d698aad37e Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:43:55 -0300 Subject: [PATCH 12/20] Movendo testes do modulo CustomResourceDefinition/v1alpha1/array --- ...sourceDefinition_v1alpha1_array.tftest.hcl | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) rename CustomResourceDefinition/v1alpha1/array/tests/unit.tftest.hcl => tests/CustomResourceDefinition_v1alpha1_array.tftest.hcl (88%) diff --git a/CustomResourceDefinition/v1alpha1/array/tests/unit.tftest.hcl b/tests/CustomResourceDefinition_v1alpha1_array.tftest.hcl similarity index 88% rename from CustomResourceDefinition/v1alpha1/array/tests/unit.tftest.hcl rename to tests/CustomResourceDefinition_v1alpha1_array.tftest.hcl index 4408488..25c4c1b 100644 --- a/CustomResourceDefinition/v1alpha1/array/tests/unit.tftest.hcl +++ b/tests/CustomResourceDefinition_v1alpha1_array.tftest.hcl @@ -1,5 +1,8 @@ run "without_items" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -17,6 +20,9 @@ run "without_items" { run "without_minItems_and_maxItems_and_with_bool_items" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -51,6 +57,9 @@ run "without_minItems_and_maxItems_and_with_bool_items" { run "without_minItems_and_maxItems_and_with_string_items" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -89,6 +98,9 @@ run "without_minItems_and_maxItems_and_with_string_items" { run "without_minItems_and_maxItems_and_with_integer_items" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -127,6 +139,9 @@ run "without_minItems_and_maxItems_and_with_integer_items" { run "without_minItems_and_maxItems_and_with_reduced_object_items" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -177,6 +192,9 @@ run "without_minItems_and_maxItems_and_with_reduced_object_items" { run "with_minItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -212,6 +230,9 @@ run "with_minItems" { run "with_minLength_and_maxItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -248,6 +269,9 @@ run "with_minLength_and_maxItems" { run "with_invalid_minItems_and_maxItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -270,6 +294,9 @@ run "with_invalid_minItems_and_maxItems" { run "with_string_minItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -291,6 +318,9 @@ run "with_string_minItems" { run "with_string_maxItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -312,6 +342,9 @@ run "with_string_maxItems" { run "with_invalid_minItems_value" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" @@ -333,6 +366,9 @@ run "with_invalid_minItems_value" { run "with_invalid_maxItems_value" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/array/" + } variables { metadata_name = "test" From b984858cfac52696c8c09811c9198ea853d30a4d Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:47:27 -0300 Subject: [PATCH 13/20] Movendo testes do modulo CustomResourceDefinition/v1alpha1/version --- .../CustomResourceDefinition_v1alpha1_version.tftest.hcl | 9 +++++++++ 1 file changed, 9 insertions(+) rename CustomResourceDefinition/v1alpha1/version/tests/unit.tftest.hcl => tests/CustomResourceDefinition_v1alpha1_version.tftest.hcl (85%) diff --git a/CustomResourceDefinition/v1alpha1/version/tests/unit.tftest.hcl b/tests/CustomResourceDefinition_v1alpha1_version.tftest.hcl similarity index 85% rename from CustomResourceDefinition/v1alpha1/version/tests/unit.tftest.hcl rename to tests/CustomResourceDefinition_v1alpha1_version.tftest.hcl index d7d7e87..a472fd0 100644 --- a/CustomResourceDefinition/v1alpha1/version/tests/unit.tftest.hcl +++ b/tests/CustomResourceDefinition_v1alpha1_version.tftest.hcl @@ -1,5 +1,8 @@ run "missing_name" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/version/" + } variables { metadata_name = "test" @@ -15,6 +18,9 @@ run "missing_name" { run "missing_specSchema" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/version/" + } variables { metadata_name = "test" @@ -32,6 +38,9 @@ run "missing_specSchema" { run "with_specSchema" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/version/" + } variables { metadata_name = "test" From ddfdc2a02978dbe6e9791cdc968dd689af2e7a6c Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:49:38 -0300 Subject: [PATCH 14/20] Movendo testes do modulo CustomResourceDefinition/v1alpha1/reduced_object --- ...eDefinition_v1alpha1_reduced_object.tftest.hcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename CustomResourceDefinition/v1alpha1/reduced_object/tests/unit.tftest.hcl => tests/CustomResourceDefinition_v1alpha1_reduced_object.tftest.hcl (88%) diff --git a/CustomResourceDefinition/v1alpha1/reduced_object/tests/unit.tftest.hcl b/tests/CustomResourceDefinition_v1alpha1_reduced_object.tftest.hcl similarity index 88% rename from CustomResourceDefinition/v1alpha1/reduced_object/tests/unit.tftest.hcl rename to tests/CustomResourceDefinition_v1alpha1_reduced_object.tftest.hcl index 9e4b247..133e014 100644 --- a/CustomResourceDefinition/v1alpha1/reduced_object/tests/unit.tftest.hcl +++ b/tests/CustomResourceDefinition_v1alpha1_reduced_object.tftest.hcl @@ -1,5 +1,8 @@ run "without_properties" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_object/" + } variables { metadata_name = "test" @@ -17,6 +20,9 @@ run "without_properties" { run "with_invalid_properties" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_object/" + } variables { metadata_name = "test" @@ -35,6 +41,9 @@ run "with_invalid_properties" { run "with_properties_missing_type" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_object/" + } variables { metadata_name = "test" @@ -55,6 +64,9 @@ run "with_properties_missing_type" { run "with_properties_invalid_type" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_object/" + } variables { metadata_name = "test" @@ -77,6 +89,9 @@ run "with_properties_invalid_type" { run "with_properties" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_object/" + } variables { metadata_name = "test" From a34fded0034a9195ceba2b1f8555fceb4aaa8c4c Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:52:20 -0300 Subject: [PATCH 15/20] Movendo testes do modulo CustomResourceDefinition/v1alpha1/root_object --- ...urceDefinition_v1alpha1_root_object.tftest.hcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename CustomResourceDefinition/v1alpha1/root_object/tests/unit.tftest.hcl => tests/CustomResourceDefinition_v1alpha1_root_object.tftest.hcl (90%) diff --git a/CustomResourceDefinition/v1alpha1/root_object/tests/unit.tftest.hcl b/tests/CustomResourceDefinition_v1alpha1_root_object.tftest.hcl similarity index 90% rename from CustomResourceDefinition/v1alpha1/root_object/tests/unit.tftest.hcl rename to tests/CustomResourceDefinition_v1alpha1_root_object.tftest.hcl index e1659c1..6a8d946 100644 --- a/CustomResourceDefinition/v1alpha1/root_object/tests/unit.tftest.hcl +++ b/tests/CustomResourceDefinition_v1alpha1_root_object.tftest.hcl @@ -1,5 +1,8 @@ run "without_properties" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/root_object/" + } variables { metadata_name = "test" @@ -17,6 +20,9 @@ run "without_properties" { run "with_invalid_properties" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/root_object/" + } variables { metadata_name = "test" @@ -35,6 +41,9 @@ run "with_invalid_properties" { run "with_properties_missing_type" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/root_object/" + } variables { metadata_name = "test" @@ -55,6 +64,9 @@ run "with_properties_missing_type" { run "with_properties_invalid_type" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/root_object/" + } variables { metadata_name = "test" @@ -77,6 +89,9 @@ run "with_properties_invalid_type" { run "with_properties" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/root_object/" + } variables { metadata_name = "test" From 8e55e04675692ba604efb11fe3d9c181bad35a13 Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:54:11 -0300 Subject: [PATCH 16/20] Movendo testes do modulo CustomResourceDefinition/v1alpha1/string --- ...ourceDefinition_v1alpha1_string.tftest.hcl | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) rename CustomResourceDefinition/v1alpha1/string/tests/unit.tftest.hcl => tests/CustomResourceDefinition_v1alpha1_string.tftest.hcl (84%) diff --git a/CustomResourceDefinition/v1alpha1/string/tests/unit.tftest.hcl b/tests/CustomResourceDefinition_v1alpha1_string.tftest.hcl similarity index 84% rename from CustomResourceDefinition/v1alpha1/string/tests/unit.tftest.hcl rename to tests/CustomResourceDefinition_v1alpha1_string.tftest.hcl index f1f2347..7722054 100644 --- a/CustomResourceDefinition/v1alpha1/string/tests/unit.tftest.hcl +++ b/tests/CustomResourceDefinition_v1alpha1_string.tftest.hcl @@ -1,5 +1,8 @@ run "without_minLength_and_maxLength" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/string" + } variables { metadata_name = "test" @@ -26,6 +29,9 @@ run "without_minLength_and_maxLength" { run "with_minLength" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/string" + } variables { metadata_name = "test" @@ -53,6 +59,9 @@ run "with_minLength" { run "with_minLength_and_maxLength" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/string" + } variables { metadata_name = "test" @@ -81,6 +90,9 @@ run "with_minLength_and_maxLength" { run "with_invalid_minLength_and_maxLength" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/string" + } variables { metadata_name = "test" @@ -100,6 +112,9 @@ run "with_invalid_minLength_and_maxLength" { run "with_string_minLength" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/string" + } variables { metadata_name = "test" @@ -118,6 +133,9 @@ run "with_string_minLength" { run "with_string_maxLength" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/string" + } variables { metadata_name = "test" @@ -136,6 +154,9 @@ run "with_string_maxLength" { run "with_invalid_minLength_value" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/string" + } variables { metadata_name = "test" @@ -154,6 +175,9 @@ run "with_invalid_minLength_value" { run "with_invalid_maxLength_value" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/string" + } variables { metadata_name = "test" From 6d22f972b1e4dc9d4fe920ae3b93cc69fec3b22c Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 14:56:36 -0300 Subject: [PATCH 17/20] Movendo testes do modulo CustomResourceDefinition/v1alpha1/reduced_array --- ...finition_v1alpha1_reduced_array.tftest.hcl | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) rename CustomResourceDefinition/v1alpha1/reduced_array/tests/unit.tftest.hcl => tests/CustomResourceDefinition_v1alpha1_reduced_array.tftest.hcl (86%) diff --git a/CustomResourceDefinition/v1alpha1/reduced_array/tests/unit.tftest.hcl b/tests/CustomResourceDefinition_v1alpha1_reduced_array.tftest.hcl similarity index 86% rename from CustomResourceDefinition/v1alpha1/reduced_array/tests/unit.tftest.hcl rename to tests/CustomResourceDefinition_v1alpha1_reduced_array.tftest.hcl index 8b3260f..6ccbb62 100644 --- a/CustomResourceDefinition/v1alpha1/reduced_array/tests/unit.tftest.hcl +++ b/tests/CustomResourceDefinition_v1alpha1_reduced_array.tftest.hcl @@ -1,5 +1,8 @@ run "without_items" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -17,6 +20,9 @@ run "without_items" { run "without_minItems_and_maxItems_and_with_bool_items" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -51,6 +57,9 @@ run "without_minItems_and_maxItems_and_with_bool_items" { run "without_minItems_and_maxItems_and_with_string_items" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -89,6 +98,9 @@ run "without_minItems_and_maxItems_and_with_string_items" { run "without_minItems_and_maxItems_and_with_integer_items" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -127,6 +139,9 @@ run "without_minItems_and_maxItems_and_with_integer_items" { run "with_minItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -162,6 +177,9 @@ run "with_minItems" { run "with_minLength_and_maxItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -198,6 +216,9 @@ run "with_minLength_and_maxItems" { run "with_invalid_minItems_and_maxItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -220,6 +241,9 @@ run "with_invalid_minItems_and_maxItems" { run "with_string_minItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -241,6 +265,9 @@ run "with_string_minItems" { run "with_string_maxItems" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -262,6 +289,9 @@ run "with_string_maxItems" { run "with_invalid_minItems_value" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" @@ -283,6 +313,9 @@ run "with_invalid_minItems_value" { run "with_invalid_maxItems_value" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/reduced_array" + } variables { metadata_name = "test" From a26653c02ad4dd1308e36830460737d5276fbe62 Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 15:00:08 -0300 Subject: [PATCH 18/20] Movendo testes do modulo CustomResourceDefinition/v1alpha1/object --- ...mResourceDefinition_v1alpha1_object.tftest.hcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename CustomResourceDefinition/v1alpha1/object/tests/unit.tftest.hcl => tests/CustomResourceDefinition_v1alpha1_object.tftest.hcl (91%) diff --git a/CustomResourceDefinition/v1alpha1/object/tests/unit.tftest.hcl b/tests/CustomResourceDefinition_v1alpha1_object.tftest.hcl similarity index 91% rename from CustomResourceDefinition/v1alpha1/object/tests/unit.tftest.hcl rename to tests/CustomResourceDefinition_v1alpha1_object.tftest.hcl index cc1deed..9532849 100644 --- a/CustomResourceDefinition/v1alpha1/object/tests/unit.tftest.hcl +++ b/tests/CustomResourceDefinition_v1alpha1_object.tftest.hcl @@ -1,5 +1,8 @@ run "without_properties" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/object" + } variables { metadata_name = "test" @@ -17,6 +20,9 @@ run "without_properties" { run "with_invalid_properties" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/object" + } variables { metadata_name = "test" @@ -35,6 +41,9 @@ run "with_invalid_properties" { run "with_properties_missing_type" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/object" + } variables { metadata_name = "test" @@ -55,6 +64,9 @@ run "with_properties_missing_type" { run "with_properties_invalid_type" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/object" + } variables { metadata_name = "test" @@ -77,6 +89,9 @@ run "with_properties_invalid_type" { run "with_properties" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/object" + } variables { metadata_name = "test" From 35bd59db8e547d0f1644c7f1d12bd3118ddb391b Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 15:00:27 -0300 Subject: [PATCH 19/20] Movendo testes do modulo CustomResourceDefinition/v1alpha1/integer --- ...ourceDefinition_v1alpha1_integer.tftest.hcl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) rename CustomResourceDefinition/v1alpha1/integer/tests/unit.tftest.hcl => tests/CustomResourceDefinition_v1alpha1_integer.tftest.hcl (84%) diff --git a/CustomResourceDefinition/v1alpha1/integer/tests/unit.tftest.hcl b/tests/CustomResourceDefinition_v1alpha1_integer.tftest.hcl similarity index 84% rename from CustomResourceDefinition/v1alpha1/integer/tests/unit.tftest.hcl rename to tests/CustomResourceDefinition_v1alpha1_integer.tftest.hcl index 89b26aa..1fa42ee 100644 --- a/CustomResourceDefinition/v1alpha1/integer/tests/unit.tftest.hcl +++ b/tests/CustomResourceDefinition_v1alpha1_integer.tftest.hcl @@ -1,5 +1,8 @@ run "without_minimum_and_maximum" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/integer" + } variables { metadata_name = "test" @@ -26,6 +29,9 @@ run "without_minimum_and_maximum" { run "with_minimum" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/integer" + } variables { metadata_name = "test" @@ -53,6 +59,9 @@ run "with_minimum" { run "with_minimum_and_maximum" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/integer" + } variables { metadata_name = "test" @@ -81,6 +90,9 @@ run "with_minimum_and_maximum" { run "with_invalid_minimum_and_maximum" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/integer" + } variables { metadata_name = "test" @@ -100,6 +112,9 @@ run "with_invalid_minimum_and_maximum" { run "with_string_minimum" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/integer" + } variables { metadata_name = "test" @@ -118,6 +133,9 @@ run "with_string_minimum" { run "with_string_maximum" { command = plan + module { + source = "./CustomResourceDefinition/v1alpha1/integer" + } variables { metadata_name = "test" From 419284096599a8a8527a77e50f2b49afccade40a Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Thu, 26 Sep 2024 15:02:06 -0300 Subject: [PATCH 20/20] Ajustando o workflow de PR para rodar os testes --- .github/workflows/pr.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5912db9..617f5e2 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,16 +26,8 @@ jobs: - name: Terraform init (v${{matrix.terraform_version}}) run: | - for i in $(find . -name tests -exec dirname {} \;); do - echo "Running tests for: \"$i\"" - terraform -chdir="$i" init - echo; - done + terraform init - name: Run Tests run: | - for i in $(find . -name tests -exec dirname {} \;); do - echo "Running tests for: \"$i\"" - terraform -chdir="$i" test - echo; - done + terraform test