From cea17e7ae979f121f8f794e114b759e17c8c6a4b Mon Sep 17 00:00:00 2001 From: Helder Santana Date: Tue, 26 Mar 2024 15:22:36 +0100 Subject: [PATCH] Adjust and separate deployment sharding test --- .github/workflows/test-int.yml | 2 +- test/int/deployment_test.go | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-int.yml b/.github/workflows/test-int.yml index 339223227b..848ae9cae8 100644 --- a/.github/workflows/test-int.yml +++ b/.github/workflows/test-int.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - test: ["AtlasProject", "AtlasDeployment", "AtlasDatabaseUser", "AtlasDataFederation", "AtlasFederatedAuth"] + test: ["AtlasProject", "AtlasDeployment", "AtlasDatabaseUser", "AtlasDataFederation", "AtlasFederatedAuth", "deployment-sharding"] path: [ "./test/int" ] nodes: [12] include: diff --git a/test/int/deployment_test.go b/test/int/deployment_test.go index 1449e55dec..c8847c8ec9 100644 --- a/test/int/deployment_test.go +++ b/test/int/deployment_test.go @@ -339,7 +339,7 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment", "deployment- }) }) - Describe("Create deployment & change ReplicationSpecs", func() { + Describe("Create deployment & change ReplicationSpecs", Label("deployment-sharding"), func() { It("Should Succeed", func() { createdDeployment = akov2.DefaultAWSDeployment(namespace.Name, createdProject.Name) @@ -363,10 +363,22 @@ var _ = Describe("AtlasDeployment", Label("int", "AtlasDeployment", "deployment- checkAtlasState(replicationSpecsCheck, singleNumShard) }) - By("Updating ReplicationSpecs", func() { + By("Upgrade to sharded", func() { + createdDeployment.Spec.DeploymentSpec.ClusterType = "SHARDED" + + performUpdate(40 * time.Minute) + doDeploymentStatusChecks() + + singleNumShard := func(deployment *admin.AdvancedClusterDescription) { + Expect(deployment.GetReplicationSpecs()[0].GetNumShards()).To(Equal(1)) + } + // ReplicationSpecs has the same defaults but the number of shards has changed + checkAtlasState(replicationSpecsCheck, singleNumShard) + }) + + By("Increase number of shards", func() { numShards := 2 createdDeployment.Spec.DeploymentSpec.ReplicationSpecs[0].NumShards = numShards - createdDeployment.Spec.DeploymentSpec.ClusterType = "SHARDED" performUpdate(40 * time.Minute) doDeploymentStatusChecks()