reviewers fix in tests

This commit is contained in:
2025-02-06 17:17:06 +01:00
parent e537e5d00c
commit efde2fad69
2 changed files with 9 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import (
"bufio"
"errors"
"fmt"
"log"
"os"
"path"
"slices"
@@ -115,6 +116,7 @@ func (rs *PRSet) IsReviewed(gitea common.GiteaReviewFetcher) bool {
reviewers = configReviewers.Pkg
}
log.Println(reviewers)
r, err := FetchGiteaReviews(gitea, reviewers, pr.pr.Base.Repo.Owner.UserName, pr.pr.Base.Repo.Name, pr.pr.Index)
if err != nil {
return false

View File

@@ -102,7 +102,7 @@ func TestPR(t *testing.T) {
{
pr: &models.PullRequest{Body: "", Index: 42, Base: &models.PRBranchInfo{Repo: &models.Repository{Name: "barPrj", Owner: &models.User{UserName: "foo"}}}},
reviews: []*models.PullReview{
{Body: "LGTM", User: &models.User{UserName: "super1"}, State: common.ReviewStateApproved},
{Body: "LGTM", User: &models.User{UserName: "m2"}, State: common.ReviewStateApproved},
{Body: "LGTM", User: &models.User{UserName: "super2"}, State: common.ReviewStateApproved},
{Body: "LGTM", User: &models.User{UserName: common.Bot_BuildReview}, State: common.ReviewStateApproved},
},