From 0dc345e1a3278ea4b922e2a7bf4952caf20bc139 Mon Sep 17 00:00:00 2001 From: Jaime Martinez Date: Tue, 3 Aug 2021 15:12:53 +1000 Subject: refactor: fail to start without listeners defined as part of the configuration during daemon initialization. Changelog: other --- app_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app_test.go') 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" -- cgit v1.2.3