diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-06-02 09:01:58 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-06-09 06:53:23 +0300 |
commit | 2616ab9f7c95975ecacacaf96cab3cd00d65fb54 (patch) | |
tree | 0b13e0f17c71f506d5dc4491c5c35f236500826b /test/acceptance/helpers_test.go | |
parent | 01eea5b834b06f06fbb90684b8f082c4b7ad3acc (diff) |
WIP: update serving_test.go to run pages process with gitlab server
Diffstat (limited to 'test/acceptance/helpers_test.go')
-rw-r--r-- | test/acceptance/helpers_test.go | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/acceptance/helpers_test.go b/test/acceptance/helpers_test.go index c434ce37..97387786 100644 --- a/test/acceptance/helpers_test.go +++ b/test/acceptance/helpers_test.go @@ -25,6 +25,7 @@ import ( "golang.org/x/net/nettest" "gitlab.com/gitlab-org/gitlab-pages/internal/request" + "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers" "gitlab.com/gitlab-org/gitlab-pages/test/acceptance/testdata" ) @@ -232,16 +233,27 @@ func RunPagesProcessWithOutput(t *testing.T, pagesBinary string, listeners []Lis return runPagesProcess(t, true, pagesBinary, listeners, promPort, nil, extraArgs...) } -func RunPagesProcessWithStubGitLabServer(t *testing.T, wait bool, pagesBinary string, listeners []ListenSpec, promPort string, envs []string, extraArgs ...string) (*LogCaptureBuffer, func()) { - source := NewGitlabDomainsSourceStub(t, &stubOpts{}) +func RunPagesProcessWithStubGitLabServer(t *testing.T, wait bool, pagesBinary string, listeners []ListenSpec, envs []string, extraArgs ...string) (*LogCaptureBuffer, func()) { + chdir := false + chdirCleanup := testhelpers.ChdirInPath(t, "../../shared/pages", &chdir) + + wd, err := os.Getwd() + require.NoError(t, err) + + opts := &stubOpts{ + pagesRoot: wd, + } + + source := NewGitlabDomainsSourceStub(t, opts) gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t) - pagesArgs := append([]string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab"}, extraArgs...) + pagesArgs := append([]string{"-pages-root", wd, "-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab"}, extraArgs...) - logBuf, cleanup := runPagesProcess(t, wait, pagesBinary, listeners, promPort, envs, pagesArgs...) + logBuf, cleanup := runPagesProcess(t, wait, pagesBinary, listeners, "", envs, pagesArgs...) return logBuf, func() { source.Close() + chdirCleanup() cleanup() } } |