diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2020-02-28 15:52:53 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2020-02-28 15:55:45 +0300 |
commit | 58534b166b00fba05acac5a6f5e2d0e75b240746 (patch) | |
tree | b6531889c167b5a3cb26ba3ffda67664b3bdd719 /internal/domain | |
parent | 70879969bde8aaf97d5ed97d15b904747a44bfb0 (diff) |
Add benchmark for throughput on ensuring domain certs
Diffstat (limited to 'internal/domain')
-rw-r--r-- | internal/domain/domain_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/domain/domain_test.go b/internal/domain/domain_test.go index a43d3c9a..6cad7b8e 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/testhelpers" ) @@ -140,6 +141,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() { |