Skip to content

CLOUDP-326228: Extend E2E tests with more scenarios #3992

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

Merged
merged 10 commits into from
Jun 20, 2025
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/update-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
- atlas,serverless,instance
- atlas,streams
- atlas,streams_with_cluster
- atlas,clusters,iss
- brew
- config
- atlas,iam
Expand Down
Binary file added test/e2e/.DS_Store
Binary file not shown.
55 changes: 55 additions & 0 deletions test/e2e/clustersiss/clusters_iss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,61 @@ func TestIndependendShardScalingCluster(t *testing.T) {
assert.Len(t, cluster.GetReplicationSpecs(), 2)
})

g.Run("Pause ISS cluster with the wrong flag", func(_ *testing.T) {
cmd := exec.Command(cliPath,
clustersEntity,
"pause",
issClusterName,
"--autoScalingMode",
"clusterWideScaling",
"--output",
"json",
)

cmd.Env = os.Environ()
resp, err := internal.RunAndGetStdOut(cmd)
req.NoError(err, string(resp))

var cluster admin.ClusterDescription20240805
req.NoError(json.Unmarshal(resp, &cluster))
})

g.Run("Check autoScalingMode is independentShardScaling", func(_ *testing.T) {
cmd := exec.Command(cliPath,
clustersEntity,
"autoScalingConfig",
issClusterName,
"-o=json",
)

cmd.Env = os.Environ()
resp, err := internal.RunAndGetStdOut(cmd)
req.NoError(err, string(resp))

var config admin.ClusterDescriptionAutoScalingModeConfiguration
req.NoError(json.Unmarshal(resp, &config))
assert.Equal(t, "INDEPENDENT_SHARD_SCALING", config.GetAutoScalingMode())
})

g.Run("Start ISS cluster", func(_ *testing.T) {
cmd := exec.Command(cliPath,
clustersEntity,
"start",
issClusterName,
"--autoScalingMode",
"independentShardScaling",
"--output",
"json",
)

cmd.Env = os.Environ()
resp, err := internal.RunAndGetStdOut(cmd)
req.NoError(err, string(resp))

var cluster admin.ClusterDescription20240805
req.NoError(json.Unmarshal(resp, &cluster))
})

g.Run("Get ISS cluster autoScalingMode", func(t *testing.T) { //nolint:thelper // g.Run replaces t.Run
cmd := exec.Command(cliPath,
clustersEntity,
Expand Down
19 changes: 19 additions & 0 deletions test/e2e/clustersissfile/clusters_iss_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,25 @@ func TestISSClustersFile(t *testing.T) {
req.NoError(json.Unmarshal(resp, &cluster))
})

g.Run("Update ISS cluster with file", func(_ *testing.T) {
cmd := exec.Command(cliPath,
clustersEntity,
"update",
clusterIssFileName,
"--file",
"testdata/create_iss_cluster_test_update.json",
"--output",
"json",
)

cmd.Env = os.Environ()
resp, err := internal.RunAndGetStdOut(cmd)
req.NoError(err, string(resp))

var cluster admin.ClusterDescription20240805
req.NoError(json.Unmarshal(resp, &cluster))
})

g.Run("Delete ISS Cluster - created via file", func(_ *testing.T) {
cmd := exec.Command(
cliPath,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HTTP/2.0 201 Created
Content-Length: 472
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
Date: Fri, 20 Jun 2025 14:37:27 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 91
X-Frame-Options: DENY
X-Java-Method: ApiAtlasNetworkAccessListResource::addAtlasWhitelist
X-Java-Version: 17.0.14+7
X-Mongodb-Service-Version: gitHash=c9cc80704805413f1d20ccd4de364bd36cd66b6b; versionString=master
X-Permitted-Cross-Domain-Policies: none

{"links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68557223e16f343ef1ded503/accessList?includeCount=true&pageNum=1&itemsPerPage=100","rel":"self"}],"results":[{"cidrBlock":"192.168.0.144/32","comment":"test","deleteAfterDate":"2025-06-20T14:42:27Z","groupId":"68557223e16f343ef1ded503","ipAddress":"192.168.0.144","links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68557223e16f343ef1ded503/accessList/192.168.0.144%2F32","rel":"self"}]}],"totalCount":1}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HTTP/2.0 201 Created
Content-Length: 431
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
Date: Fri, 20 Jun 2025 14:37:26 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 92
X-Frame-Options: DENY
X-Java-Method: ApiAtlasNetworkAccessListResource::addAtlasWhitelist
X-Java-Version: 17.0.14+7
X-Mongodb-Service-Version: gitHash=c9cc80704805413f1d20ccd4de364bd36cd66b6b; versionString=master
X-Permitted-Cross-Domain-Policies: none

{"links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68557223e16f343ef1ded503/accessList?includeCount=true&pageNum=1&itemsPerPage=100","rel":"self"}],"results":[{"cidrBlock":"192.168.0.144/32","comment":"test","groupId":"68557223e16f343ef1ded503","ipAddress":"192.168.0.144","links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68557223e16f343ef1ded503/accessList/192.168.0.144%2F32","rel":"self"}]}],"totalCount":1}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
HTTP/2.0 200 OK
Content-Length: 36
Content-Length: 40
Content-Type: application/json
Date: Tue, 17 Jun 2025 13:33:02 GMT
Date: Fri, 20 Jun 2025 14:37:27 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Java-Method: ApiPrivateIpInfoResource::getIpInfo
X-Java-Version: 17.0.14+7
X-Mongodb-Service-Version: gitHash=1ab676b47c305241bdf9a34bc95947dde225deff; versionString=master
X-Mongodb-Service-Version: gitHash=c9cc80704805413f1d20ccd4de364bd36cd66b6b; versionString=master
X-Permitted-Cross-Domain-Policies: none
X-Xgen-Up-Proto: HTTP/2

{"currentIpv4Address":"20.57.79.89"}
{"currentIpv4Address":"172.183.133.172"}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HTTP/2.0 201 Created
Content-Length: 437
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
Date: Fri, 20 Jun 2025 14:37:28 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 92
X-Frame-Options: DENY
X-Java-Method: ApiAtlasNetworkAccessListResource::addAtlasWhitelist
X-Java-Version: 17.0.14+7
X-Mongodb-Service-Version: gitHash=c9cc80704805413f1d20ccd4de364bd36cd66b6b; versionString=master
X-Permitted-Cross-Domain-Policies: none

{"links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68557223e16f343ef1ded503/accessList?includeCount=true&pageNum=1&itemsPerPage=100","rel":"self"}],"results":[{"cidrBlock":"172.183.133.172/32","comment":"test","groupId":"68557223e16f343ef1ded503","ipAddress":"172.183.133.172","links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68557223e16f343ef1ded503/accessList/172.183.133.172%2F32","rel":"self"}]}],"totalCount":1}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
HTTP/2.0 204 No Content
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
Date: Fri, 20 Jun 2025 14:37:27 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 84
X-Frame-Options: DENY
X-Java-Method: ApiAtlasNetworkAccessListResource::deleteAtlasWhitelist
X-Java-Version: 17.0.14+7
X-Mongodb-Service-Version: gitHash=c9cc80704805413f1d20ccd4de364bd36cd66b6b; versionString=master
X-Permitted-Cross-Domain-Policies: none

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
HTTP/2.0 204 No Content
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
Date: Fri, 20 Jun 2025 14:37:28 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 70
X-Frame-Options: DENY
X-Java-Method: ApiAtlasNetworkAccessListResource::deleteAtlasWhitelist
X-Java-Version: 17.0.14+7
X-Mongodb-Service-Version: gitHash=c9cc80704805413f1d20ccd4de364bd36cd66b6b; versionString=master
X-Permitted-Cross-Domain-Policies: none

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
HTTP/2.0 204 No Content
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
Date: Fri, 20 Jun 2025 14:37:27 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 66
X-Frame-Options: DENY
X-Java-Method: ApiAtlasNetworkAccessListResource::deleteAtlasWhitelist
X-Java-Version: 17.0.14+7
X-Mongodb-Service-Version: gitHash=c9cc80704805413f1d20ccd4de364bd36cd66b6b; versionString=master
X-Permitted-Cross-Domain-Policies: none

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HTTP/2.0 200 OK
Content-Length: 245
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
Date: Fri, 20 Jun 2025 14:37:26 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 31
X-Frame-Options: DENY
X-Java-Method: ApiAtlasNetworkAccessListResource::getAtlasNetworkPermissionEntry
X-Java-Version: 17.0.14+7
X-Mongodb-Service-Version: gitHash=c9cc80704805413f1d20ccd4de364bd36cd66b6b; versionString=master
X-Permitted-Cross-Domain-Policies: none

{"cidrBlock":"192.168.0.144/32","comment":"test","groupId":"68557223e16f343ef1ded503","ipAddress":"192.168.0.144","links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68557223e16f343ef1ded503/accessList/192.168.0.144%2F32","rel":"self"}]}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HTTP/2.0 200 OK
Content-Length: 431
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
Date: Fri, 20 Jun 2025 14:37:26 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 29
X-Frame-Options: DENY
X-Java-Method: ApiAtlasNetworkAccessListResource::getAtlasWhitelist
X-Java-Version: 17.0.14+7
X-Mongodb-Service-Version: gitHash=c9cc80704805413f1d20ccd4de364bd36cd66b6b; versionString=master
X-Permitted-Cross-Domain-Policies: none

{"links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68557223e16f343ef1ded503/accessList?includeCount=true&pageNum=1&itemsPerPage=100","rel":"self"}],"results":[{"cidrBlock":"192.168.0.144/32","comment":"test","groupId":"68557223e16f343ef1ded503","ipAddress":"192.168.0.144","links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68557223e16f343ef1ded503/accessList/192.168.0.144%2F32","rel":"self"}]}],"totalCount":1}
Loading
Loading