Skip to content

Commit b213214

Browse files
authored
test: fix linting errors (#2921)
* test: fix linting errors * Fix
1 parent c1f09d2 commit b213214

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ linters:
6767
- stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false]
6868
- tagalign # check that struct tags are well aligned [fast: true, auto-fix: true]
6969
- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false]
70-
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false]
7170
- testifylint # Checks usage of github.com/stretchr/testify. [fast: false, auto-fix: false]
7271
- testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false]
7372
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers [fast: false, auto-fix: false]

internal/services/scwconfig/scw_config_data_source_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestAccDataSourceConfig_ActiveProfile(t *testing.T) {
3030
PreCheck: func() { acctest.PreCheck(t) },
3131
ProviderFactories: func() map[string]func() (*schema.Provider, error) {
3232
_ = os.Unsetenv("SCW_PROFILE")
33-
_ = os.Setenv("SCW_CONFIG_PATH", "./testfixture/test_config.yaml")
33+
t.Setenv("SCW_CONFIG_PATH", "./testfixture/test_config.yaml")
3434
metaDefault, err := meta.NewMeta(ctx, &meta.Config{
3535
TerraformVersion: "terraform-tests",
3636
HTTPClient: tt.Meta.HTTPClient(),
@@ -78,12 +78,12 @@ func TestAccDataSourceConfig_OtherProfile(t *testing.T) {
7878

7979
ctx := context.Background()
8080

81-
resource.ParallelTest(t, resource.TestCase{
81+
resource.Test(t, resource.TestCase{
8282
PreCheck: func() { acctest.PreCheck(t) },
8383
ProviderFactories: func() map[string]func() (*schema.Provider, error) {
8484
_ = os.Unsetenv("SCW_PROFILE")
85-
_ = os.Setenv("SCW_CONFIG_PATH", "./testfixture/test_config.yaml")
86-
_ = os.Setenv("SCW_PROFILE", "other")
85+
t.Setenv("SCW_CONFIG_PATH", "./testfixture/test_config.yaml")
86+
t.Setenv("SCW_PROFILE", "other")
8787
metaOther, err := meta.NewMeta(ctx, &meta.Config{
8888
TerraformVersion: "terraform-tests",
8989
HTTPClient: tt.Meta.HTTPClient(),
@@ -131,13 +131,13 @@ func TestAccDataSourceConfig_MixedProfile(t *testing.T) {
131131

132132
ctx := context.Background()
133133

134-
resource.ParallelTest(t, resource.TestCase{
134+
resource.Test(t, resource.TestCase{
135135
PreCheck: func() { acctest.PreCheck(t) },
136136
ProviderFactories: func() map[string]func() (*schema.Provider, error) {
137137
_ = os.Unsetenv("SCW_PROFILE")
138-
_ = os.Setenv("SCW_CONFIG_PATH", "./testfixture/test_config.yaml")
139-
_ = os.Setenv("SCW_PROFILE", "incomplete")
140-
_ = os.Setenv("SCW_DEFAULT_PROJECT_ID", "77777777-7777-7777-7777-777777777777")
138+
t.Setenv("SCW_CONFIG_PATH", "./testfixture/test_config.yaml")
139+
t.Setenv("SCW_PROFILE", "incomplete")
140+
t.Setenv("SCW_DEFAULT_PROJECT_ID", "77777777-7777-7777-7777-777777777777")
141141
metaMixed, err := meta.NewMeta(ctx, &meta.Config{
142142
TerraformVersion: "terraform-tests",
143143
HTTPClient: tt.Meta.HTTPClient(),

0 commit comments

Comments
 (0)