Skip to content

Commit

Permalink
Adjust and separate deployment sharding test (#1477)
Browse files Browse the repository at this point in the history
  • Loading branch information
helderjs authored Mar 26, 2024
1 parent e497d76 commit e75d5b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 15 additions & 3 deletions test/int/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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()
Expand Down

0 comments on commit e75d5b7

Please sign in to comment.