Skip to content

Commit 3f36c83

Browse files
committed
Switch to stretchr/testify / mockery for mocks
testify is used throughout the codebase; this switches mocks from gomock to testify with the help of mockery for code generation. Handlers and mocks in test/utils/oidc are moved to a new package: mockery operates package by package, and requires packages to build correctly; test/utils/oidc/testserver.go relies on the mocks and fails to build when they are removed. Moving the interface and mocks to a different package allows mockery to process that package without having to build testserver.go. Signed-off-by: Stephen Kitt <[email protected]>
1 parent 78377c4 commit 3f36c83

File tree

97 files changed

+12122
-5169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+12122
-5169
lines changed

LICENSES/vendor/github.com/stretchr/objx/LICENSE

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSES/vendor/go.uber.org/mock/LICENSE

-206
This file was deleted.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ require (
6969
go.opentelemetry.io/otel/trace v1.20.0
7070
go.opentelemetry.io/proto/otlp v1.0.0
7171
go.uber.org/goleak v1.3.0
72-
go.uber.org/mock v0.4.0
7372
go.uber.org/zap v1.26.0
7473
golang.org/x/crypto v0.23.0
7574
golang.org/x/net v0.25.0
@@ -192,6 +191,7 @@ require (
192191
github.com/sirupsen/logrus v1.9.3 // indirect
193192
github.com/soheilhy/cmux v0.1.5 // indirect
194193
github.com/stoewer/go-strcase v1.2.0 // indirect
194+
github.com/stretchr/objx v0.5.0 // indirect
195195
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
196196
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 // indirect
197197
github.com/x448/float16 v0.8.4 // indirect

go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,6 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
717717
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
718718
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
719719
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
720-
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
721-
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
722720
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
723721
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
724722
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=

hack/tools/go.mod

+13-11
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ require (
88
github.com/client9/misspell v0.3.4
99
github.com/golangci/golangci-lint v1.56.2
1010
github.com/jcchavezs/porto v0.6.0
11+
github.com/vektra/mockery/v2 v2.40.3
1112
go.uber.org/automaxprocs v1.5.2
12-
go.uber.org/mock v0.4.0
1313
gotest.tools/gotestsum v1.6.4
1414
honnef.co/go/tools v0.4.6
1515
sigs.k8s.io/logtools v0.8.1
@@ -47,6 +47,7 @@ require (
4747
github.com/cespare/xxhash/v2 v2.1.2 // indirect
4848
github.com/charithe/durationcheck v0.0.10 // indirect
4949
github.com/chavacava/garif v0.1.0 // indirect
50+
github.com/chigopher/pathlib v0.19.1 // indirect
5051
github.com/curioswitch/go-reassign v0.2.0 // indirect
5152
github.com/daixiang0/gci v0.12.1 // indirect
5253
github.com/davecgh/go-spew v1.1.1 // indirect
@@ -57,7 +58,7 @@ require (
5758
github.com/fatih/color v1.16.0 // indirect
5859
github.com/fatih/structtag v1.2.0 // indirect
5960
github.com/firefart/nonamedreturns v1.0.4 // indirect
60-
github.com/fsnotify/fsnotify v1.5.4 // indirect
61+
github.com/fsnotify/fsnotify v1.6.0 // indirect
6162
github.com/fzipp/gocyclo v0.6.0 // indirect
6263
github.com/ghostiam/protogetter v0.3.4 // indirect
6364
github.com/go-critic/go-critic v0.11.1 // indirect
@@ -92,9 +93,12 @@ require (
9293
github.com/hashicorp/go-version v1.6.0 // indirect
9394
github.com/hashicorp/hcl v1.0.0 // indirect
9495
github.com/hexops/gotextdiff v1.0.3 // indirect
96+
github.com/huandu/xstrings v1.4.0 // indirect
97+
github.com/iancoleman/strcase v0.2.0 // indirect
9598
github.com/inconshreveable/mousetrap v1.1.0 // indirect
9699
github.com/jgautheron/goconst v1.7.0 // indirect
97100
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
101+
github.com/jinzhu/copier v0.3.5 // indirect
98102
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
99103
github.com/jjti/go-spancheck v0.5.2 // indirect
100104
github.com/jonboulle/clockwork v0.2.2 // indirect
@@ -110,7 +114,7 @@ require (
110114
github.com/leonklingele/grouper v1.1.1 // indirect
111115
github.com/lufeee/execinquery v1.2.1 // indirect
112116
github.com/macabu/inamedparam v0.1.3 // indirect
113-
github.com/magiconair/properties v1.8.6 // indirect
117+
github.com/magiconair/properties v1.8.7 // indirect
114118
github.com/maratori/testableexamples v1.0.0 // indirect
115119
github.com/maratori/testpackage v1.1.1 // indirect
116120
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect
@@ -124,13 +128,11 @@ require (
124128
github.com/mitchellh/mapstructure v1.5.0 // indirect
125129
github.com/moricho/tparallel v0.3.1 // indirect
126130
github.com/nakabonne/nestif v0.3.1 // indirect
127-
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
128131
github.com/nishanths/exhaustive v0.12.0 // indirect
129132
github.com/nishanths/predeclared v0.2.2 // indirect
130133
github.com/nunnatsa/ginkgolinter v0.15.2 // indirect
131134
github.com/olekukonko/tablewriter v0.0.5 // indirect
132-
github.com/pelletier/go-toml v1.9.5 // indirect
133-
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
135+
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
134136
github.com/pkg/errors v0.9.1 // indirect
135137
github.com/pmezard/go-difflib v1.0.0 // indirect
136138
github.com/polyfloyd/go-errorlint v1.4.8 // indirect
@@ -142,6 +144,7 @@ require (
142144
github.com/quasilyte/gogrep v0.5.0 // indirect
143145
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
144146
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
147+
github.com/rs/zerolog v1.29.0 // indirect
145148
github.com/ryancurrah/gomodguard v1.3.0 // indirect
146149
github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect
147150
github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect
@@ -160,12 +163,12 @@ require (
160163
github.com/spf13/cobra v1.7.0 // indirect
161164
github.com/spf13/jwalterweatherman v1.1.0 // indirect
162165
github.com/spf13/pflag v1.0.5 // indirect
163-
github.com/spf13/viper v1.13.0 // indirect
166+
github.com/spf13/viper v1.15.0 // indirect
164167
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
165168
github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect
166169
github.com/stretchr/objx v0.5.0 // indirect
167170
github.com/stretchr/testify v1.8.4 // indirect
168-
github.com/subosito/gotenv v1.4.1 // indirect
171+
github.com/subosito/gotenv v1.4.2 // indirect
169172
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect
170173
github.com/tdakkota/asciicheck v0.2.0 // indirect
171174
github.com/tetafro/godot v1.4.16 // indirect
@@ -183,8 +186,8 @@ require (
183186
gitlab.com/bosi/decorder v0.4.1 // indirect
184187
go-simpler.org/musttag v0.8.0 // indirect
185188
go-simpler.org/sloglint v0.4.0 // indirect
186-
go.uber.org/atomic v1.7.0 // indirect
187-
go.uber.org/multierr v1.6.0 // indirect
189+
go.uber.org/atomic v1.9.0 // indirect
190+
go.uber.org/multierr v1.8.0 // indirect
188191
go.uber.org/zap v1.24.0 // indirect
189192
golang.org/x/crypto v0.19.0 // indirect
190193
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
@@ -196,7 +199,6 @@ require (
196199
golang.org/x/text v0.14.0 // indirect
197200
golang.org/x/tools v0.18.0 // indirect
198201
google.golang.org/protobuf v1.31.0 // indirect
199-
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
200202
gopkg.in/ini.v1 v1.67.0 // indirect
201203
gopkg.in/yaml.v2 v2.4.0 // indirect
202204
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)