summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFuXiaoHei <fuxiaohei@vip.qq.com>2023-03-13 18:23:51 +0800
committerGitHub <noreply@github.com>2023-03-13 18:23:51 +0800
commitcdc9e91750036fc370db65a44618f3139db11ae1 (patch)
tree8a7ae4158086eb157d8aaa5689ff164c8b2d4d78 /tests
parent757b4c17e900f1d11a81bc9467d90e6c245ee8f2 (diff)
downloadgitea-cdc9e91750036fc370db65a44618f3139db11ae1.tar.gz
gitea-cdc9e91750036fc370db65a44618f3139db11ae1.zip
add path prefix to ObjectStorage.Iterator (#23332)
Support to iterator subdirectory in ObjectStorage for ObjectStorage.Iterator method. It's required for https://github.com/go-gitea/gitea/pull/22738 to make artifact files cleanable. --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_utils.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_utils.go b/tests/test_utils.go
index e3e5becfbe..102dd3d298 100644
--- a/tests/test_utils.go
+++ b/tests/test_utils.go
@@ -201,7 +201,7 @@ func PrepareTestEnv(t testing.TB, skip ...int) func() {
lfsFixtures, err := storage.NewStorage("", storage.LocalStorageConfig{Path: path.Join(filepath.Dir(setting.AppPath), "tests/gitea-lfs-meta")})
assert.NoError(t, err)
assert.NoError(t, storage.Clean(storage.LFS))
- assert.NoError(t, lfsFixtures.IterateObjects(func(path string, _ storage.Object) error {
+ assert.NoError(t, lfsFixtures.IterateObjects("", func(path string, _ storage.Object) error {
_, err := storage.Copy(storage.LFS, path, lfsFixtures, path)
return err
}))
@@ -258,7 +258,7 @@ func ResetFixtures(t *testing.T) {
lfsFixtures, err := storage.NewStorage("", storage.LocalStorageConfig{Path: path.Join(filepath.Dir(setting.AppPath), "tests/gitea-lfs-meta")})
assert.NoError(t, err)
assert.NoError(t, storage.Clean(storage.LFS))
- assert.NoError(t, lfsFixtures.IterateObjects(func(path string, _ storage.Object) error {
+ assert.NoError(t, lfsFixtures.IterateObjects("", func(path string, _ storage.Object) error {
_, err := storage.Copy(storage.LFS, path, lfsFixtures, path)
return err
}))