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-08-03 08:12:53 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-08-03 08:13:15 +0300
commit0dc345e1a3278ea4b922e2a7bf4952caf20bc139 (patch)
treea39a7d914c3d1c4c14f471f18c69463ff61b8e80 /app_test.go
parente48c8977887e0f33f2934b46e97e8dfe96f08d92 (diff)
refactor: fail to start without listeners
defined as part of the configuration during daemon initialization. Changelog: other
Diffstat (limited to 'app_test.go')
-rw-r--r--app_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/app_test.go b/app_test.go
index 48a6013b..669d041e 100644
--- a/app_test.go
+++ b/app_test.go
@@ -6,6 +6,7 @@ import (
"io"
"net/http"
"net/http/httptest"
+ "os"
"testing"
"github.com/stretchr/testify/require"
@@ -84,6 +85,12 @@ func TestHealthCheckMiddleware(t *testing.T) {
},
}
+ // required by LoadConfig
+ require.NoError(t, os.Setenv("LISTEN_HTTP", ":0"))
+ t.Cleanup(func() {
+ require.NoError(t, os.Unsetenv("LISTEN_HTTP"))
+ })
+
cfg, err := config.LoadConfig()
require.NoError(t, err)
cfg.General.StatusPath = "/-/healthcheck"