Skip to content

Commit

Permalink
fix(e2e): set ratelimiter config in tests so they would pass
Browse files Browse the repository at this point in the history
  • Loading branch information
olexsmir committed Oct 17, 2024
1 parent f9b8e5b commit a6296e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
}

Expand Down

0 comments on commit a6296e0

Please sign in to comment.