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:
authorAlessio Caiazza <acaiazza@gitlab.com>2020-02-28 19:10:09 +0300
committerAlessio Caiazza <acaiazza@gitlab.com>2020-02-28 19:10:09 +0300
commit3ae8b1c077bef83c480cba2695e3943ba152e00c (patch)
treeca3eecf959bdf1252dfe9e2bd3de60ac74d3f869 /internal
parent487aaebc4184020c1f7695c55b631fe7989f437d (diff)
parent58534b166b00fba05acac5a6f5e2d0e75b240746 (diff)
Merge branch 'backstage/gb/add-ensure-certs-benchmark' into 'master'
Add benchmark for throughput on ensuring domain certs See merge request gitlab-org/gitlab-pages!251
Diffstat (limited to 'internal')
-rw-r--r--internal/domain/domain_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/domain/domain_test.go b/internal/domain/domain_test.go
index aa95eb95..e22ff7a6 100644
--- a/internal/domain/domain_test.go
+++ b/internal/domain/domain_test.go
@@ -11,6 +11,7 @@ import (
"github.com/stretchr/testify/require"
+ "gitlab.com/gitlab-org/gitlab-pages/internal/fixture"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk"
"gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers"
@@ -145,6 +146,18 @@ func TestDomainNoCertificate(t *testing.T) {
require.Equal(t, err, err2)
}
+func BenchmarkEnsureCertificate(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ testDomain := &Domain{
+ Name: "test.domain.com",
+ CertificateCert: fixture.Certificate,
+ CertificateKey: fixture.Key,
+ }
+
+ testDomain.EnsureCertificate()
+ }
+}
+
var chdirSet = false
func setUpTests(t require.TestingT) func() {