Skip to content

Commit 86a1372

Browse files
committed
fix
1 parent f15ced0 commit 86a1372

File tree

8 files changed

+26
-36
lines changed

8 files changed

+26
-36
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ func TestIndependendShardScalingCluster(t *testing.T) {
121121
"clusterWideScaling",
122122
"--output",
123123
"json",
124+
"-P",
125+
internal.ProfileName(),
124126
)
125127

126128
cmd.Env = os.Environ()

test/e2e/atlas/generic/accesslists/access_lists_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ func TestAccessList(t *testing.T) {
170170
entry,
171171
"--projectId",
172172
g.ProjectID,
173-
"--force")
173+
"--force",
174+
"-P",
175+
internal.ProfileName(),
176+
)
174177
cmd.Env = os.Environ()
175178
resp, err := internal.RunAndGetStdOut(cmd)
176179
require.NoError(t, err, string(resp))
@@ -187,7 +190,10 @@ func TestAccessList(t *testing.T) {
187190
"--comment=test",
188191
"--projectId",
189192
g.ProjectID,
190-
"-o=json")
193+
"-o=json",
194+
"-P",
195+
internal.ProfileName(),
196+
)
191197
cmd.Env = os.Environ()
192198
resp, err := internal.RunAndGetStdOut(cmd)
193199
require.NoError(t, err, string(resp))

test/e2e/atlas/generic/alerts/alerts_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ func TestAlerts(t *testing.T) {
8787
alertsEntity,
8888
"list",
8989
"-o=json",
90+
"-P",
91+
internal.ProfileName(),
9092
)
9193

9294
cmd.Env = os.Environ()

test/e2e/atlas/plugin/install/plugininstall/plugin_install_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,10 @@ commands:
117117

118118
func runPluginInstallTest(g *internal.AtlasE2ETestGenerator, cliPath string, testName string, requireError bool, pluginValue string) {
119119
g.Run(testName, func(t *testing.T) { //nolint:thelper // g.Run replaces t.Run
120-
cmd := exec.Command(cliPath, //nolint:gosec // needed e2e tests
120+
cmd := exec.Command(cliPath,
121121
"plugin",
122122
"install",
123-
pluginValue,
124-
"-P",
125-
internal.ProfileName())
123+
pluginValue)
126124
resp, err := internal.RunAndGetStdOut(cmd)
127125
if requireError {
128126
require.Error(t, err, string(resp))

test/e2e/atlas/plugin/run/pluginrun/plugin_run_test.go

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,14 @@ func TestPluginRun(t *testing.T) {
4242
cmd := exec.Command(cliPath,
4343
"plugin",
4444
"install",
45-
"mongodb/atlas-cli-plugin-example",
46-
"-P",
47-
internal.ProfileName())
45+
"mongodb/atlas-cli-plugin-example")
4846
resp, err := internal.RunAndGetStdOut(cmd)
4947
require.NoError(t, err, string(resp))
5048

5149
g.Run("Hello", func(t *testing.T) { //nolint:thelper // g.Run replaces t.Run
5250
cmd := exec.Command(cliPath,
5351
"example",
54-
"hello",
55-
"-P",
56-
internal.ProfileName())
52+
"hello")
5753
resp, err := internal.RunAndGetStdOut(cmd)
5854
if err != nil {
5955
t.Fatalf("unexpected error: %v, resp: %v", err, string(resp))
@@ -69,9 +65,7 @@ func TestPluginRun(t *testing.T) {
6965
cmd := exec.Command(cliPath,
7066
"example",
7167
"echo",
72-
echoString,
73-
"-P",
74-
internal.ProfileName())
68+
echoString)
7569
resp, err := internal.RunAndGetStdOut(cmd)
7670
if err != nil {
7771
t.Fatalf("unexpected error: %v, resp: %v", err, string(resp))
@@ -91,9 +85,7 @@ func TestPluginRun(t *testing.T) {
9185

9286
cmd := exec.Command(cliPath,
9387
"example",
94-
"printenv",
95-
"-P",
96-
internal.ProfileName())
88+
"printenv")
9789
resp, err := internal.RunAndGetStdOut(cmd)
9890
if err != nil {
9991
t.Fatalf("unexpected error: %v, resp: %v", err, string(resp))
@@ -119,9 +111,7 @@ func TestPluginRun(t *testing.T) {
119111

120112
cmd := exec.Command(cliPath,
121113
"example",
122-
"stdinreader",
123-
"-P",
124-
internal.ProfileName())
114+
"stdinreader")
125115
cmd.Stdin = c.Tty()
126116
cmd.Stdout = c.Tty()
127117

test/e2e/atlas/plugin/uninstall/pluginuninstall/plugin_uninstall_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ func runPluginUninstallTest(t *testing.T, g *internal.AtlasE2ETestGenerator, cli
4848

4949
internal.InstallExamplePlugin(t, cliPath, "latest")
5050
g.Run(testName, func(t *testing.T) { //nolint:thelper // g.Run replaces t.Run
51-
cmd := exec.Command(cliPath, //nolint:gosec // needed e2e tests
51+
cmd := exec.Command(cliPath,
5252
"plugin",
5353
"uninstall",
54-
pluginValue,
55-
"-P",
56-
internal.ProfileName())
54+
pluginValue)
5755
resp, err := internal.RunAndGetStdOut(cmd)
5856
if requireError {
5957
require.Error(t, err, string(resp))

test/e2e/atlas/plugin/update/pluginupdate/plugin_update_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,10 @@ func runPluginUpdateTest(t *testing.T, g *internal.AtlasE2ETestGenerator, cliPat
5858
pluginValue = fmt.Sprintf("%s@%s", pluginValue, updateVersion)
5959
}
6060

61-
cmd := exec.Command(cliPath, //nolint:gosec // needed e2e tests
61+
cmd := exec.Command(cliPath,
6262
"plugin",
6363
"update",
64-
pluginValue,
65-
"-P",
66-
internal.ProfileName())
64+
pluginValue)
6765
resp, err := internal.RunAndGetStdOut(cmd)
6866
if requireError {
6967
require.Error(t, err, string(resp))

test/e2e/kubernetes/pluginfirstclass/plugin_first_class_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ func TestPluginKubernetes(t *testing.T) {
4040
removeFirstClassPlugin(t, "atlas-cli-plugin-kubernetes", cliPath)
4141

4242
cmd := exec.Command(cliPath,
43-
"kubernetes",
44-
"-P",
45-
internal.ProfileName())
43+
"kubernetes")
4644
cmd.Env = os.Environ()
4745
resp, err := cmd.CombinedOutput()
4846
require.NoError(t, err, string(resp))
@@ -52,12 +50,10 @@ func TestPluginKubernetes(t *testing.T) {
5250

5351
func removeFirstClassPlugin(t *testing.T, name, cliPath string) {
5452
t.Helper()
55-
cmd := exec.Command(cliPath, //nolint:gosec // needed e2e tests
53+
cmd := exec.Command(cliPath,
5654
"plugin",
5755
"uninstall",
58-
name,
59-
"-P",
60-
internal.ProfileName())
56+
name)
6157
resp, err := cmd.CombinedOutput()
6258
if err != nil {
6359
require.Contains(t, string(resp), "Error: could not find plugin with name atlas-cli-plugin-kubernetes")

0 commit comments

Comments
 (0)