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:
authorTuomo Ala-Vannesluoma <tuomoav@gmail.com>2018-06-20 20:26:53 +0300
committerTuomo Ala-Vannesluoma <tuomoav@gmail.com>2018-06-30 22:51:43 +0300
commit4d1f6523968b96351bcf0060ad736a3ec13326e7 (patch)
tree414cc5101e27f138cb3bc61db5d5badd36e9ead0 /helpers_test.go
parent50d85895b5a742671bdf90adc8ab2d9c37e8a709 (diff)
Deduplicate running pages with auth
Diffstat (limited to 'helpers_test.go')
-rw-r--r--helpers_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/helpers_test.go b/helpers_test.go
index 1de79a35..f19dd3e8 100644
--- a/helpers_test.go
+++ b/helpers_test.go
@@ -144,6 +144,22 @@ func RunPagesProcessWithSSLCertFile(t *testing.T, pagesPath string, listeners []
return runPagesProcess(t, true, pagesPath, listeners, promPort, []string{"SSL_CERT_FILE=" + sslCertFile}, extraArgs...)
}
+func RunPagesProcessWithAuth(t *testing.T, pagesPath string, listeners []ListenSpec, promPort string) (teardown func()) {
+ return runPagesProcess(t, true, pagesPath, listeners, promPort, nil, "-auth-client-id=1",
+ "-auth-client-secret=1",
+ "-auth-server=https://gitlab-auth.com",
+ "-auth-redirect-uri=https://gitlab-example.com/auth",
+ "-auth-secret=something-very-secret")
+}
+
+func RunPagesProcessWithAuthServer(t *testing.T, pagesPath string, listeners []ListenSpec, promPort string, authServer string) (teardown func()) {
+ return runPagesProcess(t, true, pagesPath, listeners, promPort, nil, "-auth-client-id=1",
+ "-auth-client-secret=1",
+ "-auth-server="+authServer,
+ "-auth-redirect-uri=https://gitlab-example.com/auth",
+ "-auth-secret=something-very-secret")
+}
+
func runPagesProcess(t *testing.T, wait bool, pagesPath string, listeners []ListenSpec, promPort string, extraEnv []string, extraArgs ...string) (teardown func()) {
_, err := os.Stat(pagesPath)
require.NoError(t, err)