diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /workhorse/config_test.go | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'workhorse/config_test.go')
-rw-r--r-- | workhorse/config_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/workhorse/config_test.go b/workhorse/config_test.go index b1b04cb9a65..5a2743f375a 100644 --- a/workhorse/config_test.go +++ b/workhorse/config_test.go @@ -101,6 +101,38 @@ func TestConfigDefaults(t *testing.T) { require.Equal(t, expectedCfg, cfg) } +func TestCableConfigDefault(t *testing.T) { + backendURL, err := url.Parse("http://localhost:1234") + require.NoError(t, err) + + args := []string{ + "-authBackend", backendURL.String(), + } + boot, cfg, err := buildConfig("test", args) + require.NoError(t, err, "build config") + + expectedBoot := &bootConfig{ + secretPath: "./.gitlab_workhorse_secret", + listenAddr: "localhost:8181", + listenNetwork: "tcp", + logFormat: "text", + } + + require.Equal(t, expectedBoot, boot) + + expectedCfg := &config.Config{ + Backend: backendURL, + CableBackend: backendURL, + Version: "(unknown version)", + DocumentRoot: "public", + ProxyHeadersTimeout: 5 * time.Minute, + APIQueueTimeout: queueing.DefaultTimeout, + APICILongPollingDuration: 50 * time.Nanosecond, + ImageResizerConfig: config.DefaultImageResizerConfig, + } + require.Equal(t, expectedCfg, cfg) +} + func TestConfigFlagParsing(t *testing.T) { backendURL, err := url.Parse("http://localhost:1234") require.NoError(t, err) |