mirror of
https://github.com/coder/coder.git
synced 2025-07-21 01:28:49 +00:00
@ -99,7 +99,9 @@ func TestExtractUserRoles(t *testing.T) {
|
||||
})
|
||||
|
||||
rtr.ServeHTTP(rw, req)
|
||||
require.Equal(t, http.StatusOK, rw.Result().StatusCode)
|
||||
resp := rw.Result()
|
||||
defer resp.Body.Close()
|
||||
require.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ func (*testOAuth2Provider) TokenSource(_ context.Context, _ *oauth2.Token) oauth
|
||||
return nil
|
||||
}
|
||||
|
||||
// nolint:bodyclose
|
||||
func TestOAuth2(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Run("NotSetup", func(t *testing.T) {
|
||||
|
@ -17,6 +17,7 @@ import (
|
||||
func TestPrometheus(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Run("All", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
req := httptest.NewRequest("GET", "/", nil)
|
||||
req = req.WithContext(context.WithValue(req.Context(), chi.RouteCtxKey, chi.NewRouteContext()))
|
||||
res := chimw.NewWrapResponseWriter(httptest.NewRecorder(), 0)
|
||||
|
@ -26,7 +26,9 @@ func TestRateLimit(t *testing.T) {
|
||||
req := httptest.NewRequest("GET", "/", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
rtr.ServeHTTP(rec, req)
|
||||
return rec.Result().StatusCode == http.StatusTooManyRequests
|
||||
resp := rec.Result()
|
||||
defer resp.Body.Close()
|
||||
return resp.StatusCode == http.StatusTooManyRequests
|
||||
}, testutil.WaitShort, testutil.IntervalFast)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user