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>2020-11-19 03:43:10 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-11-30 02:15:10 +0300
commit22ede0d8ea69bf26929825a75dad4172ef25cc26 (patch)
treed14744a948992913c09827a6914fb770a86eed92 /test/acceptance
parenta7db22b91f700f5f8ed17fd141a21b763c2af87e (diff)
Move zip flags to config
Diffstat (limited to 'test/acceptance')
-rw-r--r--test/acceptance/zip_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/acceptance/zip_test.go b/test/acceptance/zip_test.go
index ea703ebe..3bfa21bf 100644
--- a/test/acceptance/zip_test.go
+++ b/test/acceptance/zip_test.go
@@ -104,6 +104,31 @@ func TestZipServing(t *testing.T) {
}
}
+func TestZipServingConfigShortTimeout(t *testing.T) {
+ skipUnlessEnabled(t)
+
+ var apiCalled bool
+ source := NewGitlabDomainsSourceStub(t, &apiCalled)
+ defer source.Close()
+
+ gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t)
+
+ pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab",
+ "-zip-open-timeout=1ns"} // <- test purpose
+
+ teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, listeners, "", []string{}, pagesArgs...)
+ defer teardown()
+
+ _, cleanup := newZipFileServerURL(t, "../../shared/pages/group/zip.gitlab.io/public.zip")
+ defer cleanup()
+
+ response, err := GetPageFromListener(t, httpListener, "zip.gitlab.io", "/")
+ require.NoError(t, err)
+ defer response.Body.Close()
+
+ require.Equal(t, http.StatusInternalServerError, response.StatusCode, "should fail to serve")
+}
+
func newZipFileServerURL(t *testing.T, zipFilePath string) (string, func()) {
t.Helper()