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:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-08-26 04:28:25 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-08-26 04:28:25 +0300
commitd1ea8385938591c401d34d7aba550cf30fc81629 (patch)
tree5cb40270bdead3b621f77e6d518d80125532d6c2
parent86499385a29d605cf523743aaee8e09354a640c4 (diff)
test: remove TestDomainsSource acceptance test
-rw-r--r--test/acceptance/serving_test.go75
1 files changed, 0 insertions, 75 deletions
diff --git a/test/acceptance/serving_test.go b/test/acceptance/serving_test.go
index 8c4ab461..d401f417 100644
--- a/test/acceptance/serving_test.go
+++ b/test/acceptance/serving_test.go
@@ -337,81 +337,6 @@ func TestHTTPSRedirect(t *testing.T) {
}
}
-// TODO: remove with domain-source-config https://gitlab.com/gitlab-org/gitlab-pages/-/issues/382
-func TestDomainsSource(t *testing.T) {
- type args struct {
- configSource string
- domain string
- urlSuffix string
- }
- type want struct {
- statusCode int
- content string
- apiCalled bool
- }
- tests := []struct {
- name string
- args args
- want want
- }{
- {
- name: "gitlab_source_domain_exists",
- args: args{
- configSource: "gitlab",
- domain: "new-source-test.gitlab.io",
- urlSuffix: "/my/pages/project/",
- },
- want: want{
- statusCode: http.StatusOK,
- content: "New Pages GitLab Source TEST OK\n",
- apiCalled: true,
- },
- },
- {
- name: "gitlab_source_domain_does_not_exist",
- args: args{
- configSource: "gitlab",
- domain: "non-existent-domain.gitlab.io",
- },
- want: want{
- statusCode: http.StatusNotFound,
- apiCalled: true,
- },
- },
- }
-
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- opts := &stubOpts{
- apiCalled: false,
- }
-
- source := NewGitlabDomainsSourceStub(t, opts)
- defer source.Close()
-
- gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t)
-
- pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey}
- teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, []ListenSpec{httpListener}, "", []string{}, pagesArgs...)
- defer teardown()
-
- response, err := GetPageFromListener(t, httpListener, tt.args.domain, tt.args.urlSuffix)
- require.NoError(t, err)
-
- require.Equal(t, tt.want.statusCode, response.StatusCode)
- if tt.want.statusCode == http.StatusOK {
- defer response.Body.Close()
- body, err := ioutil.ReadAll(response.Body)
- require.NoError(t, err)
-
- require.Equal(t, tt.want.content, string(body), "content mismatch")
- }
-
- require.Equal(t, tt.want.apiCalled, opts.getAPICalled(), "api called mismatch")
- })
- }
-}
-
func TestKnownHostInReverseProxySetupReturns200(t *testing.T) {
RunPagesProcess(t,
withListeners([]ListenSpec{proxyListener}),