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:
authorJaime Martinez <jmartinez@gitlab.com>2021-05-17 10:11:51 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-05-17 10:11:51 +0300
commitca65440d31d56bfb123ef69309b6e27d83c4b0a7 (patch)
tree63ef04edc8bc457d0a36c3fab85308df1ae767e3
parent19086c1fb27f3a36399dd45d049799c4f40ac244 (diff)
Update acceptance tests and skip disabled ones382-remove-support-for-disk-source-part-1
-rw-r--r--test/acceptance/acceptance_test.go5
-rw-r--r--test/acceptance/acme_test.go4
-rw-r--r--test/acceptance/artifacts_test.go4
-rw-r--r--test/acceptance/auth_test.go24
-rw-r--r--test/acceptance/config_test.go6
-rw-r--r--test/acceptance/encodings_test.go4
-rw-r--r--test/acceptance/helpers_test.go2
-rw-r--r--test/acceptance/proxyv2_test.go2
-rw-r--r--test/acceptance/redirects_test.go6
-rw-r--r--test/acceptance/serving_test.go142
-rw-r--r--test/acceptance/status_test.go6
-rw-r--r--test/acceptance/tls_test.go11
-rw-r--r--test/acceptance/unknown_http_method_test.go3
-rw-r--r--test/acceptance/zip_test.go6
14 files changed, 89 insertions, 136 deletions
diff --git a/test/acceptance/acceptance_test.go b/test/acceptance/acceptance_test.go
index becae777..8c2c5fa4 100644
--- a/test/acceptance/acceptance_test.go
+++ b/test/acceptance/acceptance_test.go
@@ -12,6 +12,7 @@ import (
const (
objectStorageMockServer = "127.0.0.1:38001"
+ diskSourceTest = "disk-source-test"
)
var (
@@ -78,6 +79,10 @@ func skipUnlessEnabled(t *testing.T, conditions ...string) {
t.Log("Not supported with -daemon-inplace-chroot")
t.SkipNow()
}
+ case diskSourceTest:
+ // TODO: rework acceptance tests to use GitLab source instead
+ t.Log("Disk source is not supported anymore, please update test to use API-Based config")
+ t.SkipNow()
default:
t.Error("Unknown condition:", condition)
t.FailNow()
diff --git a/test/acceptance/acme_test.go b/test/acceptance/acme_test.go
index eb8f2160..55b96bb4 100644
--- a/test/acceptance/acme_test.go
+++ b/test/acceptance/acme_test.go
@@ -10,7 +10,7 @@ import (
)
func TestAcmeChallengesWhenItIsNotConfigured(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "")
defer teardown()
@@ -39,7 +39,7 @@ func TestAcmeChallengesWhenItIsNotConfigured(t *testing.T) {
}
func TestAcmeChallengesWhenItIsConfigured(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-gitlab-server=https://gitlab-acme.com")
defer teardown()
diff --git a/test/acceptance/artifacts_test.go b/test/acceptance/artifacts_test.go
index b4dcdce4..31584a29 100644
--- a/test/acceptance/artifacts_test.go
+++ b/test/acceptance/artifacts_test.go
@@ -15,7 +15,7 @@ import (
)
func TestArtifactProxyRequest(t *testing.T) {
- skipUnlessEnabled(t, "not-inplace-chroot")
+ skipUnlessEnabled(t, "not-inplace-chroot", diskSourceTest)
transport := (TestHTTPSClient.Transport).(*http.Transport)
defer func(t time.Duration) {
@@ -161,7 +161,7 @@ func TestArtifactProxyRequest(t *testing.T) {
}
func TestPrivateArtifactProxyRequest(t *testing.T) {
- skipUnlessEnabled(t, "not-inplace-chroot")
+ skipUnlessEnabled(t, "not-inplace-chroot", diskSourceTest)
setupTransport(t)
diff --git a/test/acceptance/auth_test.go b/test/acceptance/auth_test.go
index 980fe377..6cea78f0 100644
--- a/test/acceptance/auth_test.go
+++ b/test/acceptance/auth_test.go
@@ -15,7 +15,7 @@ import (
)
func TestWhenAuthIsDisabledPrivateIsNotAccessible(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "")
defer teardown()
@@ -27,7 +27,7 @@ func TestWhenAuthIsDisabledPrivateIsNotAccessible(t *testing.T) {
}
func TestWhenAuthIsEnabledPrivateWillRedirectToAuthorize(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -59,7 +59,7 @@ func TestWhenAuthIsEnabledPrivateWillRedirectToAuthorize(t *testing.T) {
}
func TestWhenAuthDeniedWillCauseUnauthorized(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -71,7 +71,7 @@ func TestWhenAuthDeniedWillCauseUnauthorized(t *testing.T) {
require.Equal(t, http.StatusUnauthorized, rsp.StatusCode)
}
func TestWhenLoginCallbackWithWrongStateShouldFail(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -90,7 +90,7 @@ func TestWhenLoginCallbackWithWrongStateShouldFail(t *testing.T) {
}
func TestWhenLoginCallbackWithUnencryptedCode(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -181,7 +181,7 @@ func sleepIfAuthorized(t *testing.T, authorization string, w http.ResponseWriter
}
func TestAccessControlUnderCustomDomain(t *testing.T) {
- skipUnlessEnabled(t, "not-inplace-chroot")
+ skipUnlessEnabled(t, "not-inplace-chroot", diskSourceTest)
testServer := makeGitLabPagesAccessStub(t)
testServer.Start()
@@ -263,7 +263,7 @@ func TestAccessControlUnderCustomDomain(t *testing.T) {
}
func TestCustomErrorPageWithAuth(t *testing.T) {
- skipUnlessEnabled(t, "not-inplace-chroot")
+ skipUnlessEnabled(t, "not-inplace-chroot", diskSourceTest)
testServer := makeGitLabPagesAccessStub(t)
testServer.Start()
defer testServer.Close()
@@ -372,7 +372,7 @@ func TestCustomErrorPageWithAuth(t *testing.T) {
}
func TestAccessControlUnderCustomDomainWithHTTPSProxy(t *testing.T) {
- skipUnlessEnabled(t, "not-inplace-chroot")
+ skipUnlessEnabled(t, "not-inplace-chroot", diskSourceTest)
testServer := makeGitLabPagesAccessStub(t)
testServer.Start()
@@ -440,7 +440,7 @@ func TestAccessControlUnderCustomDomainWithHTTPSProxy(t *testing.T) {
}
func TestAccessControlGroupDomain404RedirectsAuth(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -455,7 +455,7 @@ func TestAccessControlGroupDomain404RedirectsAuth(t *testing.T) {
require.Equal(t, "/auth", url.Path)
}
func TestAccessControlProject404DoesNotRedirect(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -476,7 +476,7 @@ func setupTransport(t *testing.T) {
type runPagesFunc func(t *testing.T, pagesPath string, listeners []ListenSpec, promPort string, sslCertFile string, authServer string) func()
func testAccessControl(t *testing.T, runPages runPagesFunc) {
- skipUnlessEnabled(t, "not-inplace-chroot")
+ skipUnlessEnabled(t, "not-inplace-chroot", diskSourceTest)
setupTransport(t)
@@ -650,7 +650,7 @@ func TestAccessControlWithSSLCertDir(t *testing.T) {
// Read the issue description if any changes to internal/auth/ break this test.
// Related to https://tools.ietf.org/html/rfc6749#section-10.6.
func TestHijackedCode(t *testing.T) {
- skipUnlessEnabled(t, "not-inplace-chroot")
+ skipUnlessEnabled(t, "not-inplace-chroot", diskSourceTest)
testServer := makeGitLabPagesAccessStub(t)
testServer.Start()
diff --git a/test/acceptance/config_test.go b/test/acceptance/config_test.go
index 93e9aa22..33fe18e1 100644
--- a/test/acceptance/config_test.go
+++ b/test/acceptance/config_test.go
@@ -11,7 +11,7 @@ import (
)
func TestEnvironmentVariablesConfig(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
os.Setenv("LISTEN_HTTP", net.JoinHostPort(httpListener.Host, httpListener.Port))
defer func() { os.Unsetenv("LISTEN_HTTP") }()
@@ -27,7 +27,7 @@ func TestEnvironmentVariablesConfig(t *testing.T) {
}
func TestMixedConfigSources(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
os.Setenv("LISTEN_HTTP", net.JoinHostPort(httpListener.Host, httpListener.Port))
defer func() { os.Unsetenv("LISTEN_HTTP") }()
@@ -45,7 +45,7 @@ func TestMixedConfigSources(t *testing.T) {
}
func TestMultiFlagEnvironmentVariables(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
listenSpecs := []ListenSpec{{"http", "127.0.0.1", "37001"}, {"http", "127.0.0.1", "37002"}}
envVarValue := fmt.Sprintf("%s,%s", net.JoinHostPort("127.0.0.1", "37001"), net.JoinHostPort("127.0.0.1", "37002"))
diff --git a/test/acceptance/encodings_test.go b/test/acceptance/encodings_test.go
index e58afd4f..65e4ccae 100644
--- a/test/acceptance/encodings_test.go
+++ b/test/acceptance/encodings_test.go
@@ -9,7 +9,7 @@ import (
)
func TestMIMETypes(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithoutWait(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -40,7 +40,7 @@ func TestMIMETypes(t *testing.T) {
}
func TestCompressedEncoding(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
tests := []struct {
name string
diff --git a/test/acceptance/helpers_test.go b/test/acceptance/helpers_test.go
index ba5790a3..7aaf943d 100644
--- a/test/acceptance/helpers_test.go
+++ b/test/acceptance/helpers_test.go
@@ -236,7 +236,7 @@ func RunPagesProcessWithStubGitLabServer(t *testing.T, wait bool, pagesBinary st
source := NewGitlabDomainsSourceStub(t, &stubOpts{})
gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t)
- pagesArgs := append([]string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab"}, extraArgs...)
+ pagesArgs := append([]string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey}, extraArgs...)
logBuf, cleanup := runPagesProcess(t, wait, pagesBinary, listeners, promPort, envs, pagesArgs...)
diff --git a/test/acceptance/proxyv2_test.go b/test/acceptance/proxyv2_test.go
index 670f711c..64aa44e5 100644
--- a/test/acceptance/proxyv2_test.go
+++ b/test/acceptance/proxyv2_test.go
@@ -10,7 +10,7 @@ import (
)
func TestProxyv2(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
logBuf, teardown := RunPagesProcessWithOutput(t, *pagesBinary, supportedListeners(), "")
defer teardown()
diff --git a/test/acceptance/redirects_test.go b/test/acceptance/redirects_test.go
index ed6ce153..44f7a213 100644
--- a/test/acceptance/redirects_test.go
+++ b/test/acceptance/redirects_test.go
@@ -10,7 +10,7 @@ import (
)
func TestDisabledRedirects(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, supportedListeners(), "", []string{"FF_ENABLE_REDIRECTS=false"})
defer teardown()
@@ -31,7 +31,7 @@ func TestDisabledRedirects(t *testing.T) {
}
func TestRedirectStatusPage(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -48,7 +48,7 @@ func TestRedirectStatusPage(t *testing.T) {
}
func TestRedirect(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
diff --git a/test/acceptance/serving_test.go b/test/acceptance/serving_test.go
index 45203c92..096a2ba1 100644
--- a/test/acceptance/serving_test.go
+++ b/test/acceptance/serving_test.go
@@ -15,7 +15,7 @@ import (
)
func TestUnknownHostReturnsNotFound(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -29,7 +29,7 @@ func TestUnknownHostReturnsNotFound(t *testing.T) {
}
func TestUnknownProjectReturnsNotFound(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -40,7 +40,7 @@ func TestUnknownProjectReturnsNotFound(t *testing.T) {
}
func TestGroupDomainReturns200(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -51,7 +51,7 @@ func TestGroupDomainReturns200(t *testing.T) {
}
func TestKnownHostReturns200(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -101,7 +101,7 @@ func TestKnownHostReturns200(t *testing.T) {
}
func TestNestedSubgroups(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
maxNestedSubgroup := 21
@@ -147,7 +147,7 @@ func TestNestedSubgroups(t *testing.T) {
}
func TestCustom404(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -209,7 +209,8 @@ func TestCustom404(t *testing.T) {
}
func TestCORSWhenDisabled(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-disable-cross-origin-requests")
defer teardown()
@@ -225,7 +226,7 @@ func TestCORSWhenDisabled(t *testing.T) {
}
func TestCORSAllowsGET(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -241,7 +242,7 @@ func TestCORSAllowsGET(t *testing.T) {
}
func TestCORSForbidsPOST(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -256,7 +257,7 @@ func TestCORSForbidsPOST(t *testing.T) {
}
func TestCustomHeaders(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-header", "X-Test1:Testing1", "-header", "X-Test2:Testing2")
defer teardown()
@@ -271,7 +272,7 @@ func TestCustomHeaders(t *testing.T) {
}
func TestKnownHostWithPortReturns200(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -286,7 +287,8 @@ func TestKnownHostWithPortReturns200(t *testing.T) {
}
func TestHttpToHttpsRedirectDisabled(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -302,7 +304,8 @@ func TestHttpToHttpsRedirectDisabled(t *testing.T) {
}
func TestHttpToHttpsRedirectEnabled(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-redirect-http=true")
defer teardown()
@@ -320,7 +323,8 @@ func TestHttpToHttpsRedirectEnabled(t *testing.T) {
}
func TestHttpsOnlyGroupEnabled(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -331,7 +335,8 @@ func TestHttpsOnlyGroupEnabled(t *testing.T) {
}
func TestHttpsOnlyGroupDisabled(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -342,7 +347,8 @@ func TestHttpsOnlyGroupDisabled(t *testing.T) {
}
func TestHttpsOnlyProjectEnabled(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -353,7 +359,8 @@ func TestHttpsOnlyProjectEnabled(t *testing.T) {
}
func TestHttpsOnlyProjectDisabled(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -364,7 +371,8 @@ func TestHttpsOnlyProjectDisabled(t *testing.T) {
}
func TestHttpsOnlyDomainDisabled(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -378,10 +386,9 @@ func TestDomainsSource(t *testing.T) {
skipUnlessEnabled(t)
type args struct {
- configSource string
- domain string
- urlSuffix string
- readyCount int
+ domain string
+ urlSuffix string
+ readyCount int
}
type want struct {
statusCode int
@@ -394,11 +401,10 @@ func TestDomainsSource(t *testing.T) {
want want
}{
{
- name: "gitlab_source_domain_exists",
+ name: "domain_exists",
args: args{
- configSource: "gitlab",
- domain: "new-source-test.gitlab.io",
- urlSuffix: "/my/pages/project/",
+ domain: "new-source-test.gitlab.io",
+ urlSuffix: "/my/pages/project/",
},
want: want{
statusCode: http.StatusOK,
@@ -407,77 +413,12 @@ func TestDomainsSource(t *testing.T) {
},
},
{
- name: "gitlab_source_domain_does_not_exist",
- args: args{
- configSource: "gitlab",
- domain: "non-existent-domain.gitlab.io",
- },
- want: want{
- statusCode: http.StatusNotFound,
- apiCalled: true,
- },
- },
- {
- name: "disk_source_domain_exists",
+ name: "domain_does_not_exist",
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",
+ 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,
- },
- },
- {
- name: "auto_source_gitlab_is_not_ready",
- args: args{
- configSource: "auto",
- domain: "test.domain.com",
- urlSuffix: "/",
- readyCount: 100, // big number to ensure the API is in bad state for a while
- },
- want: want{
- statusCode: http.StatusOK,
- content: "main-dir\n",
- apiCalled: false,
- },
- },
- {
- name: "auto_source_gitlab_is_ready",
- args: args{
- configSource: "auto",
- domain: "new-source-test.gitlab.io",
- urlSuffix: "/my/pages/project/",
- readyCount: 0,
- },
- want: want{
- statusCode: http.StatusOK,
- content: "New Pages GitLab Source TEST OK\n",
apiCalled: true,
},
},
@@ -495,7 +436,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()
@@ -520,6 +461,8 @@ func TestDomainsSource(t *testing.T) {
// The first request will fail and display an error but subsequent requests will
// serve from disk source when `domain-config-source=auto`
func TestGitLabSourceBecomesUnauthorized(t *testing.T) {
+ skipUnlessEnabled(t, diskSourceTest)
+
opts := &stubOpts{
// edge case https://gitlab.com/gitlab-org/gitlab-pages/-/issues/535
pagesStatusResponse: http.StatusUnauthorized,
@@ -529,7 +472,7 @@ func TestGitLabSourceBecomesUnauthorized(t *testing.T) {
gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t)
- pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "auto"}
+ pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey}
teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, []ListenSpec{httpListener}, "", []string{}, pagesArgs...)
defer teardown()
@@ -556,7 +499,7 @@ func TestGitLabSourceBecomesUnauthorized(t *testing.T) {
}
func TestKnownHostInReverseProxySetupReturns200(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
specs := []ListenSpec{
proxyListener,
@@ -619,7 +562,7 @@ func TestDomainResolverError(t *testing.T) {
defer source.Close()
gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t)
- pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab"}
+ pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey}
if test.timeout != 0 {
pagesArgs = append(pagesArgs, "-gitlab-client-http-timeout", test.timeout.String(),
"-gitlab-retrieval-timeout", "200ms", "-gitlab-retrieval-interval", "200ms", "-gitlab-retrieval-retries", "1")
@@ -668,7 +611,8 @@ func doCrossOriginRequest(t *testing.T, spec ListenSpec, method, reqMethod, url
}
func TestQueryStringPersistedInSlashRewrite(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -687,7 +631,7 @@ func TestQueryStringPersistedInSlashRewrite(t *testing.T) {
}
func TestServerRepliesWithHeaders(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
tests := map[string]struct {
flags []string
diff --git a/test/acceptance/status_test.go b/test/acceptance/status_test.go
index 84bdf476..cb8e0a03 100644
--- a/test/acceptance/status_test.go
+++ b/test/acceptance/status_test.go
@@ -9,7 +9,7 @@ import (
)
func TestStatusPage(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-pages-status=/@statuscheck")
defer teardown()
@@ -20,7 +20,7 @@ func TestStatusPage(t *testing.T) {
}
func TestStatusNotYetReady(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithoutWait(t, *pagesBinary, supportedListeners(), "", "-pages-status=/@statuscheck", "-pages-root=../../shared/invalid-pages")
defer teardown()
@@ -32,7 +32,7 @@ func TestStatusNotYetReady(t *testing.T) {
}
func TestPageNotAvailableIfNotLoaded(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
teardown := RunPagesProcessWithoutWait(t, *pagesBinary, supportedListeners(), "", "-pages-root=../../shared/invalid-pages")
defer teardown()
waitForRoundtrips(t, supportedListeners(), 5*time.Second)
diff --git a/test/acceptance/tls_test.go b/test/acceptance/tls_test.go
index 8e887a83..a24a255e 100644
--- a/test/acceptance/tls_test.go
+++ b/test/acceptance/tls_test.go
@@ -8,7 +8,8 @@ import (
)
func TestAcceptsSupportedCiphers(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -45,7 +46,8 @@ func tlsConfigWithInsecureCiphersOnly() *tls.Config {
}
func TestRejectsUnsupportedCiphers(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
@@ -63,7 +65,8 @@ func TestRejectsUnsupportedCiphers(t *testing.T) {
}
func TestEnableInsecureCiphers(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-insecure-ciphers")
defer teardown()
@@ -80,7 +83,7 @@ func TestEnableInsecureCiphers(t *testing.T) {
}
func TestTLSVersions(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
tests := map[string]struct {
tlsMin string
diff --git a/test/acceptance/unknown_http_method_test.go b/test/acceptance/unknown_http_method_test.go
index 3aabf800..422684ae 100644
--- a/test/acceptance/unknown_http_method_test.go
+++ b/test/acceptance/unknown_http_method_test.go
@@ -8,7 +8,8 @@ import (
)
func TestUnknownHTTPMethod(t *testing.T) {
- skipUnlessEnabled(t)
+ skipUnlessEnabled(t, diskSourceTest)
+
teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "")
defer teardown()
diff --git a/test/acceptance/zip_test.go b/test/acceptance/zip_test.go
index 212435e8..c49347c1 100644
--- a/test/acceptance/zip_test.go
+++ b/test/acceptance/zip_test.go
@@ -24,7 +24,7 @@ func TestZipServing(t *testing.T) {
gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t)
- pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab"}
+ pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey}
teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, supportedListeners(), "", []string{}, pagesArgs...)
defer teardown()
@@ -124,7 +124,7 @@ func TestZipServingFromDisk(t *testing.T) {
gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t)
- pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab", "-pages-root", wd}
+ pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-pages-root", wd}
teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, supportedListeners(), "", []string{}, pagesArgs...)
defer teardown()
@@ -214,7 +214,7 @@ func TestZipServingConfigShortTimeout(t *testing.T) {
gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t)
- pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab",
+ pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey,
"-zip-open-timeout=1ns"} // <- test purpose
teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, supportedListeners(), "", []string{}, pagesArgs...)