Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deployment sharding test #1477

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading