Skip to content

Commit f9ada9b

Browse files
authored
upgrade: mockery and proto-gen, and regen files (#22634)
* update: mockery to v3 and generate mocks * update: protoc-gen to v1.5.1 and regen proto go files * fix: use InterfaceName_mock.go for filename in mockery * update: generate mock files with mockery v3 * fix: case in structname in mockery config * update: testcase errMsg in TestPatchStruct * update: increase timeout for context in TestSubscribeBackend_IntegrationWithServer_TLSReload
1 parent 5bc9cb6 commit f9ada9b

File tree

135 files changed

+9751
-15787
lines changed

Some content is hidden

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

135 files changed

+9751
-15787
lines changed

.grpcmocks.yaml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
# Copyright (c) HashiCorp, Inc.
22
# SPDX-License-Identifier: BUSL-1.1
33

4-
with-expecter: true
4+
dir: grpcmocks/{{.InterfaceDirRelative}}
5+
exclude-interface-regex: (serverStream|Is(Inmem|Cloning).*Client)
6+
include-interface-regex: .*
7+
structname: '{{.InterfaceName}}'
8+
pkgname: mock{{.SrcPackageName}}
59
recursive: true
6-
include-regex: ".*"
7-
exclude-regex: "(serverStream|Is(Inmem|Cloning).*Client)"
8-
# We don't want the mocks within proto-public to prevent forcing a dependency
9-
# of the testify library on the modules usage. The mocks are only for
10-
# internal testing purposes. Other consumers can generated the mocks into
11-
# their own code base.
12-
dir: "grpcmocks/{{.InterfaceDirRelative}}"
13-
outpkg: "mock{{.PackageName}}"
14-
mockname: "{{.InterfaceName}}"
10+
template: testify
11+
filename: 'mock_{{.InterfaceName}}.go'
12+
template-data:
13+
unroll-variadic: true
1514
packages:
16-
github.com/hashicorp/consul/proto-public/pbacl:
17-
github.com/hashicorp/consul/proto-public/pbconnectca:
18-
github.com/hashicorp/consul/proto-public/pbdataplane:
19-
github.com/hashicorp/consul/proto-public/pbserverdiscovery:
20-
github.com/hashicorp/consul/proto-public/pbresource:
21-
github.com/hashicorp/consul/proto-public/pbdns:
15+
github.com/hashicorp/consul/proto-public/pbacl: {}
16+
github.com/hashicorp/consul/proto-public/pbconnectca: {}
17+
github.com/hashicorp/consul/proto-public/pbdataplane: {}
18+
github.com/hashicorp/consul/proto-public/pbdns: {}
19+
github.com/hashicorp/consul/proto-public/pbresource: {}
20+
github.com/hashicorp/consul/proto-public/pbserverdiscovery: {}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ GO_MODULES := $(shell find . -name go.mod -exec dirname {} \; | grep -v "proto-g
1111
# or the string @DEV to imply use what is currently installed locally.
1212
###
1313
GOLANGCI_LINT_VERSION='v1.64.8'
14-
MOCKERY_VERSION='v2.53.4'
14+
MOCKERY_VERSION='v3.5.2'
1515
BUF_VERSION='v1.26.0'
1616

17-
PROTOC_GEN_GO_GRPC_VERSION='v1.2.0'
17+
PROTOC_GEN_GO_GRPC_VERSION='v1.5.1'
1818
MOG_VERSION='74a24e5f2782c2421cc6335c478686f62e9a0688'
1919
PROTOC_GO_INJECT_TAG_VERSION='v1.3.0'
2020
PROTOC_GEN_GO_BINARY_VERSION='v0.1.0'

agent/consul/reporting/.mockery.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: BUSL-1.1
3+
4+
all: true
5+
dir: reportingmock
6+
structname: '{{.InterfaceName}}'
7+
pkgname: reportingmock
8+
filename: 'mock_{{.InterfaceName}}.go'
9+
recursive: false
10+
template: testify
11+
template-data:
12+
unroll-variadic: true
13+
packages:
14+
github.com/hashicorp/consul/agent/consul/reporting: {}

agent/consul/reporting/reportingmock/mock_ServerDelegate.go

Lines changed: 78 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)