Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2022-04-25 14:51:49 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2022-04-25 14:53:28 +0300
commit6600c754fbb1c3f96cff1c576473935f295ab5cb (patch)
tree5ecced2d245dbeb0d6b130f81b09c211fad0c846 /internal/handlers
parent950512e00946a5d7df2d82cd6e2a4fe131c90659 (diff)
Replace os.Setenv with testing.SetEnv
Diffstat (limited to 'internal/handlers')
-rw-r--r--internal/handlers/ratelimiter_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/handlers/ratelimiter_test.go b/internal/handlers/ratelimiter_test.go
index 43acfc9a..1ff1c0e5 100644
--- a/internal/handlers/ratelimiter_test.go
+++ b/internal/handlers/ratelimiter_test.go
@@ -3,6 +3,7 @@ package handlers
import (
"net/http"
"net/http/httptest"
+ "strconv"
"testing"
"github.com/stretchr/testify/require"
@@ -75,8 +76,8 @@ func TestRatelimiter(t *testing.T) {
for name, tc := range tt {
t.Run(name, func(t *testing.T) {
- testhelpers.StubFeatureFlagValue(t, feature.EnforceIPRateLimits.EnvVariable, tc.sourceIPEnforced)
- testhelpers.StubFeatureFlagValue(t, feature.EnforceDomainRateLimits.EnvVariable, tc.domainEnforced)
+ t.Setenv(feature.EnforceIPRateLimits.EnvVariable, strconv.FormatBool(tc.sourceIPEnforced))
+ t.Setenv(feature.EnforceDomainRateLimits.EnvVariable, strconv.FormatBool(tc.domainEnforced))
conf := config.RateLimit{
SourceIPLimitPerSecond: 0.1,