@@ -18,7 +18,6 @@ import (
1818 "github.com/github/github-mcp-server/pkg/translations"
1919 "github.com/google/go-github/v79/github"
2020 "github.com/google/jsonschema-go/jsonschema"
21- "github.com/migueleliasweb/go-github-mock/src/mock"
2221 "github.com/stretchr/testify/assert"
2322 "github.com/stretchr/testify/require"
2423)
@@ -1394,9 +1393,9 @@ func Test_RerunFailedJobs(t *testing.T) {
13941393 }{
13951394 {
13961395 name : "successful rerun of failed jobs" ,
1397- mockedClient : mock . NewMockedHTTPClient (
1398- mock . WithRequestMatchHandler (
1399- mock. EndpointPattern {
1396+ mockedClient : NewMockedHTTPClient (
1397+ WithRequestMatchHandler (
1398+ EndpointPattern {
14001399 Pattern : "/repos/owner/repo/actions/runs/12345/rerun-failed-jobs" ,
14011400 Method : "POST" ,
14021401 },
@@ -1414,7 +1413,7 @@ func Test_RerunFailedJobs(t *testing.T) {
14141413 },
14151414 {
14161415 name : "missing required parameter run_id" ,
1417- mockedClient : mock . NewMockedHTTPClient (),
1416+ mockedClient : NewMockedHTTPClient (),
14181417 requestArgs : map [string ]any {
14191418 "owner" : "owner" ,
14201419 "repo" : "repo" ,
@@ -1466,9 +1465,9 @@ func Test_RerunWorkflowRun_Behavioral(t *testing.T) {
14661465 }{
14671466 {
14681467 name : "successful rerun of workflow run" ,
1469- mockedClient : mock . NewMockedHTTPClient (
1470- mock . WithRequestMatchHandler (
1471- mock. EndpointPattern {
1468+ mockedClient : NewMockedHTTPClient (
1469+ WithRequestMatchHandler (
1470+ EndpointPattern {
14721471 Pattern : "/repos/owner/repo/actions/runs/12345/rerun" ,
14731472 Method : "POST" ,
14741473 },
@@ -1486,7 +1485,7 @@ func Test_RerunWorkflowRun_Behavioral(t *testing.T) {
14861485 },
14871486 {
14881487 name : "missing required parameter run_id" ,
1489- mockedClient : mock . NewMockedHTTPClient (),
1488+ mockedClient : NewMockedHTTPClient (),
14901489 requestArgs : map [string ]any {
14911490 "owner" : "owner" ,
14921491 "repo" : "repo" ,
@@ -1538,9 +1537,9 @@ func Test_ListWorkflowRuns_Behavioral(t *testing.T) {
15381537 }{
15391538 {
15401539 name : "successful workflow runs listing" ,
1541- mockedClient : mock . NewMockedHTTPClient (
1542- mock . WithRequestMatchHandler (
1543- mock . GetReposActionsWorkflowsRunsByOwnerByRepoByWorkflowId ,
1540+ mockedClient : NewMockedHTTPClient (
1541+ WithRequestMatchHandler (
1542+ GetReposActionsWorkflowsRunsByOwnerByRepoByWorkflowID ,
15441543 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
15451544 runs := & github.WorkflowRuns {
15461545 TotalCount : github .Ptr (2 ),
@@ -1573,7 +1572,7 @@ func Test_ListWorkflowRuns_Behavioral(t *testing.T) {
15731572 },
15741573 {
15751574 name : "missing required parameter workflow_id" ,
1576- mockedClient : mock . NewMockedHTTPClient (),
1575+ mockedClient : NewMockedHTTPClient (),
15771576 requestArgs : map [string ]any {
15781577 "owner" : "owner" ,
15791578 "repo" : "repo" ,
@@ -1625,9 +1624,9 @@ func Test_GetWorkflowRun_Behavioral(t *testing.T) {
16251624 }{
16261625 {
16271626 name : "successful get workflow run" ,
1628- mockedClient : mock . NewMockedHTTPClient (
1629- mock . WithRequestMatchHandler (
1630- mock . GetReposActionsRunsByOwnerByRepoByRunId ,
1627+ mockedClient : NewMockedHTTPClient (
1628+ WithRequestMatchHandler (
1629+ GetReposActionsRunsByOwnerByRepoByRunID ,
16311630 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
16321631 run := & github.WorkflowRun {
16331632 ID : github .Ptr (int64 (12345 )),
@@ -1649,7 +1648,7 @@ func Test_GetWorkflowRun_Behavioral(t *testing.T) {
16491648 },
16501649 {
16511650 name : "missing required parameter run_id" ,
1652- mockedClient : mock . NewMockedHTTPClient (),
1651+ mockedClient : NewMockedHTTPClient (),
16531652 requestArgs : map [string ]any {
16541653 "owner" : "owner" ,
16551654 "repo" : "repo" ,
@@ -1701,9 +1700,9 @@ func Test_GetWorkflowRunLogs_Behavioral(t *testing.T) {
17011700 }{
17021701 {
17031702 name : "successful get workflow run logs" ,
1704- mockedClient : mock . NewMockedHTTPClient (
1705- mock . WithRequestMatchHandler (
1706- mock . GetReposActionsRunsLogsByOwnerByRepoByRunId ,
1703+ mockedClient : NewMockedHTTPClient (
1704+ WithRequestMatchHandler (
1705+ GetReposActionsRunsLogsByOwnerByRepoByRunID ,
17071706 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
17081707 w .Header ().Set ("Location" , "https://github.com/logs/run/12345" )
17091708 w .WriteHeader (http .StatusFound )
@@ -1719,7 +1718,7 @@ func Test_GetWorkflowRunLogs_Behavioral(t *testing.T) {
17191718 },
17201719 {
17211720 name : "missing required parameter run_id" ,
1722- mockedClient : mock . NewMockedHTTPClient (),
1721+ mockedClient : NewMockedHTTPClient (),
17231722 requestArgs : map [string ]any {
17241723 "owner" : "owner" ,
17251724 "repo" : "repo" ,
@@ -1771,9 +1770,9 @@ func Test_ListWorkflowJobs_Behavioral(t *testing.T) {
17711770 }{
17721771 {
17731772 name : "successful list workflow jobs" ,
1774- mockedClient : mock . NewMockedHTTPClient (
1775- mock . WithRequestMatchHandler (
1776- mock . GetReposActionsRunsJobsByOwnerByRepoByRunId ,
1773+ mockedClient : NewMockedHTTPClient (
1774+ WithRequestMatchHandler (
1775+ GetReposActionsRunsJobsByOwnerByRepoByRunID ,
17771776 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
17781777 jobs := & github.Jobs {
17791778 TotalCount : github .Ptr (2 ),
@@ -1806,7 +1805,7 @@ func Test_ListWorkflowJobs_Behavioral(t *testing.T) {
18061805 },
18071806 {
18081807 name : "missing required parameter run_id" ,
1809- mockedClient : mock . NewMockedHTTPClient (),
1808+ mockedClient : NewMockedHTTPClient (),
18101809 requestArgs : map [string ]any {
18111810 "owner" : "owner" ,
18121811 "repo" : "repo" ,
@@ -1873,9 +1872,9 @@ func Test_ActionsList_ListWorkflows(t *testing.T) {
18731872 }{
18741873 {
18751874 name : "successful workflow list" ,
1876- mockedClient : mock . NewMockedHTTPClient (
1877- mock . WithRequestMatchHandler (
1878- mock . GetReposActionsWorkflowsByOwnerByRepo ,
1875+ mockedClient : NewMockedHTTPClient (
1876+ WithRequestMatchHandler (
1877+ GetReposActionsWorkflowsByOwnerByRepo ,
18791878 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
18801879 workflows := & github.Workflows {
18811880 TotalCount : github .Ptr (2 ),
@@ -1908,7 +1907,7 @@ func Test_ActionsList_ListWorkflows(t *testing.T) {
19081907 },
19091908 {
19101909 name : "missing required parameter method" ,
1911- mockedClient : mock . NewMockedHTTPClient (),
1910+ mockedClient : NewMockedHTTPClient (),
19121911 requestArgs : map [string ]any {
19131912 "owner" : "owner" ,
19141913 "repo" : "repo" ,
@@ -1952,9 +1951,9 @@ func Test_ActionsList_ListWorkflowRuns(t *testing.T) {
19521951 toolDef := ActionsList (translations .NullTranslationHelper )
19531952
19541953 t .Run ("successful workflow runs list" , func (t * testing.T ) {
1955- mockedClient := mock . NewMockedHTTPClient (
1956- mock . WithRequestMatchHandler (
1957- mock . GetReposActionsWorkflowsRunsByOwnerByRepoByWorkflowId ,
1954+ mockedClient := NewMockedHTTPClient (
1955+ WithRequestMatchHandler (
1956+ GetReposActionsWorkflowsRunsByOwnerByRepoByWorkflowID ,
19581957 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
19591958 runs := & github.WorkflowRuns {
19601959 TotalCount : github .Ptr (1 ),
@@ -1998,7 +1997,7 @@ func Test_ActionsList_ListWorkflowRuns(t *testing.T) {
19981997 })
19991998
20001999 t .Run ("missing resource_id for list_workflow_runs" , func (t * testing.T ) {
2001- mockedClient := mock . NewMockedHTTPClient ()
2000+ mockedClient := NewMockedHTTPClient ()
20022001
20032002 client := github .NewClient (mockedClient )
20042003 deps := BaseDeps {
@@ -2040,9 +2039,9 @@ func Test_ActionsGet_GetWorkflow(t *testing.T) {
20402039 toolDef := ActionsGet (translations .NullTranslationHelper )
20412040
20422041 t .Run ("successful workflow get" , func (t * testing.T ) {
2043- mockedClient := mock . NewMockedHTTPClient (
2044- mock . WithRequestMatchHandler (
2045- mock . GetReposActionsWorkflowsByOwnerByRepoByWorkflowId ,
2042+ mockedClient := NewMockedHTTPClient (
2043+ WithRequestMatchHandler (
2044+ GetReposActionsWorkflowsByOwnerByRepoByWorkflowID ,
20462045 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
20472046 workflow := & github.Workflow {
20482047 ID : github .Ptr (int64 (1 )),
@@ -2086,9 +2085,9 @@ func Test_ActionsGet_GetWorkflowRun(t *testing.T) {
20862085 toolDef := ActionsGet (translations .NullTranslationHelper )
20872086
20882087 t .Run ("successful workflow run get" , func (t * testing.T ) {
2089- mockedClient := mock . NewMockedHTTPClient (
2090- mock . WithRequestMatchHandler (
2091- mock . GetReposActionsRunsByOwnerByRepoByRunId ,
2088+ mockedClient := NewMockedHTTPClient (
2089+ WithRequestMatchHandler (
2090+ GetReposActionsRunsByOwnerByRepoByRunID ,
20922091 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
20932092 run := & github.WorkflowRun {
20942093 ID : github .Ptr (int64 (12345 )),
@@ -2157,9 +2156,9 @@ func Test_ActionsRunTrigger_RunWorkflow(t *testing.T) {
21572156 }{
21582157 {
21592158 name : "successful workflow run" ,
2160- mockedClient : mock . NewMockedHTTPClient (
2161- mock . WithRequestMatchHandler (
2162- mock . PostReposActionsWorkflowsDispatchesByOwnerByRepoByWorkflowId ,
2159+ mockedClient : NewMockedHTTPClient (
2160+ WithRequestMatchHandler (
2161+ PostReposActionsWorkflowsDispatchesByOwnerByRepoByWorkflowID ,
21632162 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
21642163 w .WriteHeader (http .StatusNoContent )
21652164 }),
@@ -2176,7 +2175,7 @@ func Test_ActionsRunTrigger_RunWorkflow(t *testing.T) {
21762175 },
21772176 {
21782177 name : "missing required parameter workflow_id" ,
2179- mockedClient : mock . NewMockedHTTPClient (),
2178+ mockedClient : NewMockedHTTPClient (),
21802179 requestArgs : map [string ]any {
21812180 "method" : "run_workflow" ,
21822181 "owner" : "owner" ,
@@ -2188,7 +2187,7 @@ func Test_ActionsRunTrigger_RunWorkflow(t *testing.T) {
21882187 },
21892188 {
21902189 name : "missing required parameter ref" ,
2191- mockedClient : mock . NewMockedHTTPClient (),
2190+ mockedClient : NewMockedHTTPClient (),
21922191 requestArgs : map [string ]any {
21932192 "method" : "run_workflow" ,
21942193 "owner" : "owner" ,
@@ -2233,9 +2232,9 @@ func Test_ActionsRunTrigger_CancelWorkflowRun(t *testing.T) {
22332232 toolDef := ActionsRunTrigger (translations .NullTranslationHelper )
22342233
22352234 t .Run ("successful workflow run cancellation" , func (t * testing.T ) {
2236- mockedClient := mock . NewMockedHTTPClient (
2237- mock . WithRequestMatchHandler (
2238- mock. EndpointPattern {
2235+ mockedClient := NewMockedHTTPClient (
2236+ WithRequestMatchHandler (
2237+ EndpointPattern {
22392238 Pattern : "/repos/owner/repo/actions/runs/12345/cancel" ,
22402239 Method : "POST" ,
22412240 },
@@ -2270,9 +2269,9 @@ func Test_ActionsRunTrigger_CancelWorkflowRun(t *testing.T) {
22702269 })
22712270
22722271 t .Run ("conflict when cancelling a workflow run" , func (t * testing.T ) {
2273- mockedClient := mock . NewMockedHTTPClient (
2274- mock . WithRequestMatchHandler (
2275- mock. EndpointPattern {
2272+ mockedClient := NewMockedHTTPClient (
2273+ WithRequestMatchHandler (
2274+ EndpointPattern {
22762275 Pattern : "/repos/owner/repo/actions/runs/12345/cancel" ,
22772276 Method : "POST" ,
22782277 },
@@ -2304,7 +2303,7 @@ func Test_ActionsRunTrigger_CancelWorkflowRun(t *testing.T) {
23042303 })
23052304
23062305 t .Run ("missing run_id for non-run_workflow methods" , func (t * testing.T ) {
2307- mockedClient := mock . NewMockedHTTPClient ()
2306+ mockedClient := NewMockedHTTPClient ()
23082307
23092308 client := github .NewClient (mockedClient )
23102309 deps := BaseDeps {
@@ -2351,9 +2350,9 @@ func Test_ActionsGetJobLogs_SingleJob(t *testing.T) {
23512350 toolDef := ActionsGetJobLogs (translations .NullTranslationHelper )
23522351
23532352 t .Run ("successful single job logs with URL" , func (t * testing.T ) {
2354- mockedClient := mock . NewMockedHTTPClient (
2355- mock . WithRequestMatchHandler (
2356- mock . GetReposActionsJobsLogsByOwnerByRepoByJobId ,
2353+ mockedClient := NewMockedHTTPClient (
2354+ WithRequestMatchHandler (
2355+ GetReposActionsJobsLogsByOwnerByRepoByJobID ,
23572356 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
23582357 w .Header ().Set ("Location" , "https://github.com/logs/job/123" )
23592358 w .WriteHeader (http .StatusFound )
@@ -2392,9 +2391,9 @@ func Test_ActionsGetJobLogs_FailedJobs(t *testing.T) {
23922391 toolDef := ActionsGetJobLogs (translations .NullTranslationHelper )
23932392
23942393 t .Run ("successful failed jobs logs" , func (t * testing.T ) {
2395- mockedClient := mock . NewMockedHTTPClient (
2396- mock . WithRequestMatchHandler (
2397- mock . GetReposActionsRunsJobsByOwnerByRepoByRunId ,
2394+ mockedClient := NewMockedHTTPClient (
2395+ WithRequestMatchHandler (
2396+ GetReposActionsRunsJobsByOwnerByRepoByRunID ,
23982397 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
23992398 jobs := & github.Jobs {
24002399 TotalCount : github .Ptr (3 ),
@@ -2420,8 +2419,8 @@ func Test_ActionsGetJobLogs_FailedJobs(t *testing.T) {
24202419 _ = json .NewEncoder (w ).Encode (jobs )
24212420 }),
24222421 ),
2423- mock . WithRequestMatchHandler (
2424- mock . GetReposActionsJobsLogsByOwnerByRepoByJobId ,
2422+ WithRequestMatchHandler (
2423+ GetReposActionsJobsLogsByOwnerByRepoByJobID ,
24252424 http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
24262425 w .Header ().Set ("Location" , "https://github.com/logs/job/" + r .URL .Path [len (r .URL .Path )- 1 :])
24272426 w .WriteHeader (http .StatusFound )
@@ -2457,9 +2456,9 @@ func Test_ActionsGetJobLogs_FailedJobs(t *testing.T) {
24572456 })
24582457
24592458 t .Run ("no failed jobs found" , func (t * testing.T ) {
2460- mockedClient := mock . NewMockedHTTPClient (
2461- mock . WithRequestMatchHandler (
2462- mock . GetReposActionsRunsJobsByOwnerByRepoByRunId ,
2459+ mockedClient := NewMockedHTTPClient (
2460+ WithRequestMatchHandler (
2461+ GetReposActionsRunsJobsByOwnerByRepoByRunID ,
24632462 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
24642463 jobs := & github.Jobs {
24652464 TotalCount : github .Ptr (2 ),
0 commit comments