Skip to content

Commit 71ce3f1

Browse files
committed
fix
1 parent c54fa7c commit 71ce3f1

File tree

14 files changed

+297
-68
lines changed

14 files changed

+297
-68
lines changed

test/e2e/atlas/clusters/iss/clustersiss/clusters_iss_test.go

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ func TestIndependendShardScalingCluster(t *testing.T) {
7373
"--diskSizeGB", diskSizeGB30,
7474
"--autoScalingMode", independentShardScalingFlag,
7575
"--watch",
76-
"-o=json")
76+
"-o=json",
77+
"-P",
78+
internal.ProfileName(),
79+
)
7780

7881
cmd.Env = os.Environ()
7982
resp, err := internal.RunAndGetStdOut(cmd)
@@ -94,7 +97,10 @@ func TestIndependendShardScalingCluster(t *testing.T) {
9497
issClusterName,
9598
"--autoScalingMode",
9699
independentShardScalingFlag,
97-
"-o=json")
100+
"-o=json",
101+
"-P",
102+
internal.ProfileName(),
103+
)
98104

99105
cmd.Env = os.Environ()
100106
resp, err := internal.RunAndGetStdOut(cmd)
@@ -131,6 +137,8 @@ func TestIndependendShardScalingCluster(t *testing.T) {
131137
"autoScalingConfig",
132138
issClusterName,
133139
"-o=json",
140+
"-P",
141+
internal.ProfileName(),
134142
)
135143

136144
cmd.Env = os.Environ()
@@ -151,6 +159,8 @@ func TestIndependendShardScalingCluster(t *testing.T) {
151159
"independentShardScaling",
152160
"--output",
153161
"json",
162+
"-P",
163+
internal.ProfileName(),
154164
)
155165

156166
cmd.Env = os.Environ()
@@ -166,7 +176,10 @@ func TestIndependendShardScalingCluster(t *testing.T) {
166176
clustersEntity,
167177
"autoScalingConfig",
168178
issClusterName,
169-
"-o=json")
179+
"-o=json",
180+
"-P",
181+
internal.ProfileName(),
182+
)
170183

171184
cmd.Env = os.Environ()
172185
resp, err := internal.RunAndGetStdOut(cmd)
@@ -182,7 +195,10 @@ func TestIndependendShardScalingCluster(t *testing.T) {
182195
clustersEntity,
183196
"list",
184197
"--autoScalingMode", independentShardScalingFlag,
185-
"-o=json")
198+
"-o=json",
199+
"-P",
200+
internal.ProfileName(),
201+
)
186202
cmd.Env = os.Environ()
187203
resp, err := internal.RunAndGetStdOut(cmd)
188204
req.NoError(err, string(resp))
@@ -200,7 +216,10 @@ func TestIndependendShardScalingCluster(t *testing.T) {
200216
"delete",
201217
issClusterName,
202218
"--force",
203-
"--watch")
219+
"--watch",
220+
"-P",
221+
internal.ProfileName(),
222+
)
204223
cmd.Env = os.Environ()
205224
resp, err := internal.RunAndGetStdOut(cmd)
206225
req.NoError(err, string(resp))

test/e2e/atlas/clusters/iss/clustersissfile/clusters_iss_file_test.go

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ func TestISSClustersFile(t *testing.T) {
5050
"create",
5151
clusterIssFileName,
5252
"--file", "testdata/create_iss_cluster_test.json",
53-
"-o=json")
53+
"-o=json",
54+
"-P",
55+
internal.ProfileName(),
56+
)
5457

5558
cmd.Env = os.Environ()
5659
resp, err := internal.RunAndGetStdOut(cmd)
@@ -66,7 +69,10 @@ func TestISSClustersFile(t *testing.T) {
6669
clustersEntity,
6770
"autoScalingConfig",
6871
clusterIssFileName,
69-
"-o=json")
72+
"-o=json",
73+
"-P",
74+
internal.ProfileName(),
75+
)
7076

7177
cmd.Env = os.Environ()
7278
resp, err := internal.RunAndGetStdOut(cmd)
@@ -82,6 +88,8 @@ func TestISSClustersFile(t *testing.T) {
8288
clustersEntity,
8389
"watch",
8490
clusterIssFileName,
91+
"-P",
92+
internal.ProfileName(),
8593
)
8694

8795
cmd.Env = os.Environ()
@@ -98,6 +106,8 @@ func TestISSClustersFile(t *testing.T) {
98106
"independentShardScaling",
99107
"--output",
100108
"json",
109+
"-P",
110+
internal.ProfileName(),
101111
)
102112

103113
cmd.Env = os.Environ()
@@ -117,6 +127,8 @@ func TestISSClustersFile(t *testing.T) {
117127
"independentShardScaling",
118128
"--output",
119129
"json",
130+
"-P",
131+
internal.ProfileName(),
120132
)
121133

122134
cmd.Env = os.Environ()
@@ -136,6 +148,8 @@ func TestISSClustersFile(t *testing.T) {
136148
"testdata/create_iss_cluster_test_update.json",
137149
"--output",
138150
"json",
151+
"-P",
152+
internal.ProfileName(),
139153
)
140154

141155
cmd.Env = os.Environ()
@@ -153,7 +167,10 @@ func TestISSClustersFile(t *testing.T) {
153167
"delete",
154168
clusterIssFileName,
155169
"--watch",
156-
"--force")
170+
"--force",
171+
"-P",
172+
internal.ProfileName(),
173+
)
157174

158175
cmd.Env = os.Environ()
159176
resp, err := internal.RunAndGetStdOut(cmd)

test/e2e/atlas/clusters/sharded/clusterssharded/clusters_sharded_test.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ func TestShardedCluster(t *testing.T) {
7070
"--mdbVersion", mdbVersion,
7171
"--diskSizeGB", diskSizeGB30,
7272
"--projectId", g.ProjectID,
73-
"-o=json")
73+
"-o=json",
74+
"-P",
75+
internal.ProfileName(),
76+
)
7477

7578
cmd.Env = os.Environ()
7679
resp, err := internal.RunAndGetStdOut(cmd)
@@ -83,7 +86,15 @@ func TestShardedCluster(t *testing.T) {
8386
})
8487

8588
g.Run("Delete sharded cluster", func(t *testing.T) { //nolint:thelper // g.Run replaces t.Run
86-
cmd := exec.Command(cliPath, clustersEntity, "delete", shardedClusterName, "--projectId", g.ProjectID, "--force")
89+
cmd := exec.Command(cliPath,
90+
clustersEntity,
91+
"delete",
92+
shardedClusterName,
93+
"--projectId", g.ProjectID,
94+
"--force",
95+
"-P",
96+
internal.ProfileName(),
97+
)
8798
cmd.Env = os.Environ()
8899
resp, err := internal.RunAndGetStdOut(cmd)
89100
req.NoError(err, string(resp))
@@ -102,6 +113,8 @@ func TestShardedCluster(t *testing.T) {
102113
"watch",
103114
shardedClusterName,
104115
"--projectId", g.ProjectID,
116+
"-P",
117+
internal.ProfileName(),
105118
)
106119
cmd.Env = os.Environ()
107120
// this command will fail with 404 once the cluster is deleted

test/e2e/atlas/clusters/upgrade/clustersupgrade/clusters_upgrade_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ func TestSharedClusterUpgrade(t *testing.T) {
5454
"--diskSizeGB", diskSizeGB40,
5555
"--projectId", g.ProjectID,
5656
"--tag", "env=e2e",
57-
"-o=json")
57+
"-o=json",
58+
"-P",
59+
internal.ProfileName(),
60+
)
5861
cmd.Env = os.Environ()
5962
resp, err := internal.RunAndGetStdOut(cmd)
6063
require.NoError(t, err, string(resp))
@@ -68,12 +71,15 @@ func TestSharedClusterUpgrade(t *testing.T) {
6871

6972
func fetchCluster(t *testing.T, cliPath, projectID, clusterName string) *atlasClustersPinned.AdvancedClusterDescription {
7073
t.Helper()
71-
cmd := exec.Command(cliPath,
74+
cmd := exec.Command(cliPath, //nolint:gosec // needed for e2e tests
7275
clustersEntity,
7376
"get",
7477
clusterName,
7578
"--projectId", projectID,
76-
"-o=json")
79+
"-o=json",
80+
"-P",
81+
internal.ProfileName(),
82+
)
7783
cmd.Env = os.Environ()
7884
resp, err := internal.RunAndGetStdOut(cmd)
7985
req := require.New(t)

test/e2e/atlas/datafederation/db/datafederationdb/data_federation_db_test.go

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ func TestDataFederation(t *testing.T) {
6060
roleID,
6161
"--awsTestS3Bucket",
6262
testBucket,
63-
"-o=json")
63+
"-o=json",
64+
"-P",
65+
internal.ProfileName(),
66+
)
6467
cmd.Env = os.Environ()
6568
resp, err := internal.RunAndGetStdOut(cmd)
6669

@@ -77,7 +80,10 @@ func TestDataFederation(t *testing.T) {
7780
datafederationEntity,
7881
"delete",
7982
dataFederationName,
80-
"--force")
83+
"--force",
84+
"-P",
85+
internal.ProfileName(),
86+
)
8187
cmd.Env = os.Environ()
8288

8389
// this command will only succeed in case one of the tests after this one fails
@@ -91,7 +97,10 @@ func TestDataFederation(t *testing.T) {
9197
datafederationEntity,
9298
"describe",
9399
dataFederationName,
94-
"-o=json")
100+
"-o=json",
101+
"-P",
102+
internal.ProfileName(),
103+
)
95104
cmd.Env = os.Environ()
96105
resp, err := internal.RunAndGetStdOut(cmd)
97106

@@ -105,7 +114,10 @@ func TestDataFederation(t *testing.T) {
105114
cmd := exec.Command(cliPath,
106115
datafederationEntity,
107116
"ls",
108-
"-o=json")
117+
"-o=json",
118+
"-P",
119+
internal.ProfileName(),
120+
)
109121
cmd.Env = os.Environ()
110122
resp, err := internal.RunAndGetStdOut(cmd)
111123
r.NoError(err, string(resp))
@@ -123,7 +135,10 @@ func TestDataFederation(t *testing.T) {
123135
dataFederationName,
124136
"--region",
125137
updateRegion,
126-
"-o=json")
138+
"-o=json",
139+
"-P",
140+
internal.ProfileName(),
141+
)
127142
cmd.Env = os.Environ()
128143
resp, err := internal.RunAndGetStdOut(cmd)
129144
r.NoError(err, string(resp))
@@ -144,7 +159,10 @@ func TestDataFederation(t *testing.T) {
144159
strconv.FormatInt(time.Now().Add(-10*time.Second).Unix(), 10),
145160
"--end",
146161
strconv.FormatInt(time.Now().Unix(), 10),
147-
"--force")
162+
"--force",
163+
"-P",
164+
internal.ProfileName(),
165+
)
148166
cmd.Env = os.Environ()
149167

150168
resp, err := internal.RunAndGetStdOut(cmd)
@@ -157,7 +175,10 @@ func TestDataFederation(t *testing.T) {
157175
"logs",
158176
dataFederationName,
159177
"--out",
160-
"testLogFile")
178+
"testLogFile",
179+
"-P",
180+
internal.ProfileName(),
181+
)
161182
cmd.Env = os.Environ()
162183

163184
resp, err := internal.RunAndGetStdOut(cmd)
@@ -169,7 +190,10 @@ func TestDataFederation(t *testing.T) {
169190
datafederationEntity,
170191
"delete",
171192
dataFederationName,
172-
"--force")
193+
"--force",
194+
"-P",
195+
internal.ProfileName(),
196+
)
173197
cmd.Env = os.Environ()
174198

175199
resp, err := internal.RunAndGetStdOut(cmd)

test/e2e/atlas/datafederation/privatenetwork/datafederationprivateendpoint/data_federation_private_endpoint_test.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ func TestDataFederationPrivateEndpointsAWS(t *testing.T) {
5656
"comment",
5757
"--projectId",
5858
g.ProjectID,
59-
"-o=json")
59+
"-o=json",
60+
"-P",
61+
internal.ProfileName(),
62+
)
6063
cmd.Env = os.Environ()
6164

6265
a := assert.New(t)
@@ -76,7 +79,10 @@ func TestDataFederationPrivateEndpointsAWS(t *testing.T) {
7679
vpcID,
7780
"--projectId",
7881
g.ProjectID,
79-
"-o=json")
82+
"-o=json",
83+
"-P",
84+
internal.ProfileName(),
85+
)
8086
cmd.Env = os.Environ()
8187
resp, err := internal.RunAndGetStdOut(cmd)
8288
require.NoError(t, err, string(resp))
@@ -93,7 +99,10 @@ func TestDataFederationPrivateEndpointsAWS(t *testing.T) {
9399
"ls",
94100
"--projectId",
95101
g.ProjectID,
96-
"-o=json")
102+
"-o=json",
103+
"-P",
104+
internal.ProfileName(),
105+
)
97106
cmd.Env = os.Environ()
98107
resp, err := internal.RunAndGetStdOut(cmd)
99108

@@ -112,7 +121,10 @@ func TestDataFederationPrivateEndpointsAWS(t *testing.T) {
112121
vpcID,
113122
"--projectId",
114123
g.ProjectID,
115-
"--force")
124+
"--force",
125+
"-P",
126+
internal.ProfileName(),
127+
)
116128
cmd.Env = os.Environ()
117129

118130
resp, err := internal.RunAndGetStdOut(cmd)

0 commit comments

Comments
 (0)