Skip to content

Commit

Permalink
test: fix linting errors (#2921)
Browse files Browse the repository at this point in the history
* test: fix linting errors

* Fix
  • Loading branch information
remyleone authored Feb 12, 2025
1 parent c1f09d2 commit b213214
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ linters:
- stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false]
- tagalign # check that struct tags are well aligned [fast: true, auto-fix: true]
- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false]
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false]
- testifylint # Checks usage of github.com/stretchr/testify. [fast: false, auto-fix: false]
- testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false]
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers [fast: false, auto-fix: false]
Expand Down
16 changes: 8 additions & 8 deletions internal/services/scwconfig/scw_config_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestAccDataSourceConfig_ActiveProfile(t *testing.T) {
PreCheck: func() { acctest.PreCheck(t) },
ProviderFactories: func() map[string]func() (*schema.Provider, error) {
_ = os.Unsetenv("SCW_PROFILE")
_ = os.Setenv("SCW_CONFIG_PATH", "./testfixture/test_config.yaml")
t.Setenv("SCW_CONFIG_PATH", "./testfixture/test_config.yaml")
metaDefault, err := meta.NewMeta(ctx, &meta.Config{
TerraformVersion: "terraform-tests",
HTTPClient: tt.Meta.HTTPClient(),
Expand Down Expand Up @@ -78,12 +78,12 @@ func TestAccDataSourceConfig_OtherProfile(t *testing.T) {

ctx := context.Background()

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

ctx := context.Background()

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

0 comments on commit b213214

Please sign in to comment.