aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository/lfs_test.go
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-10-19 15:16:11 +0200
committerGitHub <noreply@github.com>2023-10-19 13:16:11 +0000
commit3dc0c962bf3a74188bed02c01b4d34636112805a (patch)
tree588d9e7d8fbc3a4a862f466cada768558a09cc93 /services/repository/lfs_test.go
parent398eccb322f64dded83a119467af2cb38f6dbd46 (diff)
downloadgitea-3dc0c962bf3a74188bed02c01b4d34636112805a.tar.gz
gitea-3dc0c962bf3a74188bed02c01b4d34636112805a.zip
Delete repos of org when purge delete user (#27273)
Fixes https://codeberg.org/forgejo/forgejo/issues/1514 I had to remove `RenameOrganization` to avoid circular import. We should really add some foreign keys to the database.
Diffstat (limited to 'services/repository/lfs_test.go')
-rw-r--r--services/repository/lfs_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/services/repository/lfs_test.go b/services/repository/lfs_test.go
index e88befdfef..61348143d0 100644
--- a/services/repository/lfs_test.go
+++ b/services/repository/lfs_test.go
@@ -1,7 +1,7 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
-package repository
+package repository_test
import (
"bytes"
@@ -16,12 +16,13 @@ import (
"code.gitea.io/gitea/modules/lfs"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
+ repo_service "code.gitea.io/gitea/services/repository"
"github.com/stretchr/testify/assert"
)
func TestGarbageCollectLFSMetaObjects(t *testing.T) {
- assert.NoError(t, unittest.PrepareTestDatabase())
+ unittest.PrepareTestEnv(t)
setting.LFS.StartServer = true
err := storage.Init()
@@ -35,7 +36,7 @@ func TestGarbageCollectLFSMetaObjects(t *testing.T) {
lfsOid := storeObjectInRepo(t, repo.ID, &lfsContent)
// gc
- err = GarbageCollectLFSMetaObjects(context.Background(), GarbageCollectLFSMetaObjectsOptions{
+ err = repo_service.GarbageCollectLFSMetaObjects(context.Background(), repo_service.GarbageCollectLFSMetaObjectsOptions{
AutoFix: true,
OlderThan: time.Now().Add(7 * 24 * time.Hour).Add(5 * 24 * time.Hour),
UpdatedLessRecentlyThan: time.Now().Add(7 * 24 * time.Hour).Add(3 * 24 * time.Hour),