From a6296e086b6e55f121bbf6b1c3bfaf16c374431c Mon Sep 17 00:00:00 2001 From: Smirnov Oleksandr Date: Thu, 17 Oct 2024 23:08:15 +0300 Subject: [PATCH] fix(e2e): set ratelimiter config in tests so they would pass --- e2e/e2e_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 6623dc77..557b4fd2 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -26,6 +26,7 @@ import ( "github.com/olexsmir/onasty/internal/store/psql/vertokrepo" "github.com/olexsmir/onasty/internal/store/psqlutil" httptransport "github.com/olexsmir/onasty/internal/transport/http" + "github.com/olexsmir/onasty/internal/transport/http/ratelimit" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/testcontainers/testcontainers-go" @@ -117,7 +118,14 @@ func (e *AppTestSuite) initDeps() { noterepo := noterepo.New(e.postgresDB) notesrv := notesrv.New(noterepo) - handler := httptransport.NewTransport(usersrv, notesrv) + // for testing purposes, it's ok to have high values ig + ratelimitCfg := ratelimit.Config{ + RPS: 1000, + TTL: time.Millisecond, + Burst: 1000, + } + + handler := httptransport.NewTransport(usersrv, notesrv, ratelimitCfg) e.router = handler.Handler() }