diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-10-19 12:08:31 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-01 17:01:35 +0300 |
commit | 509035a28cd7cef6a4b96bd0a3cbd38dfdf2c0c3 (patch) | |
tree | d39145ba194b55329f025d71e232a00449cf55f5 | |
parent | 20c143ee19056b56ab3d9ad5739fb0d84d912fa0 (diff) |
server: Fix test setup to construct a proper config
Some of our tests in the server authentication tests are running a
Gitaly server with an empty config, which is not a valid configuration.
Fix this by using the testcfg package to build a valid config for us.
-rw-r--r-- | internal/gitaly/server/auth_test.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/gitaly/server/auth_test.go b/internal/gitaly/server/auth_test.go index adf2d6300..4720ba4a2 100644 --- a/internal/gitaly/server/auth_test.go +++ b/internal/gitaly/server/auth_test.go @@ -42,7 +42,7 @@ func TestMain(m *testing.M) { } func TestSanity(t *testing.T) { - serverSocketPath := runServer(t, config.Cfg{}) + serverSocketPath := runServer(t, testcfg.Build(t)) conn, err := dial(serverSocketPath, []grpc.DialOption{grpc.WithInsecure()}) require.NoError(t, err) @@ -96,7 +96,11 @@ func TestAuthFailures(t *testing.T) { } for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - serverSocketPath := runServer(t, config.Cfg{Auth: auth.Config{Token: "quxbaz"}}) + cfg := testcfg.Build(t, testcfg.WithBase(config.Cfg{ + Auth: auth.Config{Token: "quxbaz"}, + })) + + serverSocketPath := runServer(t, cfg) connOpts := append(tc.opts, grpc.WithInsecure()) conn, err := dial(serverSocketPath, connOpts) require.NoError(t, err, tc.desc) |