chore: update linter
This commit is contained in:
parent
12e50e20e6
commit
553ef94047
46 changed files with 129 additions and 105 deletions
|
@ -265,7 +265,7 @@ func TestListenProvidersThrottleProviderConfigReload(t *testing.T) {
|
|||
|
||||
providerAggregator := aggregator.ProviderAggregator{}
|
||||
err := providerAggregator.AddProvider(pvd)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
|
||||
watcher := NewConfigurationWatcher(routinesPool, providerAggregator, []string{}, "")
|
||||
|
||||
|
@ -340,7 +340,7 @@ func TestListenProvidersSkipsSameConfigurationForProvider(t *testing.T) {
|
|||
|
||||
// give some time so that the configuration can be processed
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
assert.Equal(t, configurationReloads, 1, "Same configuration should not be published multiple times")
|
||||
assert.Equal(t, 1, configurationReloads, "Same configuration should not be published multiple times")
|
||||
}
|
||||
|
||||
func TestListenProvidersDoesNotSkipFlappingConfiguration(t *testing.T) {
|
||||
|
@ -447,7 +447,7 @@ func TestListenProvidersIgnoreSameConfig(t *testing.T) {
|
|||
|
||||
providerAggregator := aggregator.ProviderAggregator{}
|
||||
err := providerAggregator.AddProvider(pvd)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
|
||||
watcher := NewConfigurationWatcher(routinesPool, providerAggregator, []string{"defaultEP"}, "")
|
||||
|
||||
|
@ -589,7 +589,7 @@ func TestListenProvidersIgnoreIntermediateConfigs(t *testing.T) {
|
|||
|
||||
providerAggregator := aggregator.ProviderAggregator{}
|
||||
err := providerAggregator.AddProvider(pvd)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
|
||||
watcher := NewConfigurationWatcher(routinesPool, providerAggregator, []string{"defaultEP"}, "")
|
||||
|
||||
|
|
|
@ -618,12 +618,12 @@ func Test_Routing(t *testing.T) {
|
|||
err := check.checkRouter(epListener.Addr().String(), timeout)
|
||||
|
||||
if check.expectedError != "" {
|
||||
require.NotNil(t, err, check.desc)
|
||||
require.Error(t, err, check.desc)
|
||||
assert.Contains(t, err.Error(), check.expectedError, check.desc)
|
||||
continue
|
||||
}
|
||||
|
||||
assert.Nil(t, err, check.desc)
|
||||
assert.NoError(t, err, check.desc)
|
||||
}
|
||||
|
||||
epListener.Close()
|
||||
|
|
|
@ -499,7 +499,7 @@ func (c *connectionTracker) Close() {
|
|||
}
|
||||
|
||||
type stoppable interface {
|
||||
Shutdown(context.Context) error
|
||||
Shutdown(ctx context.Context) error
|
||||
Close() error
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ func TestHijack(t *testing.T) {
|
|||
var mirrorRequest bool
|
||||
err := mirror.AddMirror(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
||||
hijacker, ok := rw.(http.Hijacker)
|
||||
assert.Equal(t, true, ok)
|
||||
assert.True(t, ok)
|
||||
|
||||
_, _, err := hijacker.Hijack()
|
||||
assert.Error(t, err)
|
||||
|
@ -109,7 +109,7 @@ func TestHijack(t *testing.T) {
|
|||
mirror.ServeHTTP(httptest.NewRecorder(), httptest.NewRequest(http.MethodGet, "/", nil))
|
||||
|
||||
pool.Stop()
|
||||
assert.Equal(t, true, mirrorRequest)
|
||||
assert.True(t, mirrorRequest)
|
||||
}
|
||||
|
||||
func TestFlush(t *testing.T) {
|
||||
|
@ -122,7 +122,7 @@ func TestFlush(t *testing.T) {
|
|||
var mirrorRequest bool
|
||||
err := mirror.AddMirror(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
||||
hijacker, ok := rw.(http.Flusher)
|
||||
assert.Equal(t, true, ok)
|
||||
assert.True(t, ok)
|
||||
|
||||
hijacker.Flush()
|
||||
|
||||
|
@ -133,7 +133,7 @@ func TestFlush(t *testing.T) {
|
|||
mirror.ServeHTTP(httptest.NewRecorder(), httptest.NewRequest(http.MethodGet, "/", nil))
|
||||
|
||||
pool.Stop()
|
||||
assert.Equal(t, true, mirrorRequest)
|
||||
assert.True(t, mirrorRequest)
|
||||
}
|
||||
|
||||
func TestMirroringWithBody(t *testing.T) {
|
||||
|
@ -233,7 +233,7 @@ func TestCloneRequest(t *testing.T) {
|
|||
|
||||
_, expectedBytes, err := newReusableRequest(req, 2)
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, bb[:3], expectedBytes)
|
||||
assert.Equal(t, expectedBytes, bb[:3])
|
||||
})
|
||||
|
||||
t.Run("valid case with maxBodySize", func(t *testing.T) {
|
||||
|
@ -258,7 +258,7 @@ func TestCloneRequest(t *testing.T) {
|
|||
rr, expectedBytes, err := newReusableRequest(req, 20)
|
||||
assert.NoError(t, err)
|
||||
assert.Nil(t, expectedBytes)
|
||||
assert.Len(t, rr.body, 0)
|
||||
assert.Empty(t, rr.body)
|
||||
})
|
||||
|
||||
t.Run("no request given", func(t *testing.T) {
|
||||
|
|
|
@ -56,7 +56,7 @@ func TestWebSocketTCPClose(t *testing.T) {
|
|||
serverErr := <-errChan
|
||||
|
||||
var wsErr *gorillawebsocket.CloseError
|
||||
require.True(t, errors.As(serverErr, &wsErr))
|
||||
require.ErrorAs(t, serverErr, &wsErr)
|
||||
assert.Equal(t, 1006, wsErr.Code)
|
||||
}
|
||||
|
||||
|
|
|
@ -417,7 +417,7 @@ func Test1xxResponses(t *testing.T) {
|
|||
},
|
||||
}
|
||||
handler, err := sm.getLoadBalancerServiceHandler(context.Background(), "foobar", config)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
|
||||
frontend := httptest.NewServer(handler)
|
||||
t.Cleanup(frontend.Close)
|
||||
|
@ -463,7 +463,7 @@ func Test1xxResponses(t *testing.T) {
|
|||
req, _ := http.NewRequestWithContext(httptrace.WithClientTrace(context.Background(), trace), http.MethodGet, frontend.URL, nil)
|
||||
|
||||
res, err := frontendClient.Do(req)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
|
||||
defer res.Body.Close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue