diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-08-26 04:58:17 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-08-26 04:58:17 +0300 |
commit | b84c7522c090e2d916f9563de18117f604e8cdf6 (patch) | |
tree | 06584de99e64277f42baaaecb95126812014b008 /test | |
parent | 0ef975db7aaa3595ebf56fde4a91351aa0174f11 (diff) | |
parent | 7182b8d37aa9b49975c21aa9098877bbae355e7c (diff) |
Merge branch 'remove/disk-source-again' into 'master'
refactor: remove leftover references to disk source
Closes #382
See merge request gitlab-org/gitlab-pages!557
Diffstat (limited to 'test')
-rw-r--r-- | test/acceptance/metrics_test.go | 8 | ||||
-rw-r--r-- | test/acceptance/serving_test.go | 75 |
2 files changed, 1 insertions, 82 deletions
diff --git a/test/acceptance/metrics_test.go b/test/acceptance/metrics_test.go index ab220c51..0e8237b7 100644 --- a/test/acceptance/metrics_test.go +++ b/test/acceptance/metrics_test.go @@ -32,13 +32,7 @@ func TestPrometheusMetricsCanBeScraped(t *testing.T) { require.NoError(t, err) require.Contains(t, string(body), "gitlab_pages_http_in_flight_requests 0") - // TODO: remove metrics for disk source https://gitlab.com/gitlab-org/gitlab-pages/-/issues/382 - require.Contains(t, string(body), "gitlab_pages_served_domains 0") - require.Contains(t, string(body), "gitlab_pages_domains_failed_total 0") - require.Contains(t, string(body), "gitlab_pages_domains_updated_total 0") - require.Contains(t, string(body), "gitlab_pages_last_domain_update_seconds gauge") - require.Contains(t, string(body), "gitlab_pages_domains_configuration_update_duration gauge") - // end TODO + require.Contains(t, string(body), "gitlab_pages_domains_source_cache_hit") require.Contains(t, string(body), "gitlab_pages_domains_source_cache_miss") require.Contains(t, string(body), "gitlab_pages_domains_source_failures_total") diff --git a/test/acceptance/serving_test.go b/test/acceptance/serving_test.go index 8c4ab461..d401f417 100644 --- a/test/acceptance/serving_test.go +++ b/test/acceptance/serving_test.go @@ -337,81 +337,6 @@ func TestHTTPSRedirect(t *testing.T) { } } -// TODO: remove with domain-source-config https://gitlab.com/gitlab-org/gitlab-pages/-/issues/382 -func TestDomainsSource(t *testing.T) { - type args struct { - configSource string - domain string - urlSuffix string - } - type want struct { - statusCode int - content string - apiCalled bool - } - tests := []struct { - name string - args args - want want - }{ - { - name: "gitlab_source_domain_exists", - args: args{ - configSource: "gitlab", - domain: "new-source-test.gitlab.io", - urlSuffix: "/my/pages/project/", - }, - want: want{ - statusCode: http.StatusOK, - content: "New Pages GitLab Source TEST OK\n", - apiCalled: true, - }, - }, - { - name: "gitlab_source_domain_does_not_exist", - args: args{ - configSource: "gitlab", - domain: "non-existent-domain.gitlab.io", - }, - want: want{ - statusCode: http.StatusNotFound, - apiCalled: true, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - opts := &stubOpts{ - apiCalled: false, - } - - source := NewGitlabDomainsSourceStub(t, opts) - defer source.Close() - - gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t) - - pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey} - teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, []ListenSpec{httpListener}, "", []string{}, pagesArgs...) - defer teardown() - - response, err := GetPageFromListener(t, httpListener, tt.args.domain, tt.args.urlSuffix) - require.NoError(t, err) - - require.Equal(t, tt.want.statusCode, response.StatusCode) - if tt.want.statusCode == http.StatusOK { - defer response.Body.Close() - body, err := ioutil.ReadAll(response.Body) - require.NoError(t, err) - - require.Equal(t, tt.want.content, string(body), "content mismatch") - } - - require.Equal(t, tt.want.apiCalled, opts.getAPICalled(), "api called mismatch") - }) - } -} - func TestKnownHostInReverseProxySetupReturns200(t *testing.T) { RunPagesProcess(t, withListeners([]ListenSpec{proxyListener}), |