Skip to content

Commit a155e2f

Browse files
authored
test(k8s): ignore scw env variable in exec-credentials tests (scaleway#4364)
1 parent 870917b commit a155e2f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

internal/namespaces/k8s/v1/custom_execcredentials_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ func Test_ExecCredential(t *testing.T) {
2626
TmpHomeDir: true,
2727
BeforeFunc: beforeFuncCreateFullConfig(),
2828
Cmd: "scw k8s exec-credential",
29+
OverrideEnv: map[string]string{
30+
scw.ScwAccessKeyEnv: "", // Ignore keys in test env
31+
scw.ScwSecretKeyEnv: "", // Ignore keys in test env
32+
},
2933
Check: core.TestCheckCombine(
3034
core.TestCheckExitCode(0),
3135
core.TestCheckGolden(),
@@ -57,6 +61,8 @@ func Test_ExecCredential(t *testing.T) {
5761
Cmd: "scw k8s exec-credential",
5862
OverrideEnv: map[string]string{
5963
scw.ScwActiveProfileEnv: "p2",
64+
scw.ScwAccessKeyEnv: "", // Ignore keys in test env
65+
scw.ScwSecretKeyEnv: "", // Ignore keys in test env
6066
},
6167
Check: core.TestCheckCombine(
6268
core.TestCheckExitCode(0),
@@ -71,6 +77,10 @@ func Test_ExecCredential(t *testing.T) {
7177
TmpHomeDir: true,
7278
BeforeFunc: beforeFuncCreateFullConfig(),
7379
Cmd: "scw --profile p3 k8s exec-credential",
80+
OverrideEnv: map[string]string{
81+
scw.ScwAccessKeyEnv: "", // Ignore keys in test env
82+
scw.ScwSecretKeyEnv: "", // Ignore keys in test env
83+
},
7484
Check: core.TestCheckCombine(
7585
core.TestCheckExitCode(0),
7686
core.TestCheckGolden(),
@@ -86,6 +96,8 @@ func Test_ExecCredential(t *testing.T) {
8696
Cmd: "scw --profile p3 k8s exec-credential",
8797
OverrideEnv: map[string]string{
8898
scw.ScwActiveProfileEnv: "p2",
99+
scw.ScwAccessKeyEnv: "", // Ignore keys in test env
100+
scw.ScwSecretKeyEnv: "", // Ignore keys in test env
89101
},
90102
Check: core.TestCheckCombine(
91103
core.TestCheckExitCode(0),

0 commit comments

Comments
 (0)