diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2020-08-04 11:34:48 +0300 |
---|---|---|
committer | Vladimir Shushlin <vshushlin@gitlab.com> | 2020-08-04 11:34:48 +0300 |
commit | a3365a7b1b41b3dee206cbcf27e915ee45d556a5 (patch) | |
tree | 2864eb65d1ab1631ea62c1c0643c2fbe66d13bf5 /acceptance_test.go | |
parent | b3bf3ac415be9615e41d14e68bf3e0074b5dbeb3 (diff) | |
parent | 654eee26e97a0f0b716bbdec65a85d8576f8b162 (diff) |
Merge branch 'use-domain-config-source-disk' into 'master'
Use domain config source disk
See merge request gitlab-org/gitlab-pages!305
Diffstat (limited to 'acceptance_test.go')
-rw-r--r-- | acceptance_test.go | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/acceptance_test.go b/acceptance_test.go index 2b0a7800..abcf3592 100644 --- a/acceptance_test.go +++ b/acceptance_test.go @@ -1714,22 +1714,11 @@ func TestGitlabDomainsSource(t *testing.T) { source := NewGitlabDomainsSourceStub(t) defer source.Close() - gitlabSourceConfig := ` -domains: - enabled: - - new-source-test.gitlab.io - broken: pages-broken-poc.gitlab.io -` - gitlabSourceConfigFile, cleanupGitlabSourceConfigFile := CreateGitlabSourceConfigFixtureFile(t, gitlabSourceConfig) - defer cleanupGitlabSourceConfigFile() - - gitlabSourceConfigFile = "GITLAB_SOURCE_CONFIG_FILE=" + gitlabSourceConfigFile - gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t) - pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey} + pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab"} - teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, listeners, "", []string{gitlabSourceConfigFile}, pagesArgs...) + teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, listeners, "", []string{}, pagesArgs...) defer teardown() t.Run("when a domain exists", func(t *testing.T) { @@ -1737,7 +1726,8 @@ domains: require.NoError(t, err) defer response.Body.Close() - body, _ := ioutil.ReadAll(response.Body) + body, err := ioutil.ReadAll(response.Body) + require.NoError(t, err) require.Equal(t, http.StatusOK, response.StatusCode) require.Equal(t, "New Pages GitLab Source TEST OK\n", string(body)) @@ -1750,13 +1740,4 @@ domains: require.Equal(t, http.StatusNotFound, response.StatusCode) }) - - t.Run("broken domain is requested", func(t *testing.T) { - response, err := GetPageFromListener(t, httpListener, "pages-broken-poc.gitlab.io", "index.html") - require.NoError(t, err) - - defer response.Body.Close() - - require.Equal(t, http.StatusBadGateway, response.StatusCode) - }) } |