Skip to content

Commit fadc491

Browse files
committed
fix
1 parent 71ce3f1 commit fadc491

File tree

11 files changed

+212
-42
lines changed

11 files changed

+212
-42
lines changed

test/e2e/atlas/backup/flex/backupflex/backup_flex_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ func TestFlexBackup(t *testing.T) {
4646
cliPath, err := internal.AtlasCLIBin()
4747
require.NoError(t, err)
4848

49-
g.ProjectID = os.Getenv("MONGODB_ATLAS_PROJECT_ID")
49+
profile, err := g.ProfileData()
50+
require.NoError(t, err)
51+
52+
g.ProjectID = profile["project_id"]
5053
generateFlexCluster(t, g)
5154

5255
clusterName, err := internal.FlexInstanceName()

test/e2e/atlas/generic/dbusers/dbusers_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,16 @@ func testUpdateUserCmd(t *testing.T, cmd *exec.Cmd, username string) {
312312
func testDeleteUser(t *testing.T, cliPath, dbusersEntity, username string) {
313313
t.Helper()
314314

315-
cmd := exec.Command(cliPath,
315+
cmd := exec.Command(cliPath, //nolint:gosec // needed for e2e tests
316316
dbusersEntity,
317317
"delete",
318318
username,
319319
"--force",
320320
"--authDB",
321-
"admin")
321+
"admin",
322+
"-P",
323+
internal.ProfileName(),
324+
)
322325
cmd.Env = os.Environ()
323326
resp, err := internal.RunAndGetStdOut(cmd)
324327
require.NoError(t, err, string(resp))

test/e2e/atlas/iam/atlasprojectapikeys/atlas_project_api_keys_test.go

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ func TestAtlasProjectAPIKeys(t *testing.T) {
5555
"--desc",
5656
desc,
5757
"--role=GROUP_READ_ONLY",
58-
"-o=json")
58+
"-o=json",
59+
"-P",
60+
internal.ProfileName(),
61+
)
5962
cmd.Env = os.Environ()
6063
resp, err := internal.RunAndGetStdOut(cmd)
6164
a := assert.New(t)
@@ -80,7 +83,10 @@ func TestAtlasProjectAPIKeys(t *testing.T) {
8083
"assign",
8184
ID,
8285
"--role=GROUP_DATA_ACCESS_READ_ONLY",
83-
"-o=json")
86+
"-o=json",
87+
"-P",
88+
internal.ProfileName(),
89+
)
8490
cmd.Env = os.Environ()
8591
resp, err := internal.RunAndGetStdOut(cmd)
8692
require.NoError(t, err, string(resp))
@@ -91,7 +97,10 @@ func TestAtlasProjectAPIKeys(t *testing.T) {
9197
projectsEntity,
9298
apiKeysEntity,
9399
"ls",
94-
"-o=json")
100+
"-o=json",
101+
"-P",
102+
internal.ProfileName(),
103+
)
95104
cmd.Env = os.Environ()
96105
resp, err := internal.RunAndGetStdOut(cmd)
97106

@@ -111,7 +120,10 @@ func TestAtlasProjectAPIKeys(t *testing.T) {
111120
apiKeysEntity,
112121
"ls",
113122
"-c",
114-
"-o=json")
123+
"-o=json",
124+
"-P",
125+
internal.ProfileName(),
126+
)
115127
cmd.Env = os.Environ()
116128
resp, err := internal.RunAndGetStdOut(cmd)
117129

@@ -131,7 +143,10 @@ func TestAtlasProjectAPIKeys(t *testing.T) {
131143
apiKeysEntity,
132144
"rm",
133145
ID,
134-
"--force")
146+
"--force",
147+
"-P",
148+
internal.ProfileName(),
149+
)
135150
cmd.Env = os.Environ()
136151
resp, err := internal.RunAndGetStdOut(cmd)
137152
require.NoError(t, err, string(resp))

test/e2e/atlas/iam/atlasteams/atlas_teams_test.go

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ func TestAtlasTeams(t *testing.T) {
5959
teamName,
6060
"--username",
6161
username,
62-
"-o=json")
62+
"-o=json",
63+
"-P",
64+
internal.ProfileName(),
65+
)
6366
cmd.Env = os.Environ()
6467
resp, err := internal.RunAndGetStdOut(cmd)
6568

@@ -79,7 +82,10 @@ func TestAtlasTeams(t *testing.T) {
7982
"describe",
8083
"--id",
8184
teamID,
82-
"-o=json")
85+
"-o=json",
86+
"-P",
87+
internal.ProfileName(),
88+
)
8389
cmd.Env = os.Environ()
8490
resp, err := internal.RunAndGetStdOut(cmd)
8591
require.NoError(t, err, string(resp))
@@ -95,7 +101,10 @@ func TestAtlasTeams(t *testing.T) {
95101
"describe",
96102
"--name",
97103
teamName,
98-
"-o=json")
104+
"-o=json",
105+
"-P",
106+
internal.ProfileName(),
107+
)
99108
cmd.Env = os.Environ()
100109
resp, err := internal.RunAndGetStdOut(cmd)
101110
require.NoError(t, err, string(resp))
@@ -112,7 +121,10 @@ func TestAtlasTeams(t *testing.T) {
112121
teamName,
113122
"--teamId",
114123
teamID,
115-
"-o=json")
124+
"-o=json",
125+
"-P",
126+
internal.ProfileName(),
127+
)
116128
cmd.Env = os.Environ()
117129
resp, err := internal.RunAndGetStdOut(cmd)
118130
require.NoError(t, err, string(resp))
@@ -127,7 +139,10 @@ func TestAtlasTeams(t *testing.T) {
127139
cmd := exec.Command(cliPath,
128140
teamsEntity,
129141
"ls",
130-
"-o=json")
142+
"-o=json",
143+
"-P",
144+
internal.ProfileName(),
145+
)
131146
cmd.Env = os.Environ()
132147
resp, err := internal.RunAndGetStdOut(cmd)
133148
require.NoError(t, err, string(resp))
@@ -142,7 +157,10 @@ func TestAtlasTeams(t *testing.T) {
142157
teamsEntity,
143158
"ls",
144159
"-c",
145-
"-o=json")
160+
"-o=json",
161+
"-P",
162+
internal.ProfileName(),
163+
)
146164
cmd.Env = os.Environ()
147165
resp, err := internal.RunAndGetStdOut(cmd)
148166
require.NoError(t, err, string(resp))
@@ -157,7 +175,10 @@ func TestAtlasTeams(t *testing.T) {
157175
teamsEntity,
158176
"delete",
159177
teamID,
160-
"--force")
178+
"--force",
179+
"-P",
180+
internal.ProfileName(),
181+
)
161182
cmd.Env = os.Environ()
162183
resp, err := internal.RunAndGetStdOut(cmd)
163184
require.NoError(t, err, string(resp))

test/e2e/atlas/ldap/ldap/ldap_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ func TestLDAPWithFlags(t *testing.T) {
8585
"watch",
8686
requestID,
8787
"--projectId", g.ProjectID,
88+
"-P",
89+
internal.ProfileName(),
8890
)
8991
cmd.Env = os.Environ()
9092
resp, err := internal.RunAndGetStdOut(cmd)
@@ -135,6 +137,8 @@ func TestLDAPWithFlags(t *testing.T) {
135137
"--projectId", g.ProjectID,
136138
"-o",
137139
"json",
140+
"-P",
141+
internal.ProfileName(),
138142
)
139143

140144
testLDAPSaveCmd(t, cmd)

0 commit comments

Comments
 (0)