forked from forgejo/forgejo
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>
This commit is contained in:
parent
067eff8eba
commit
5bfb9bc2b6
4 changed files with 65 additions and 10 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue