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-04-29 08:43:33 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-04-29 08:43:33 +0300
commit890d01033ab17ea5a6208450ced595d12f4ce195 (patch)
tree36e0e6a7901ab66cc4c4aeecec07d05fc1eaeb13 /app_test.go
parent4ff61e374a7dbfa51fee91799f11197e0f8d53f7 (diff)
Use config package in GitLab client
Uses the `internal/config/` client inside the `internal/source/gitlab/` package which makes it easier to extend the configuration. This is an iteration of https://gitlab.com/gitlab-org/gitlab-pages/-/issues/543. Changelog: other
Diffstat (limited to 'app_test.go')
-rw-r--r--app_test.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/app_test.go b/app_test.go
index 48c981cf..48a6013b 100644
--- a/app_test.go
+++ b/app_test.go
@@ -87,16 +87,15 @@ func TestHealthCheckMiddleware(t *testing.T) {
cfg, err := config.LoadConfig()
require.NoError(t, err)
cfg.General.StatusPath = "/-/healthcheck"
- cfg.General.DomainConfigurationSource = "auto"
+
+ domains, err := source.NewDomains("auto", &cfg.GitLab)
+ require.NoError(t, err)
app := theApp{
- config: cfg,
+ config: cfg,
+ domains: domains,
}
- domains, err := source.NewDomains(app.config)
- require.NoError(t, err)
- app.domains = domains
-
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
io.WriteString(w, "Hello from inner handler")