diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-08-03 13:00:59 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-08-05 09:52:31 +0300 |
commit | 1c28a5030390f7079ef1fd5208f7c4fc06f0d1ad (patch) | |
tree | 0a11efbf29b7b8bb46a0ea4d99af53093f3255d6 /internal/cache/diskcache_test.go | |
parent | 3ba275c8ff0449668f78ba6b5c707f6131cbec66 (diff) |
gittest: Make relative path of `CloneRepoAtStorage` optional
Most tests don't really care about the relative path of the repository
that is to be created. Furthermore, manually specifying a relative path
will lead to repository paths outside of our typicaly hashed storage
paths, and as thus they don't really match what we'd see in production.
Put the relative path into an optional `CloneRepoOpts` structure: if
unset, we'll compute random hashed storage-style repository paths. Most
callers are converted to not pass a relative path at all, while a small
bunch of tests which relies on deterministic paths are converted to use
the options struct.
Diffstat (limited to 'internal/cache/diskcache_test.go')
-rw-r--r-- | internal/cache/diskcache_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/cache/diskcache_test.go b/internal/cache/diskcache_test.go index 10349c658..5784e3377 100644 --- a/internal/cache/diskcache_test.go +++ b/internal/cache/diskcache_test.go @@ -22,8 +22,8 @@ import ( func TestStreamDBNaiveKeyer(t *testing.T) { cfg := testcfg.Build(t) - testRepo1, _, _ := gittest.CloneRepoAtStorage(t, cfg, cfg.Storages[0], "repository-1") - testRepo2, _, _ := gittest.CloneRepoAtStorage(t, cfg, cfg.Storages[0], "repository-2") + testRepo1, _, _ := gittest.CloneRepoAtStorage(t, cfg, cfg.Storages[0]) + testRepo2, _, _ := gittest.CloneRepoAtStorage(t, cfg, cfg.Storages[0]) locator := config.NewLocator(cfg) |