Skip to content

Commit

Permalink
Migrate gomock to Uber gomock (#1196)
Browse files Browse the repository at this point in the history
  • Loading branch information
matoval authored Oct 25, 2024
1 parent 52be401 commit 72de0f7
Show file tree
Hide file tree
Showing 33 changed files with 1,222 additions and 1,179 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ linters-settings:
- "github.com/fortytw2/leaktest"
- "github.com/fsnotify/fsnotify"
- "github.com/gorilla/websocket"
- "github.com/golang/mock/gomock"
- "github.com/prep/socketpair"
- "github.com/google/go-cmp/cmp"
- "k8s.io/api/core/v1"
Expand Down
187 changes: 99 additions & 88 deletions pkg/backends/mock_backends/websockets.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/backends/websockets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/ansible/receptor/pkg/backends"
"github.com/ansible/receptor/pkg/backends/mock_backends"
"github.com/ansible/receptor/pkg/logger"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"
)

const (
Expand Down Expand Up @@ -208,11 +208,11 @@ func TestWebsocketDialerGetTLS(t *testing.T) {
}
}

func setUpListener(t *testing.T) (*gomock.Controller, *mock_backends.MockGorillaWebsocketUpgraderForListener, *mock_backends.MockHttpServerForListener) {
func setUpListener(t *testing.T) (*gomock.Controller, *mock_backends.MockGorillaWebsocketUpgraderForListener, *mock_backends.MockHTTPServerForListener) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockWebsocketUpgrader := mock_backends.NewMockGorillaWebsocketUpgraderForListener(ctrl)
mockServer := mock_backends.NewMockHttpServerForListener(ctrl)
mockServer := mock_backends.NewMockHTTPServerForListener(ctrl)

return ctrl, mockWebsocketUpgrader, mockServer
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controlsvc/connect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/ansible/receptor/pkg/controlsvc"
"github.com/ansible/receptor/pkg/controlsvc/mock_controlsvc"
"github.com/ansible/receptor/pkg/logger"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"
)

func CheckExpectedError(expectedError bool, errorMessage string, t *testing.T, err error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controlsvc/controlsvc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/ansible/receptor/pkg/controlsvc"
"github.com/ansible/receptor/pkg/controlsvc/mock_controlsvc"
"github.com/ansible/receptor/pkg/logger"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"
)

const (
Expand Down
124 changes: 86 additions & 38 deletions pkg/controlsvc/mock_controlsvc/controlsvc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 72de0f7

Please sign in to comment.