Skip to content

Commit dd05a6b

Browse files
authored
chore: mockgen archived, moved to new location (#11415)
* chore: mockgen archived, moved to new location
1 parent bb35106 commit dd05a6b

File tree

21 files changed

+342
-323
lines changed

21 files changed

+342
-323
lines changed

.github/workflows/ci.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.33
189189
go install golang.org/x/tools/cmd/goimports@latest
190190
go install github.com/mikefarah/yq/v4@v4.30.6
191-
go install github.com/golang/mock/mockgen@v1.6.0
191+
go install go.uber.org/mock/mockgen@v0.4.0
192192
193193
- name: Install Protoc
194194
run: |
@@ -450,7 +450,7 @@ jobs:
450450
go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.33
451451
go install golang.org/x/tools/cmd/goimports@latest
452452
go install github.com/mikefarah/yq/v4@v4.30.6
453-
go install github.com/golang/mock/mockgen@v1.6.0
453+
go install go.uber.org/mock/mockgen@v0.4.0
454454
455455
- name: Install Protoc
456456
run: |
@@ -592,7 +592,7 @@ jobs:
592592
go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.33
593593
go install golang.org/x/tools/cmd/goimports@latest
594594
go install github.com/mikefarah/yq/v4@v4.30.6
595-
go install github.com/golang/mock/mockgen@v1.6.0
595+
go install go.uber.org/mock/mockgen@v0.4.0
596596
597597
- name: Setup sqlc
598598
uses: ./.github/actions/setup-sqlc

.github/workflows/security.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- name: Install yq
7676
run: go run github.com/mikefarah/yq/v4@v4.30.6
7777
- name: Install mockgen
78-
run: go install github.com/golang/mock/mockgen@v1.6.0
78+
run: go install go.uber.org/mock/mockgen@v0.4.0
7979
- name: Install protoc-gen-go
8080
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.30
8181
- name: Install protoc-gen-go-drpc

agent/agent_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
"time"
2828

2929
"github.com/bramvdbogaerde/go-scp"
30-
"github.com/golang/mock/gomock"
3130
"github.com/google/uuid"
3231
"github.com/pion/udp"
3332
"github.com/pkg/sftp"
@@ -37,6 +36,7 @@ import (
3736
"github.com/stretchr/testify/assert"
3837
"github.com/stretchr/testify/require"
3938
"go.uber.org/goleak"
39+
"go.uber.org/mock/gomock"
4040
"golang.org/x/crypto/ssh"
4141
"golang.org/x/exp/slices"
4242
"golang.org/x/xerrors"

agent/agentproc/agentproctest/syscallermock.go

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

agent/agentproc/proc_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"syscall"
66
"testing"
77

8-
"github.com/golang/mock/gomock"
98
"github.com/spf13/afero"
109
"github.com/stretchr/testify/require"
10+
"go.uber.org/mock/gomock"
1111
"golang.org/x/xerrors"
1212

1313
"github.com/coder/coder/v2/agent/agentproc"

coderd/database/dbauthz/setup_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"strings"
1010
"testing"
1111

12-
"github.com/golang/mock/gomock"
1312
"github.com/google/uuid"
1413
"github.com/open-policy-agent/opa/topdown"
1514
"github.com/stretchr/testify/require"
1615
"github.com/stretchr/testify/suite"
16+
"go.uber.org/mock/gomock"
1717
"golang.org/x/xerrors"
1818

1919
"cdr.dev/slog"

coderd/database/dbmock/dbmock.go

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

coderd/database/tx_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"database/sql"
55
"testing"
66

7-
"github.com/golang/mock/gomock"
87
"github.com/lib/pq"
98
"github.com/stretchr/testify/require"
9+
"go.uber.org/mock/gomock"
1010
"golang.org/x/xerrors"
1111

1212
"github.com/coder/coder/v2/coderd/database"

coderd/healthcheck/database_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"testing"
66
"time"
77

8-
"github.com/golang/mock/gomock"
98
"github.com/stretchr/testify/assert"
109
"github.com/stretchr/testify/require"
10+
"go.uber.org/mock/gomock"
1111
"golang.org/x/xerrors"
1212

1313
"github.com/coder/coder/v2/coderd/database/dbmock"

coderd/provisionerjobs_internal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import (
1010
"testing"
1111
"time"
1212

13-
"github.com/golang/mock/gomock"
1413
"github.com/google/uuid"
1514
"github.com/stretchr/testify/assert"
1615
"github.com/stretchr/testify/require"
16+
"go.uber.org/mock/gomock"
1717
"nhooyr.io/websocket"
1818

1919
"cdr.dev/slog/sloggers/slogtest"

coderd/workspaceagentsrpc_internal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010

1111
"github.com/coder/coder/v2/coderd/util/ptr"
1212

13-
"github.com/golang/mock/gomock"
1413
"github.com/google/uuid"
1514
"github.com/stretchr/testify/require"
15+
"go.uber.org/mock/gomock"
1616
"nhooyr.io/websocket"
1717

1818
"cdr.dev/slog"

coderd/wsbuilder/wsbuilder_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import (
1010

1111
"github.com/coder/coder/v2/provisionersdk"
1212

13-
"github.com/golang/mock/gomock"
1413
"github.com/google/uuid"
1514
"github.com/stretchr/testify/assert"
1615
"github.com/stretchr/testify/require"
1716
"go.opentelemetry.io/otel"
1817
"go.opentelemetry.io/otel/propagation"
18+
"go.uber.org/mock/gomock"
1919

2020
"github.com/coder/coder/v2/coderd/audit"
2121
"github.com/coder/coder/v2/coderd/database"

dogfood/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ RUN mkdir --parents "$GOPATH" && \
7373
# yq v3 used in v1.
7474
go install github.com/mikefarah/yq/v4@v4.30.6 && \
7575
mv /tmp/bin/yq /tmp/bin/yq4 && \
76-
go install github.com/golang/mock/mockgen@v1.6.0
76+
go install go.uber.org/mock/mockgen@v0.4.0
7777

7878
FROM gcr.io/coder-dev-1/alpine:3.18 as proto
7979
WORKDIR /tmp

enterprise/coderd/schedule/user_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"context"
55
"testing"
66

7-
"github.com/golang/mock/gomock"
87
"github.com/google/uuid"
98
"github.com/stretchr/testify/require"
9+
"go.uber.org/mock/gomock"
1010

1111
"github.com/coder/coder/v2/coderd/database"
1212
"github.com/coder/coder/v2/coderd/database/dbmock"

enterprise/dbcrypt/dbcrypt_internal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"io"
1010
"testing"
1111

12-
"github.com/golang/mock/gomock"
1312
"github.com/lib/pq"
1413
"github.com/stretchr/testify/require"
14+
"go.uber.org/mock/gomock"
1515

1616
"github.com/coder/coder/v2/coderd/database"
1717
"github.com/coder/coder/v2/coderd/database/dbgen"

enterprise/tailnet/pgcoord_internal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"testing"
1111
"time"
1212

13-
"github.com/golang/mock/gomock"
1413
"github.com/google/uuid"
1514
"github.com/stretchr/testify/require"
15+
"go.uber.org/mock/gomock"
1616
gProto "google.golang.org/protobuf/proto"
1717

1818
"cdr.dev/slog"

enterprise/tailnet/pgcoord_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111

1212
agpltest "github.com/coder/coder/v2/tailnet/test"
1313

14-
"github.com/golang/mock/gomock"
1514
"github.com/google/uuid"
1615
"github.com/stretchr/testify/assert"
1716
"github.com/stretchr/testify/require"
1817
"go.uber.org/goleak"
18+
"go.uber.org/mock/gomock"
1919
"golang.org/x/exp/slices"
2020
"golang.org/x/xerrors"
2121
gProto "google.golang.org/protobuf/proto"

enterprise/wsproxy/wsproxysdk/wsproxysdk_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414
"time"
1515

1616
"github.com/go-chi/chi/v5"
17-
"github.com/golang/mock/gomock"
1817
"github.com/google/uuid"
1918
"github.com/stretchr/testify/assert"
2019
"github.com/stretchr/testify/require"
20+
"go.uber.org/mock/gomock"
2121
"golang.org/x/xerrors"
2222
"nhooyr.io/websocket"
2323
"tailscale.com/types/key"

go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ require (
206206
tailscale.com v1.46.1
207207
)
208208

209+
require go.uber.org/mock v0.4.0
210+
209211
require (
210212
cloud.google.com/go/compute v1.23.1 // indirect
211213
cloud.google.com/go/logging v1.8.1 // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,8 @@ go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
984984
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
985985
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
986986
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
987+
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
988+
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
987989
go4.org/intern v0.0.0-20211027215823-ae77deb06f29/go.mod h1:cS2ma+47FKrLPdXFpr7CuxiTW3eyJbWew4qx0qtQWDA=
988990
go4.org/intern v0.0.0-20230525184215-6c62f75575cb h1:ae7kzL5Cfdmcecbh22ll7lYP3iuUdnfnhiPcSaDgH/8=
989991
go4.org/intern v0.0.0-20230525184215-6c62f75575cb/go.mod h1:Ycrt6raEcnF5FTsLiLKkhBTO6DPX3RCUCUVnks3gFJU=

tailnet/tailnettest/multiagentmock.go

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

0 commit comments

Comments
 (0)