Skip to content

Commit

Permalink
[feat]: [CDS-73030]: tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adivishy1 committed Jul 5, 2023
1 parent cfa0faa commit 73dc4c6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion scm/driver/gitee/integration/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func testBranchFind(client *scm.Client) func(t *testing.T) {
func testBranchList(client *scm.Client) func(t *testing.T) {
return func(t *testing.T) {
t.Parallel()
opts := scm.BranchListOptions{}
opts := scm.ListOptions{}
result, _, err := client.Git.ListBranches(context.Background(), "kit101/drone-yml-test", opts)
if err != nil {
t.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/github/integration/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func testBranchFind(client *scm.Client) func(t *testing.T) {
func testBranchList(client *scm.Client) func(t *testing.T) {
return func(t *testing.T) {
t.Parallel()
opts := scm.BranchListOptions{}
opts := scm.ListOptions{}
result, _, err := client.Git.ListBranches(context.Background(), "octocat/Hello-World", opts)
if err != nil {
t.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/gitlab/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (s *gitService) FindTag(ctx context.Context, repo, name string) (*scm.Refer
}

func (s *gitService) ListBranches(ctx context.Context, repo string, opts scm.ListOptions) ([]*scm.Reference, *scm.Response, error) {
path := fmt.Sprintf("api/v4/projects/%s/repository/branches?search=%s&%s", encode(repo), encodeListOptions(opts))
path := fmt.Sprintf("api/v4/projects/%s/repository/branches?%s", encode(repo), encodeListOptions(opts))
out := []*branch{}
res, err := s.client.do(ctx, "GET", path, nil, &out)
return convertBranchList(out), res, err
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/gitlab/integration/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func testBranchFind(client *scm.Client) func(t *testing.T) {
func testBranchList(client *scm.Client) func(t *testing.T) {
return func(t *testing.T) {
t.Parallel()
opts := scm.BranchListOptions{}
opts := scm.ListOptions{}
result, _, err := client.Git.ListBranches(context.Background(), "gitlab-org/testme", opts)
if err != nil {
t.Error(err)
Expand Down
9 changes: 3 additions & 6 deletions scm/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,9 @@ func ExampleGitService_ListBranches() {
log.Fatal(err)
}

opts := scm.BranchListOptions{
PageListOptions: struct {
URL string
Page int
Size int
}{Page: 1, Size: 30},
opts := scm.ListOptions{
Page: 1,
Size: 30,
}

branches, _, err := client.Git.ListBranches(ctx, "octocat/Hello-World", opts)
Expand Down

0 comments on commit 73dc4c6

Please sign in to comment.