diff options
-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() { |