Skip to content

Commit a843f04

Browse files
improving comment of why single test group is challenging
1 parent cfd5afe commit a843f04

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

.github/workflows/e2e-testing.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ jobs:
6161
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
6262
MONGODB_ATLAS_BASE_URL: https://cloud-dev.mongodb.com/
6363
MONGODB_ATLAS_SECRET_PROFILE: cfn-cloud-dev-github-action
64-
# run idividual test allowing for parallel execution. Due to usage of t.Setenv() in test code, t.Parallel() is not possible
6564
run: |
6665
cd cfn-resources/test/e2e/cluster
6766
go test -timeout 90m -v -run '^TestClusterCFN$' .
6867
68+
# Run idividual test in separate test group for parallel execution.
69+
# Due to usage of t.Setenv() in test code t.Parallel() is not possible.
70+
# Having both tests run in same `go test` execution is not possible due to scripts used for private registry publishing modifying same files
6971
cluster-pause:
7072
needs: change-detection
7173
if: ${{ needs.change-detection.outputs.cluster == 'true' }}
@@ -93,7 +95,6 @@ jobs:
9395
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
9496
MONGODB_ATLAS_BASE_URL: https://cloud-dev.mongodb.com/
9597
MONGODB_ATLAS_SECRET_PROFILE: cfn-cloud-dev-github-action
96-
# run idividual test allowing for parallel execution. Due to usage of t.Setenv() in test code, t.Parallel() is not possible
9798
run: |
9899
cd cfn-resources/test/e2e/cluster
99100
go test -timeout 90m -v -run '^TestClusterPauseCFN$' .

cfn-resources/test/e2e/cluster/cluster_pause_test.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ func testCreatePauseStack(t *testing.T, c *pauseTestContext) {
140140

141141
cluster := readPauseClusterFromAtlas(t, c)
142142

143-
a := assert.New(t)
144-
a.Equal(cluster.GetId(), clusterID)
145-
a.False(cluster.GetPaused())
143+
assert.Equal(t, cluster.GetId(), clusterID)
144+
assert.False(t, cluster.GetPaused())
146145
}
147146

148147
func testUpdatePauseState(t *testing.T, c *pauseTestContext, pause bool) {
@@ -163,20 +162,14 @@ func testUpdatePauseState(t *testing.T, c *pauseTestContext, pause bool) {
163162

164163
cluster := readPauseClusterFromAtlas(t, c)
165164

166-
a := assert.New(t)
167-
if pause {
168-
a.True(cluster.GetPaused())
169-
} else {
170-
a.False(cluster.GetPaused())
171-
}
165+
assert.Equal(t, pause, cluster.GetPaused())
172166
}
173167

174168
func testDeletePauseStack(t *testing.T, c *pauseTestContext) {
175169
t.Helper()
176170
utility.DeleteStack(t, c.cfnClient, pauseStackName)
177-
a := assert.New(t)
178171
_, resp, _ := c.atlasClient20231115014.ClustersApi.GetCluster(ctx.Background(), c.clusterTmplObj.ProjectID, c.clusterTmplObj.Name).Execute()
179-
a.Equal(404, resp.StatusCode)
172+
assert.Equal(t, 404, resp.StatusCode)
180173
}
181174

182175
func cleanupPauseResources(t *testing.T, c *pauseTestContext) {

0 commit comments

Comments
 (0)