diff options
author | 6543 <6543@obermui.de> | 2020-04-20 14:30:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 13:30:46 +0100 |
commit | 5bfb9bc2b6a2e10d8f0fcdd2cc1e93de39a58555 (patch) | |
tree | e1d16653ac8a7f88a7184c157f3687caacd9f0e4 /modules/migrations/gitlab_test.go | |
parent | 067eff8ebaaf7b05ef8514bc051c72f1f80ddc82 (diff) | |
download | gitea-5bfb9bc2b6a2e10d8f0fcdd2cc1e93de39a58555.tar.gz gitea-5bfb9bc2b6a2e10d8f0fcdd2cc1e93de39a58555.zip |
When migrating from Gitlab map Approvals to approving Reviews (#11147)
When migrating from Gitlab map Gitlab Approvals to approving Reviews
Co-Authored-By: zeripath <art27@cantab.net>
Diffstat (limited to 'modules/migrations/gitlab_test.go')
-rw-r--r-- | modules/migrations/gitlab_test.go | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/modules/migrations/gitlab_test.go b/modules/migrations/gitlab_test.go index 8525d7e9ce..003da5bbdf 100644 --- a/modules/migrations/gitlab_test.go +++ b/modules/migrations/gitlab_test.go @@ -110,7 +110,6 @@ func TestGitlabDownloadRepo(t *testing.T) { }, }, releases[len(releases)-1:]) - // downloader.GetIssues() issues, isEnd, err := downloader.GetIssues(1, 2) assert.NoError(t, err) assert.EqualValues(t, 2, len(issues)) @@ -162,7 +161,6 @@ func TestGitlabDownloadRepo(t *testing.T) { }, }, issues) - // downloader.GetComments() comments, err := downloader.GetComments(2) assert.NoError(t, err) assert.EqualValues(t, 4, len(comments)) @@ -202,10 +200,9 @@ func TestGitlabDownloadRepo(t *testing.T) { }, }, comments[:4]) - // downloader.GetPullRequests() prs, err := downloader.GetPullRequests(1, 1) assert.NoError(t, err) - assert.EqualValues(t, 1, len(prs)) + assert.Len(t, prs, 1) assert.EqualValues(t, []*base.PullRequest{ { @@ -243,4 +240,23 @@ func TestGitlabDownloadRepo(t *testing.T) { MergeCommitSHA: "", }, }, prs) + + rvs, err := downloader.GetReviews(1) + assert.NoError(t, err) + if assert.Len(t, prs, 2) { + assert.EqualValues(t, 527793, rvs[0].ReviewerID) + assert.EqualValues(t, "axifive", rvs[0].ReviewerName) + assert.EqualValues(t, "APPROVED", rvs[0].State) + assert.EqualValues(t, 4102996, rvs[1].ReviewerID) + assert.EqualValues(t, "zeripath", rvs[1].ReviewerName) + assert.EqualValues(t, "APPROVED", rvs[1].State) + } + rvs, err = downloader.GetReviews(2) + assert.NoError(t, err) + if assert.Len(t, prs, 1) { + assert.EqualValues(t, 4575606, rvs[0].ReviewerID) + assert.EqualValues(t, "real6543", rvs[0].ReviewerName) + assert.EqualValues(t, "APPROVED", rvs[0].State) + } + } |