Skip to content
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
29 changes: 14 additions & 15 deletions test/e2e/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ var _ = Describe("[cluster-ns] Configuration namespaced. Deploy cluster", func()
},
30002,
)),
// Entry(newData("Multiregion, Backup and 2 users", "data/atlascluster_multiregion.yaml",
// append(
// []utils.DBUser{},
// *utils.NewDBUser("user1").
// WithSecretRef("dbuser-secret-u1").
// AddRole("atlasAdmin", "admin", ""),
// *utils.NewDBUser("user2").
// WithSecretRef("dbuser-secret-u2").
// AddRole("atlasAdmin", "admin", ""),
// ),
// )), // TODO CLOUDP-83419
Entry(newData("Multiregion, Backup and 2 users", "data/atlascluster_multiregion.yaml",
[]model.DBUser{
*model.NewDBUser("user1").
WithSecretRef("dbuser-secret-u1").
AddRole("atlasAdmin", "admin", ""),
*model.NewDBUser("user2").
WithSecretRef("dbuser-secret-u2").
AddRole("atlasAdmin", "admin", ""),
},
30004,
)),
)
})

Expand Down Expand Up @@ -133,7 +133,6 @@ func mainCycle(clusterConfigurationFile string, resources model.UserInputs, port

By("Create namespaced Operator\n", func() {
CopyKustomizeNamespaceOperator(resources)
// CreateCopyKustomizeNamespace(resources.namespace)
kube.Apply("-k", resources.GetOperatorFolder())
Eventually(
kube.GetPodStatus(resources.Namespace),
Expand Down Expand Up @@ -168,9 +167,9 @@ func mainCycle(clusterConfigurationFile string, resources model.UserInputs, port
})

By("Deploy application for user", func() {
// // kube apply application
// // send ddata
// // retrieve data
// kube apply application
// send data
// retrieve data
for i, user := range resources.Users { // TODO in parallel(?)
// data
port := strconv.Itoa(i + portGroup)
Expand Down
19 changes: 16 additions & 3 deletions test/e2e/user_input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,28 @@ func compareClustersSpec(requested model.ClusterSpec, created mongodbatlas.Clust
"ProviderSettings": PointTo(MatchFields(IgnoreExtras, Fields{
"InstanceSizeName": Equal(requested.ProviderSettings.InstanceSizeName),
"ProviderName": Equal(string(requested.ProviderSettings.ProviderName)),
"RegionName": Equal(requested.ProviderSettings.RegionName),
})),
"ConnectionStrings": PointTo(MatchFields(IgnoreExtras, Fields{
"Standard": Not(BeEmpty()),
"StandardSrv": Not(BeEmpty()),
})),
}), "Cluster should be the same as requested by the user")

if len(requested.ReplicationSpecs) > 0 {
for i, replica := range requested.ReplicationSpecs {
for key, region := range replica.RegionsConfig {
// diffent type
ExpectWithOffset(1, created.ReplicationSpecs[i].RegionsConfig[key].AnalyticsNodes).Should(PointTo(Equal(*region.AnalyticsNodes)), "Replica Spec: AnalyticsNodes is not the same")
ExpectWithOffset(1, created.ReplicationSpecs[i].RegionsConfig[key].ElectableNodes).Should(PointTo(Equal(*region.ElectableNodes)), "Replica Spec: ElectableNodes is not the same")
ExpectWithOffset(1, created.ReplicationSpecs[i].RegionsConfig[key].Priority).Should(PointTo(Equal(*region.Priority)), "Replica Spec: Priority is not the same")
ExpectWithOffset(1, created.ReplicationSpecs[i].RegionsConfig[key].ReadOnlyNodes).Should(PointTo(Equal(*region.ReadOnlyNodes)), "Replica Spec: ReadOnlyNodes is not the same")
}
}
} else {
ExpectWithOffset(1, requested.ProviderSettings).To(PointTo(MatchFields(IgnoreExtras, Fields{
"RegionName": Equal(created.ProviderSettings.RegionName),
})), "Cluster should be the same as requested by the user: Region Name")
}
}

func SaveK8sResources(resources []string, ns string) {
Expand Down Expand Up @@ -110,9 +125,7 @@ func checkUsersAttributes(input model.UserInputs) {

// CopyKustomizeNamespaceOperator create copy of `/deploy/namespaced` folder with kustomization file for overriding namespace
func CopyKustomizeNamespaceOperator(input model.UserInputs) {
// fullPath := filepath.Join("data", input.projectName, "operator")
fullPath := input.GetOperatorFolder()
// fullPath := filepath.Dir(projectPath)
os.Mkdir(fullPath, os.ModePerm)
utils.CopyFile("../../deploy/namespaced/crds.yaml", filepath.Join(fullPath, "crds.yaml"))
utils.CopyFile("../../deploy/namespaced/namespaced-config.yaml", filepath.Join(fullPath, "namespaced-config.yaml"))
Expand Down