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:
Diffstat (limited to 'test/acceptance/serving_test.go')
-rw-r--r--test/acceptance/serving_test.go85
1 files changed, 1 insertions, 84 deletions
diff --git a/test/acceptance/serving_test.go b/test/acceptance/serving_test.go
index c42866ee..8c4ab461 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)
@@ -425,42 +378,6 @@ func TestDomainsSource(t *testing.T) {
apiCalled: true,
},
},
- {
- name: "disk_source_domain_exists",
- args: args{
- configSource: "disk",
- // test.domain.com sourced from disk configuration
- domain: "test.domain.com",
- urlSuffix: "/",
- },
- want: want{
- statusCode: http.StatusOK,
- content: "main-dir\n",
- apiCalled: false,
- },
- },
- {
- name: "disk_source_domain_does_not_exist",
- args: args{
- configSource: "disk",
- domain: "non-existent-domain.gitlab.io",
- },
- want: want{
- statusCode: http.StatusNotFound,
- apiCalled: false,
- },
- },
- {
- name: "disk_source_domain_should_not_exist_under_hashed_dir",
- args: args{
- configSource: "disk",
- domain: "hashed.com",
- },
- want: want{
- statusCode: http.StatusNotFound,
- apiCalled: false,
- },
- },
}
for _, tt := range tests {
@@ -474,7 +391,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()