Skip to content

Commit

Permalink
fix: Remove test assign of environment. Not possible when test run in…
Browse files Browse the repository at this point in the history
… parallel
  • Loading branch information
Matovidlo committed Nov 25, 2024
1 parent 261ba3f commit f60d9d1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
func TestNewUserErrorWithCode(t *testing.T) {
t.Parallel()

require.NoError(t, os.Setenv("CUSTOM_ENV", "val1")) //nolint:forbidigo
require.NoError(t, os.Setenv("KBC_SECRET_VAR2", "val2")) //nolint:forbidigo
require.NoError(t, os.Setenv("KBC_SECRET_VAR3", "val3")) //nolint:forbidigo
require.NoError(t, os.Setenv("CUSTOM_ENV", "val1")) //nolint:forbidigo, tenv
require.NoError(t, os.Setenv("KBC_SECRET_VAR2", "val2")) //nolint:forbidigo, tenv
require.NoError(t, os.Setenv("KBC_SECRET_VAR3", "val3")) //nolint:forbidigo, tenv

provider, err := CreateTestInputsEnvProvider(context.Background())
require.NoError(t, err)
assert.NoError(t, err)

Check failure on line 20 in internal/pkg/utils/testhelper/testtemplateinputs/testtemplateinputs_test.go

View workflow job for this annotation

GitHub Actions / Lint / lint

require-error: for error assertions use require (testifylint)
assert.Equal(t, "val1", provider.MustGet("CUSTOM_ENV"))
assert.Equal(t, "val2", provider.MustGet("KBC_SECRET_VAR2"))
assert.Equal(t, "val3", provider.MustGet("KBC_SECRET_VAR3"))
Expand Down

0 comments on commit f60d9d1

Please sign in to comment.