Skip to content

Commit

Permalink
feat: Improvements on fake
Browse files Browse the repository at this point in the history
Since filtering on labels is lacing on otehr providers I don't see that the fake should fail on that.
A couple of more fields to be able to create tests for reuse of pull requests.
  • Loading branch information
msvticket committed Nov 18, 2022
1 parent 6dae22e commit 76519ab
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scm/driver/fake/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ func filterPullRequests(requests []*scm.PullRequest, opts *scm.PullRequestListOp
filteredPullRequests = newFilteredPullRequests
}

if len(opts.Labels) > 0 {
panic("implement me")
}
// Filtering on labels is not implemented in all real providers either...
// if len(opts.Labels) > 0 {
// panic("implement me")
// }

returnRequests := []*scm.PullRequest{}

Expand Down Expand Up @@ -357,6 +358,8 @@ func (s *pullService) Create(_ context.Context, fullName string, input *scm.Pull
FullName: fullName,
},
},
Source: input.Head,
Link: fmt.Sprintf("https://api.fake.com/pull/%d", f.PullRequestID),
Head: scm.PullRequestBranch{
Ref: input.Head,
},
Expand Down

0 comments on commit 76519ab

Please sign in to comment.