From b735694f71fcb392b988f16ac7eaac3ea2957bc4 Mon Sep 17 00:00:00 2001 From: Gabriele Quaresima Date: Wed, 9 Oct 2024 11:00:51 +0200 Subject: [PATCH] test: change the way the namespace is created (and deleted), in order to delete it during the suite execution, not after Signed-off-by: Gabriele Quaresima --- .../declarative_database_management_test.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/e2e/declarative_database_management_test.go b/tests/e2e/declarative_database_management_test.go index 4e8d55926c..3223b0dfc9 100644 --- a/tests/e2e/declarative_database_management_test.go +++ b/tests/e2e/declarative_database_management_test.go @@ -51,20 +51,21 @@ var _ = Describe("Declarative databases management test", Label(tests.LabelSmoke Context("plain vanilla cluster", Ordered, func() { const ( - namespacePrefix = "declarative-db" - dbname = "declarative" + namespace = "declarative-db" + dbname = "declarative" ) var ( - clusterName, namespace, databaseObjectName string - database *apiv1.Database - databaseWithDeleteRetainPolicy *apiv1.Database - err error - databaseWithDeleteRetainPolicyCrdName = "db-declarative-delete" + clusterName, databaseObjectName string + database *apiv1.Database + databaseWithDeleteRetainPolicy *apiv1.Database + err error + databaseWithDeleteRetainPolicyCrdName = "db-declarative-delete" ) BeforeAll(func() { - // Create a cluster in a namespace we'll delete after the test - namespace, err = env.CreateUniqueTestNamespace(namespacePrefix) + // We set the namespace name as a constant, as we are going to test the namespace deletion inside + // the suite (not after), in order to check the finalizers removal + err = env.CreateNamespace(namespace) Expect(err).ToNot(HaveOccurred()) clusterName, err = env.GetResourceNameFromYAML(clusterManifest)