diff options
Diffstat (limited to 'services/release/release_test.go')
-rw-r--r-- | services/release/release_test.go | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/services/release/release_test.go b/services/release/release_test.go index 97febeecb9..d30dfee286 100644 --- a/services/release/release_test.go +++ b/services/release/release_test.go @@ -100,62 +100,3 @@ func TestRelease_Create(t *testing.T) { IsTag: true, }, nil)) } - -func TestRelease_MirrorDelete(t *testing.T) { - assert.NoError(t, models.PrepareTestDatabase()) - - user := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User) - repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository) - repoPath := models.RepoPath(user.Name, repo.Name) - migrationOptions := models.MigrateRepoOptions{ - Name: "test_mirror", - Description: "Test mirror", - IsPrivate: false, - IsMirror: true, - RemoteAddr: repoPath, - Wiki: true, - SyncReleasesWithTags: true, - } - mirror, err := models.MigrateRepository(user, user, migrationOptions) - assert.NoError(t, err) - - gitRepo, err := git.OpenRepository(repoPath) - assert.NoError(t, err) - - findOptions := models.FindReleasesOptions{IncludeDrafts: true, IncludeTags: true} - initCount, err := models.GetReleaseCountByRepoID(mirror.ID, findOptions) - assert.NoError(t, err) - - assert.NoError(t, CreateRelease(gitRepo, &models.Release{ - RepoID: repo.ID, - PublisherID: user.ID, - TagName: "v0.2", - Target: "master", - Title: "v0.2 is released", - Note: "v0.2 is released", - IsDraft: false, - IsPrerelease: false, - IsTag: true, - }, nil)) - - err = mirror.GetMirror() - assert.NoError(t, err) - - ok := models.RunMirrorSync(mirror.Mirror) - assert.True(t, ok) - - count, err := models.GetReleaseCountByRepoID(mirror.ID, findOptions) - assert.NoError(t, err) - assert.EqualValues(t, initCount+1, count) - - release, err := models.GetRelease(repo.ID, "v0.2") - assert.NoError(t, err) - assert.NoError(t, DeleteReleaseByID(release.ID, user, true)) - - ok = models.RunMirrorSync(mirror.Mirror) - assert.True(t, ok) - - count, err = models.GetReleaseCountByRepoID(mirror.ID, findOptions) - assert.NoError(t, err) - assert.EqualValues(t, initCount, count) -} |