diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/acceptance/serving_test.go | 75 |
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}), |