diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-08-18 18:16:08 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-08-18 18:16:08 +0300 |
commit | 2cf4ff147e37db631521e59968f86f18dbca5835 (patch) | |
tree | 4d28623f1797c1c5e062a2785363abece85826ec /test | |
parent | cf5311514aa603b251226e97fcdc0bf4f2a1a655 (diff) |
test: remove edge case for auto configuration source
since polling is being removed, setting config source to auto
won't switch automatically to disk source if the gitlab source
fails a request to the api.
Note that config source is being removed in the next version so
this test is will fail anyway.
Diffstat (limited to 'test')
-rw-r--r-- | test/acceptance/serving_test.go | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/test/acceptance/serving_test.go b/test/acceptance/serving_test.go index 77f8118e..a4f3085b 100644 --- a/test/acceptance/serving_test.go +++ b/test/acceptance/serving_test.go @@ -492,46 +492,6 @@ func TestDomainsSource(t *testing.T) { } } -// TestGitLabSourceBecomesUnauthorized proves workaround for https://gitlab.com/gitlab-org/gitlab-pages/-/issues/535 -// The first request will fail and display an error but subsequent requests will -// serve from disk source when `domain-config-source=auto` -// TODO: remove with domain-source-config https://gitlab.com/gitlab-org/gitlab-pages/-/issues/382 -func TestGitLabSourceBecomesUnauthorized(t *testing.T) { - opts := &stubOpts{ - // edge case https://gitlab.com/gitlab-org/gitlab-pages/-/issues/535 - pagesStatusResponse: http.StatusUnauthorized, - } - source := NewGitlabDomainsSourceStub(t, opts) - defer source.Close() - - gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t) - - pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "auto"} - teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, []ListenSpec{httpListener}, "", []string{}, pagesArgs...) - defer teardown() - - domain := "test.domain.com" - failedResponse, err := GetPageFromListener(t, httpListener, domain, "/") - require.NoError(t, err) - - require.True(t, opts.getAPICalled(), "API should be called") - require.Equal(t, http.StatusBadGateway, failedResponse.StatusCode, "first response should fail with 502") - - // make request again - opts.setAPICalled(false) - - response, err := GetPageFromListener(t, httpListener, domain, "/") - require.NoError(t, err) - defer response.Body.Close() - - require.False(t, opts.getAPICalled(), "API should not be called after the first failure") - require.Equal(t, http.StatusOK, response.StatusCode, "second response should succeed") - - body, err := ioutil.ReadAll(response.Body) - require.NoError(t, err) - require.Equal(t, "main-dir\n", string(body), "content mismatch") -} - func TestKnownHostInReverseProxySetupReturns200(t *testing.T) { RunPagesProcess(t, withListeners([]ListenSpec{proxyListener}), |