Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change mockgen to uber library #4909

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GOLANGCI=github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.1
gofumpt=mvdan.cc/gofumpt@latest
govulncheck=golang.org/x/vuln/cmd/govulncheck@latest
goimports=golang.org/x/tools/cmd/goimports@latest
mockgen=github.com/golang/mock/mockgen@v1.6.0
mockgen=go.uber.org/mock/mockgen@v0.4.0
gotestsum=gotest.tools/gotestsum@v1.11.0
protoc-gen-go=google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0
protoc-gen-go-grpc=google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
Expand Down Expand Up @@ -100,7 +100,7 @@ install-tools:
lint: fmt ## Run linters on all go files
$(GO) run $(GOLANGCI) run -v
$(GO) run $(govulncheck) ./...
$(GO) run $(actionlint)
$(GO) run $(actionlint)

.PHONY: fmt
fmt: install-tools ## Formats all go files
Expand Down
3 changes: 2 additions & 1 deletion app/cluster/dynamic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

"github.com/stretchr/testify/require"

mockjobsforwarder "github.com/rudderlabs/rudder-server/mocks/jobs-forwarder"
Expand Down
3 changes: 2 additions & 1 deletion app/cluster/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import (

"github.com/rudderlabs/rudder-server/enterprise/trackedusers"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

"github.com/google/uuid"
"github.com/ory/dockertest/v3"
"github.com/stretchr/testify/require"
Expand Down
4 changes: 2 additions & 2 deletions backend-config/backend-config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package backendconfig

// go:generate mockgen -destination=../mocks/backend-config/mock_backendconfig.go -package=mock_backendconfig github.com/rudderlabs/rudder-server/backend-config BackendConfig
// go:generate mockgen -destination=./mock_workspaceconfig.go -package=backendconfig -source=./backend-config.go workspaceConfig
//go:generate mockgen -destination=../mocks/backend-config/mock_backendconfig.go -package=mock_backendconfig github.com/rudderlabs/rudder-server/backend-config BackendConfig
//go:generate mockgen -destination=./mock_workspaceconfig.go -package=backendconfig -source=./backend-config.go workspaceConfig

import (
"context"
Expand Down
3 changes: 2 additions & 1 deletion backend-config/backend_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

"github.com/ory/dockertest/v3"
"github.com/stretchr/testify/require"

Expand Down
9 changes: 7 additions & 2 deletions backend-config/internal/cache/mock_cache.go

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

17 changes: 11 additions & 6 deletions backend-config/mock_workspaceconfig.go

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

2 changes: 1 addition & 1 deletion enterprise/reporting/config_subscriber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/rudderlabs/rudder-go-kit/logger"
backendconfig "github.com/rudderlabs/rudder-server/backend-config"
Expand Down
2 changes: 1 addition & 1 deletion enterprise/reporting/event_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/rudderlabs/rudder-go-kit/logger"
"github.com/rudderlabs/rudder-go-kit/stats/memstats"
Expand Down
9 changes: 7 additions & 2 deletions enterprise/reporting/flusher/aggregator/aggregator_mock.go

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

2 changes: 1 addition & 1 deletion enterprise/reporting/flusher/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

"github.com/rudderlabs/rudder-go-kit/config"
"github.com/rudderlabs/rudder-go-kit/logger"
Expand Down
3 changes: 2 additions & 1 deletion gateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import (
kithelper "github.com/rudderlabs/rudder-go-kit/testhelper"
kituuid "github.com/rudderlabs/rudder-go-kit/uuid"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

"github.com/google/uuid"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
15 changes: 10 additions & 5 deletions gateway/mocks/mockwebhook.go

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

3 changes: 2 additions & 1 deletion gateway/webhook/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
"testing"
"testing/iotest"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ require (
github.com/redis/go-redis/v9 v9.5.4
github.com/rs/cors v1.11.0
github.com/rudderlabs/analytics-go v3.3.3+incompatible
github.com/rudderlabs/bing-ads-go-sdk v0.2.2
github.com/rudderlabs/bing-ads-go-sdk v0.2.3
github.com/rudderlabs/compose-test v0.1.3
github.com/rudderlabs/rudder-go-kit v0.34.2
github.com/rudderlabs/rudder-go-kit v0.35.1
github.com/rudderlabs/rudder-observability-kit v0.0.3
github.com/rudderlabs/rudder-schemas v0.5.0
github.com/rudderlabs/sql-tunnels v0.1.7
Expand All @@ -103,6 +103,7 @@ require (
go.uber.org/atomic v1.11.0
go.uber.org/automaxprocs v1.5.3
go.uber.org/goleak v1.3.0
go.uber.org/mock v0.4.0
golang.org/x/exp v0.0.0-20240529005216-23cca8864a10
golang.org/x/oauth2 v0.21.0
golang.org/x/sync v0.7.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1114,14 +1114,14 @@ github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/rudderlabs/analytics-go v3.3.3+incompatible h1:OG0XlKoXfr539e2t1dXtTB+Gr89uFW+OUNQBVhHIIBY=
github.com/rudderlabs/analytics-go v3.3.3+incompatible/go.mod h1:LF8/ty9kUX4PTY3l5c97K3nZZaX5Hwsvt+NBaRL/f30=
github.com/rudderlabs/bing-ads-go-sdk v0.2.2 h1:ZjMZGLhdeNcOXrezPQHqyZUdzR+KjPOzmZaFKjf07kk=
github.com/rudderlabs/bing-ads-go-sdk v0.2.2/go.mod h1:FJPcpqBez2uG4kB6WBj05YLlY5Q3iknNj/fn7Bv9nDs=
github.com/rudderlabs/bing-ads-go-sdk v0.2.3 h1:jR85Ep6X6SkiesaI7Q7WJHs/65SgByZbZHAKLK0V94Q=
github.com/rudderlabs/bing-ads-go-sdk v0.2.3/go.mod h1:38Yig/202ni4GcloXhaTeH1LqUyFPEx6iljnFa+IDQI=
github.com/rudderlabs/compose-test v0.1.3 h1:uyep6jDCIF737sfv4zIaMsKRQKX95IDz5Xbxor+x0kU=
github.com/rudderlabs/compose-test v0.1.3/go.mod h1:tuvS1eQdSfwOYv1qwyVAcpdJxPLQXJgy5xGDd/9XmMg=
github.com/rudderlabs/parquet-go v0.0.2 h1:ZXRdZdimB0PdJtmxeSSxfI0fDQ3kZjwzBxRi6Ut1J8k=
github.com/rudderlabs/parquet-go v0.0.2/go.mod h1:g6guum7o8uhj/uNhunnt7bw5Vabu/goI5i21/3fnxWQ=
github.com/rudderlabs/rudder-go-kit v0.34.2 h1:aBrrMAfY7FR5f/k0V5Mv8xqaMXVTSPfkXLAU+j380Ds=
github.com/rudderlabs/rudder-go-kit v0.34.2/go.mod h1:WCAJAuOGpWyoryNxOJRtbWVpI+YpsL91fThhWq5+snI=
github.com/rudderlabs/rudder-go-kit v0.35.1 h1:BJRfo9xfly265pKO8WXaMAPAUbl4gtQPHod4lBvzRH8=
github.com/rudderlabs/rudder-go-kit v0.35.1/go.mod h1:B8jlxe/kaQ009iQnw2Ba8ZKmeXwwREZTRpsE9Nhq+qU=
github.com/rudderlabs/rudder-observability-kit v0.0.3 h1:vZtuZRkGX+6rjaeKtxxFE2YYP6QlmAcVcgecTOjvz+Q=
github.com/rudderlabs/rudder-observability-kit v0.0.3/go.mod h1:6UjAh3H6rkE0fFLh7z8ZGQEQbKtUkRfhWOf/OUhfqW8=
github.com/rudderlabs/rudder-schemas v0.5.0 h1:+140Amou92sB4ZXwsX3jgRIdjNfERJJgYOx0bcUkxzg=
Expand Down
5 changes: 3 additions & 2 deletions integration_test/warehouse/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
"go.uber.org/atomic"
"go.uber.org/mock/gomock"

"github.com/google/uuid"
"github.com/ory/dockertest/v3"
"github.com/samber/lo"
"github.com/stretchr/testify/require"
"go.uber.org/atomic"

"github.com/rudderlabs/compose-test/compose"
"github.com/rudderlabs/compose-test/testcompose"
Expand Down
7 changes: 6 additions & 1 deletion mocks/app/mock_app.go

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

9 changes: 7 additions & 2 deletions mocks/app/mock_features.go

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

Loading