Skip to content

Commit d76cda5

Browse files
CopilotJoannaaKL
andcommitted
fix tests and lint after mock cleanup
Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>
1 parent 2010cb6 commit d76cda5

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

pkg/github/helper_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ const (
118118
GetReposActionsWorkflowsByOwnerByRepoByWorkflowID = "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"
119119
PostReposActionsWorkflowsDispatchesByOwnerByRepoByWorkflowID = "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
120120
GetReposActionsWorkflowsRunsByOwnerByRepoByWorkflowID = "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
121+
GetReposActionsRunsByOwnerByRepo = "GET /repos/{owner}/{repo}/actions/runs"
121122
GetReposActionsRunsByOwnerByRepoByRunID = "GET /repos/{owner}/{repo}/actions/runs/{run_id}"
122123
GetReposActionsRunsLogsByOwnerByRepoByRunID = "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
123124
GetReposActionsRunsJobsByOwnerByRepoByRunID = "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"

pkg/github/issues_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/github/github-mcp-server/pkg/translations"
1818
"github.com/google/go-github/v79/github"
1919
"github.com/google/jsonschema-go/jsonschema"
20+
mock "github.com/migueleliasweb/go-github-mock/src/mock"
2021
"github.com/shurcooL/githubv4"
2122
"github.com/stretchr/testify/assert"
2223
"github.com/stretchr/testify/require"
@@ -25,6 +26,10 @@ import (
2526
var defaultGQLClient *githubv4.Client = githubv4.NewClient(newRepoAccessHTTPClient())
2627
var repoAccessCache *lockdown.RepoAccessCache = stubRepoAccessCache(defaultGQLClient, 15*time.Minute)
2728

29+
func githubv4MockHTTPClientWithHandlers(_ map[string]http.HandlerFunc) *http.Client {
30+
return githubv4mock.NewMockedHTTPClient()
31+
}
32+
2833
type repoAccessKey struct {
2934
owner string
3035
repo string

pkg/github/projects_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/github/github-mcp-server/pkg/translations"
1212
gh "github.com/google/go-github/v79/github"
1313
"github.com/google/jsonschema-go/jsonschema"
14+
mock "github.com/migueleliasweb/go-github-mock/src/mock"
1415
"github.com/stretchr/testify/assert"
1516
"github.com/stretchr/testify/require"
1617
)

0 commit comments

Comments
 (0)