diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-08-16 16:09:57 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-08-20 04:39:10 +0300 |
commit | fc9f9694567273ec72e65db3673495a1b8d24050 (patch) | |
tree | 4f491fd975fcd3bed53fc41bb8cb1e40d37327f6 /test | |
parent | 8a8074fac85119724b68af4456264e15750643c6 (diff) |
test: remove domain-config-source=gitlab from test and remove tests using disk source
Diffstat (limited to 'test')
-rw-r--r-- | test/acceptance/helpers_test.go | 11 | ||||
-rw-r--r-- | test/acceptance/serving_test.go | 49 |
2 files changed, 1 insertions, 59 deletions
diff --git a/test/acceptance/helpers_test.go b/test/acceptance/helpers_test.go index c1074230..c8852976 100644 --- a/test/acceptance/helpers_test.go +++ b/test/acceptance/helpers_test.go @@ -242,7 +242,6 @@ func RunPagesProcess(t *testing.T, opts ...processOption) *LogCaptureBuffer { "-pages-root", wd, "-internal-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, - "-domain-config-source", "gitlab", ) logBuf, cleanup := runPagesProcess(t, processCfg.wait, processCfg.pagesBinary, processCfg.listeners, "", processCfg.envs, processCfg.extraArgs...) @@ -352,16 +351,6 @@ func getPagesArgs(t *testing.T, listeners []ListenSpec, promPort string, extraAr args = append(args, "-metrics-address", promPort) } - // most of our acceptance tests still work only with disk source - // TODO: remove this with -domain-config-source flag itself along with daemon-enable-jail: - // https://gitlab.com/gitlab-org/gitlab-pages/-/issues/382 - // https://gitlab.com/gitlab-org/gitlab-pages/-/issues/561 - if !contains(extraArgs, "-domain-config-source") { - args = append(args, - "-domain-config-source", "disk", - ) - } - args = append(args, getPagesDaemonArgs(t)...) args = append(args, extraArgs...) diff --git a/test/acceptance/serving_test.go b/test/acceptance/serving_test.go index a4f3085b..238a05dd 100644 --- a/test/acceptance/serving_test.go +++ b/test/acceptance/serving_test.go @@ -4,8 +4,6 @@ import ( "fmt" "io/ioutil" "net/http" - "os" - "path" "strings" "testing" "time" @@ -106,51 +104,6 @@ func TestKnownHostReturns200(t *testing.T) { } } -// TODO: remove along with support for disk configuration https://gitlab.com/gitlab-org/gitlab-pages/-/issues/382 -func TestNestedSubgroups(t *testing.T) { - maxNestedSubgroup := 21 - - pagesRoot, err := ioutil.TempDir("", "pages-root") - require.NoError(t, err) - defer os.RemoveAll(pagesRoot) - - makeProjectIndex := func(subGroupPath string) { - projectPath := path.Join(pagesRoot, "nested", subGroupPath, "project", "public") - require.NoError(t, os.MkdirAll(projectPath, 0755)) - - projectIndex := path.Join(projectPath, "index.html") - require.NoError(t, ioutil.WriteFile(projectIndex, []byte("index"), 0644)) - } - makeProjectIndex("") - - paths := []string{""} - for i := 1; i < maxNestedSubgroup*2; i++ { - subGroupPath := fmt.Sprintf("%ssub%d/", paths[i-1], i) - paths = append(paths, subGroupPath) - - makeProjectIndex(subGroupPath) - } - - teardown := RunPagesProcessWithoutGitLabStub(t, *pagesBinary, supportedListeners(), "", "-pages-root", pagesRoot) - defer teardown() - - for nestingLevel, path := range paths { - t.Run(fmt.Sprintf("nested level %d", nestingLevel), func(t *testing.T) { - for _, spec := range supportedListeners() { - rsp, err := GetPageFromListener(t, spec, "nested.gitlab-example.com", path+"project/") - - require.NoError(t, err) - rsp.Body.Close() - if nestingLevel <= maxNestedSubgroup { - require.Equal(t, http.StatusOK, rsp.StatusCode) - } else { - require.Equal(t, http.StatusNotFound, rsp.StatusCode) - } - } - }) - } -} - func TestCustom404(t *testing.T) { RunPagesProcess(t) @@ -471,7 +424,7 @@ func TestDomainsSource(t *testing.T) { gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t) - pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", tt.args.configSource} + pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey} teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, []ListenSpec{httpListener}, "", []string{}, pagesArgs...) defer teardown() |