test(linters): Enable `testifylint`: `formatter`, `suite-broken-parallel` and `suite-subtest-run` (#15797)

This commit is contained in:
Paweł Żak 2024-09-03 18:40:34 +02:00 committed by GitHub
parent 2e00753df7
commit 88bca70dfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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)
}

View File

@ -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) {