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:
-rw-r--r--internal/redirects/redirects_benchmark_test.go5
-rw-r--r--internal/redirects/redirects_test.go2
2 files changed, 2 insertions, 5 deletions
diff --git a/internal/redirects/redirects_benchmark_test.go b/internal/redirects/redirects_benchmark_test.go
index 35e5cc25..38adcb68 100644
--- a/internal/redirects/redirects_benchmark_test.go
+++ b/internal/redirects/redirects_benchmark_test.go
@@ -4,7 +4,6 @@ import (
"context"
"io/ioutil"
"net/url"
- "os"
"path"
"strings"
"testing"
@@ -56,9 +55,7 @@ func BenchmarkRedirectsRewrite_withoutPlaceholders(b *testing.B) {
}
func BenchmarkRedirectsRewrite_PlaceholdersEnabled(b *testing.B) {
- orig := os.Getenv(FFEnablePlaceholders)
- os.Setenv(FFEnablePlaceholders, "true")
- b.Cleanup(func() { os.Setenv(FFEnablePlaceholders, orig) })
+ enablePlaceholders(b)
b.Run("10 redirects", func(b *testing.B) { benchmarkRedirectsRewrite(b, 10) })
b.Run("100 redirects", func(b *testing.B) { benchmarkRedirectsRewrite(b, 100) })
diff --git a/internal/redirects/redirects_test.go b/internal/redirects/redirects_test.go
index 3287091c..6ae141f5 100644
--- a/internal/redirects/redirects_test.go
+++ b/internal/redirects/redirects_test.go
@@ -16,7 +16,7 @@ import (
)
// enablePlaceholders enables the FF_ENABLE_PLACEHOLDERS in tests
-func enablePlaceholders(t *testing.T) {
+func enablePlaceholders(t testing.TB) {
t.Helper()
orig := os.Getenv(FFEnablePlaceholders)