Skip to content

Commit

Permalink
test(linters): Enable testifylint: formatter, `suite-broken-paral…
Browse files Browse the repository at this point in the history
…lel` and `suite-subtest-run` (#15797)
  • Loading branch information
zak-pawel authored Sep 3, 2024
1 parent 2e00753 commit 88bca70
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,15 @@ linters-settings:
- error-nil
- expected-actual
- float-compare
- formatter
- len
- negative-positive
- nil-compare
- require-error
- suite-broken-parallel
- suite-dont-use-pkg
- suite-extra-assert-call
- suite-subtest-run
- suite-thelper
- useless-assert

Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/kube_inventory/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func toBoolPtr(b bool) *bool {

func TestNewClient(t *testing.T) {
_, err := newClient("https://127.0.0.1:443/", "default", "", "abc123", time.Second, tls.ClientConfig{})
require.NoErrorf(t, err, "Failed to create new client - %v", err)
require.NoErrorf(t, err, "Failed to create new client: %v", err)

_, err = newClient("https://127.0.0.1:443/", "default", "nonexistantFile", "", time.Second, tls.ClientConfig{})
require.Errorf(t, err, "failed to read token file \"file\": open file: no such file or directory", err)
require.Errorf(t, err, "Failed to read token file \"file\": open file: no such file or directory: %v", err)
}
2 changes: 1 addition & 1 deletion plugins/secretstores/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestPathNonExistent(t *testing.T) {
ID: "non_existent_path_test",
Path: "non/existent/path",
}
require.ErrorContainsf(t, plugin.Init(), "accessing directory", "accessing directory %q failed: %w", plugin.Path, plugin.Init())
require.ErrorContainsf(t, plugin.Init(), "accessing directory", "accessing directory %q failed: %v", plugin.Path, plugin.Init())
}

func TestSetNotAvailable(t *testing.T) {
Expand Down

0 comments on commit 88bca70

Please sign in to comment.