diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-03-14 20:14:06 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-03-18 12:49:31 +0300 |
commit | 2093a05fa4214e69abc75eacea26e926266264b1 (patch) | |
tree | dbe81babe2cd443dd665fe110ff279198b459212 /internal/testhelper | |
parent | 34b272c19a9874df4438feb261168b54d179ce4e (diff) |
Allow additional configuration in configuration build shortcuts
Test-helper functions for gitaly configuration setup extended
with optional configuration parameters list. That allows to
create specific configurations without need to create a builder
manually.
Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2699
Diffstat (limited to 'internal/testhelper')
-rw-r--r-- | internal/testhelper/testcfg/gitaly_builder.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/testhelper/testcfg/gitaly_builder.go b/internal/testhelper/testcfg/gitaly_builder.go index 0caa780a1..59890a5a2 100644 --- a/internal/testhelper/testcfg/gitaly_builder.go +++ b/internal/testhelper/testcfg/gitaly_builder.go @@ -147,8 +147,8 @@ func (gc *GitalyCfgBuilder) BuildWithRepoAt(t testing.TB, relativePath string) ( } // Build creates a minimal configuration setup with no options and returns it with cleanup function. -func Build(t testing.TB) config.Cfg { - cfgBuilder := NewGitalyCfgBuilder() +func Build(t testing.TB, opts ...Option) config.Cfg { + cfgBuilder := NewGitalyCfgBuilder(opts...) t.Cleanup(cfgBuilder.Cleanup) return cfgBuilder.Build(t) @@ -156,8 +156,8 @@ func Build(t testing.TB) config.Cfg { // BuildWithRepo creates a minimal configuration setup with no options. // It also clones test repository at the storage and returns it with the full path to the repository. -func BuildWithRepo(t testing.TB) (config.Cfg, *gitalypb.Repository, string) { - cfgBuilder := NewGitalyCfgBuilder() +func BuildWithRepo(t testing.TB, opts ...Option) (config.Cfg, *gitalypb.Repository, string) { + cfgBuilder := NewGitalyCfgBuilder(opts...) t.Cleanup(cfgBuilder.Cleanup) cfg, repos := cfgBuilder.BuildWithRepoAt(t, t.Name()) |