Skip to content

Commit 508b97a

Browse files
committed
fix
1 parent 174f124 commit 508b97a

File tree

15 files changed

+203
-93
lines changed

15 files changed

+203
-93
lines changed

test/e2e/atlas/generic/profile/profile_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func validateProfile(t *testing.T, cliPath string, profile string, profileValid
3434
t.Helper()
3535

3636
// Setup the command
37-
cmd := exec.Command(cliPath, //nolint:gosec // this part of e2e tests
37+
cmd := exec.Command(cliPath, //nolint:gosec // needed e2e tests
3838
authEntity,
3939
whoami,
4040
"--profile", profile,

test/e2e/atlas/iam/atlasorgapikeyaccesslist/atlas_org_api_key_access_list_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func TestAtlasOrgAPIKeyAccessList(t *testing.T) {
126126

127127
func deleteAtlasAccessListEntry(t *testing.T, cliPath, entry, apiKeyID string) {
128128
t.Helper()
129-
cmd := exec.Command(cliPath, //nolint:gosec // this part of e2e tests
129+
cmd := exec.Command(cliPath, //nolint:gosec // needed e2e tests
130130
orgEntity,
131131
apiKeysEntity,
132132
apiKeyAccessListEntity,

test/e2e/atlas/iam/atlasprojects/atlas_projects_test.go

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ func TestAtlasProjects(t *testing.T) {
5757
projectName,
5858
"--tag", "env=e2e",
5959
"--tag", "prod=false",
60-
"-o=json")
60+
"-o=json",
61+
"-P",
62+
internal.ProfileName(),
63+
)
6164
cmd.Env = os.Environ()
6265
resp, err := internal.RunAndGetStdOut(cmd)
6366

@@ -75,7 +78,10 @@ func TestAtlasProjects(t *testing.T) {
7578
cmd := exec.Command(cliPath,
7679
projectsEntity,
7780
"ls",
78-
"-o=json")
81+
"-o=json",
82+
"-P",
83+
internal.ProfileName(),
84+
)
7985
cmd.Env = os.Environ()
8086
resp, err := internal.RunAndGetStdOut(cmd)
8187

@@ -87,7 +93,10 @@ func TestAtlasProjects(t *testing.T) {
8793
projectsEntity,
8894
"describe",
8995
projectID,
90-
"-o=json")
96+
"-o=json",
97+
"-P",
98+
internal.ProfileName(),
99+
)
91100
cmd.Env = os.Environ()
92101
resp, err := internal.RunAndGetStdOut(cmd)
93102

@@ -99,7 +108,10 @@ func TestAtlasProjects(t *testing.T) {
99108
projectsEntity,
100109
"describe",
101110
projectID,
102-
"-o=json")
111+
"-o=json",
112+
"-P",
113+
internal.ProfileName(),
114+
)
103115
cmd.Env = os.Environ()
104116
resp, err := internal.RunAndGetStdOut(cmd)
105117
require.NoError(t, err, string(resp))
@@ -169,7 +181,10 @@ func TestAtlasProjects(t *testing.T) {
169181
projectID,
170182
"--file",
171183
filename,
172-
"-o=json")
184+
"-o=json",
185+
"-P",
186+
internal.ProfileName(),
187+
)
173188
cmd.Env = os.Environ()
174189
resp, err := internal.RunAndGetStdOut(cmd)
175190
require.NoError(t, err, string(resp))
@@ -178,7 +193,10 @@ func TestAtlasProjects(t *testing.T) {
178193
projectsEntity,
179194
"describe",
180195
projectID,
181-
"-o=json")
196+
"-o=json",
197+
"-P",
198+
internal.ProfileName(),
199+
)
182200
cmd.Env = os.Environ()
183201
resp, err = internal.RunAndGetStdOut(cmd)
184202
require.NoError(t, err, string(resp))
@@ -212,7 +230,10 @@ func TestAtlasProjects(t *testing.T) {
212230
"ls",
213231
"--projectId",
214232
projectID,
215-
"-o=json")
233+
"-o=json",
234+
"-P",
235+
internal.ProfileName(),
236+
)
216237
cmd.Env = os.Environ()
217238
resp, err := internal.RunAndGetStdOut(cmd)
218239
require.NoError(t, err, string(resp))
@@ -223,7 +244,10 @@ func TestAtlasProjects(t *testing.T) {
223244
projectsEntity,
224245
"delete",
225246
projectID,
226-
"--force")
247+
"--force",
248+
"-P",
249+
internal.ProfileName(),
250+
)
227251
cmd.Env = os.Environ()
228252
resp, err := internal.RunAndGetStdOut(cmd)
229253

test/e2e/atlas/iam/atlasprojectteams/atlas_project_teams_test.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ func TestAtlasProjectTeams(t *testing.T) {
6767
"GROUP_READ_ONLY",
6868
"--projectId",
6969
g.ProjectID,
70-
"-o=json")
70+
"-o=json",
71+
"-P",
72+
internal.ProfileName(),
73+
)
7174
cmd.Env = os.Environ()
7275
resp, err := internal.RunAndGetStdOut(cmd)
7376
a := assert.New(t)
@@ -97,7 +100,10 @@ func TestAtlasProjectTeams(t *testing.T) {
97100
roleName2,
98101
"--projectId",
99102
g.ProjectID,
100-
"-o=json")
103+
"-o=json",
104+
"-P",
105+
internal.ProfileName(),
106+
)
101107
cmd.Env = os.Environ()
102108
resp, err := internal.RunAndGetStdOut(cmd)
103109
a := assert.New(t)
@@ -120,7 +126,10 @@ func TestAtlasProjectTeams(t *testing.T) {
120126
"ls",
121127
"--projectId",
122128
g.ProjectID,
123-
"-o=json")
129+
"-o=json",
130+
"-P",
131+
internal.ProfileName(),
132+
)
124133
cmd.Env = os.Environ()
125134
resp, err := internal.RunAndGetStdOut(cmd)
126135
a := assert.New(t)
@@ -139,7 +148,10 @@ func TestAtlasProjectTeams(t *testing.T) {
139148
teamID,
140149
"--force",
141150
"--projectId",
142-
g.ProjectID)
151+
g.ProjectID,
152+
"-P",
153+
internal.ProfileName(),
154+
)
143155
cmd.Env = os.Environ()
144156
resp, err := internal.RunAndGetStdOut(cmd)
145157
a := assert.New(t)

test/e2e/atlas/iam/atlasteamusers/atlas_team_users_test.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ func TestAtlasTeamUsers(t *testing.T) {
6464
"--teamId",
6565
teamID,
6666
"-o=json",
67+
"-P",
68+
internal.ProfileName(),
6769
)
6870
cmd.Env = os.Environ()
6971
resp, err := internal.RunAndGetStdOut(cmd)
@@ -89,7 +91,10 @@ func TestAtlasTeamUsers(t *testing.T) {
8991
"ls",
9092
"--teamId",
9193
teamID,
92-
"-o=json")
94+
"-o=json",
95+
"-P",
96+
internal.ProfileName(),
97+
)
9398
cmd.Env = os.Environ()
9499
resp, err := internal.RunAndGetStdOut(cmd)
95100
require.NoError(t, err, string(resp))
@@ -107,7 +112,10 @@ func TestAtlasTeamUsers(t *testing.T) {
107112
"-c",
108113
"--teamId",
109114
teamID,
110-
"-o=json")
115+
"-o=json",
116+
"-P",
117+
internal.ProfileName(),
118+
)
111119
cmd.Env = os.Environ()
112120
resp, err := internal.RunAndGetStdOut(cmd)
113121
require.NoError(t, err, string(resp))
@@ -125,7 +133,10 @@ func TestAtlasTeamUsers(t *testing.T) {
125133
userID,
126134
"--teamId",
127135
teamID,
128-
"--force")
136+
"--force",
137+
"-P",
138+
internal.ProfileName(),
139+
)
129140
cmd.Env = os.Environ()
130141
resp, err := internal.RunAndGetStdOut(cmd)
131142
require.NoError(t, err, string(resp))

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ func TestLDAPWithFlags(t *testing.T) {
6666
ldapBindPassword,
6767
"--projectId", g.ProjectID,
6868
"-o",
69-
"json")
69+
"json",
70+
"-P",
71+
internal.ProfileName(),
72+
)
7073

7174
requestID = testLDAPVerifyCmd(t, cmd)
7275
})
@@ -99,6 +102,8 @@ func TestLDAPWithFlags(t *testing.T) {
99102
"--projectId", g.ProjectID,
100103
"-o",
101104
"json",
105+
"-P",
106+
internal.ProfileName(),
102107
)
103108
cmd.Env = os.Environ()
104109
resp, err := internal.RunAndGetStdOut(cmd)
@@ -142,7 +147,10 @@ func TestLDAPWithFlags(t *testing.T) {
142147
"get",
143148
"--projectId", g.ProjectID,
144149
"-o",
145-
"json")
150+
"json",
151+
"-P",
152+
internal.ProfileName(),
153+
)
146154
cmd.Env = os.Environ()
147155
resp, err := internal.RunAndGetStdOut(cmd)
148156
require.NoError(t, err, string(resp))
@@ -184,7 +192,10 @@ func TestLDAPWithStdin(t *testing.T) {
184192
"cn=admin,dc=example,dc=org",
185193
"--projectId", g.ProjectID,
186194
"-o",
187-
"json")
195+
"json",
196+
"-P",
197+
internal.ProfileName(),
198+
)
188199

189200
passwordStdin := bytes.NewBuffer([]byte(ldapBindPassword))
190201
cmd.Stdin = passwordStdin
@@ -212,6 +223,8 @@ func TestLDAPWithStdin(t *testing.T) {
212223
"--projectId", g.ProjectID,
213224
"-o",
214225
"json",
226+
"-P",
227+
internal.ProfileName(),
215228
)
216229

217230
passwordStdin := bytes.NewBuffer([]byte(ldapBindPassword))
@@ -228,12 +241,15 @@ func TestLDAPWithStdin(t *testing.T) {
228241
func testLDAPDelete(t *testing.T, cliPath, projectID string) {
229242
t.Helper()
230243

231-
cmd := exec.Command(cliPath,
244+
cmd := exec.Command(cliPath, //nolint:gosec // needed for e2e tests
232245
securityEntity,
233246
ldapEntity,
234247
"delete",
235248
"--projectId", projectID,
236-
"--force")
249+
"--force",
250+
"-P",
251+
internal.ProfileName(),
252+
)
237253
cmd.Env = os.Environ()
238254
resp, err := internal.RunAndGetStdOut(cmd)
239255
require.NoError(t, err, string(resp))

test/e2e/atlas/logs/logs/logs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func downloadLogTmpPath(t *testing.T, cliPath, hostname, logFile, projectID stri
9595

9696
func downloadLog(t *testing.T, cliPath, hostname, logFile, projectID string) {
9797
t.Helper()
98-
cmd := exec.Command(cliPath, //nolint:gosec // this part of e2e tests
98+
cmd := exec.Command(cliPath, //nolint:gosec // needed e2e tests
9999
logsEntity,
100100
"download",
101101
hostname,

0 commit comments

Comments
 (0)