Skip to content

Commit

Permalink
fix: clear tested env vars before testing creds.go
Browse files Browse the repository at this point in the history
See issue #67
  • Loading branch information
zjrgov committed Dec 13, 2024
1 parent e9a4bb4 commit 6f6828a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions runner/cf-executor/cg/creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ func Test_getCreds(t *testing.T) {
},
}

// Todo (zjrgov): it could also make sense to get ENV vars outside this
// code, but I'm not exactly sure what the end implementation will look
// like and don't want to get ahead of myself.
//
// See https://github.com/GSA-TTS/gitlab-runner-cloudgov/issues/67
for _, k := range []string{"CF_USERNAME", "CF_PASSWORD", "VCAP_SERVICES"} {
t.Setenv(k, "")
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
for key, val := range tt.env {
Expand Down

0 comments on commit 6f6828a

Please sign in to comment.