Skip to content

Commit

Permalink
test: update mockery configuration and regenerate mocks (#955)
Browse files Browse the repository at this point in the history
* build(deps): Bump github.com/vektra/mockery/v2 from 2.41.0 to 2.46.2

Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.41.0 to 2.46.2.
- [Release notes](https://github.com/vektra/mockery/releases)
- [Changelog](https://github.com/vektra/mockery/blob/master/docs/changelog.md)
- [Commits](vektra/mockery@v2.41.0...v2.46.2)

---
updated-dependencies:
- dependency-name: github.com/vektra/mockery/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: update deps

* build(deps): Upgrade go to 1.23

* chore: trigger workflow

* chore: make mockery

* chore: fix typo

* build(deps): upgrade golangci-lint to 1.61

* build(github): display mockery diff for debugging

* chore: upgrade mockery config to new format

* chore: update mockery

* chore: regenerate all mocks

* chore: no expecters

* chore: updated check-mocks

* chore: use prebuilt mockery

* chore: fix consistency of indexermocks invocation

* build(deps): update mockery to 2.46.3

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
lklimek and dependabot[bot] authored Nov 6, 2024
1 parent 52ea7e5 commit d28d5a8
Show file tree
Hide file tree
Showing 35 changed files with 81 additions and 2,014 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
run: |
set -euo pipefail
readonly MOCKERY=2.46.2 # N.B. no leading "v"
readonly MOCKERY=2.46.3 # N.B. no leading "v"
curl -sL "https://github.com/vektra/mockery/releases/download/v${MOCKERY}/mockery_${MOCKERY}_Linux_x86_64.tar.gz" | tar -C /usr/local/bin -xzf -
make mockery 2>/dev/null
if ! git diff --stat --exit-code ; then
if ! git diff --exit-code ; then
echo ">> ERROR:"
echo ">>"
echo ">> Generated mocks require update (either Mockery or source files may have changed)."
Expand Down
71 changes: 71 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
with-expecter: false
dir: "{{.InterfaceDir}}/mocks"
mockname: "{{.InterfaceName}}"
outpkg: "mocks"
filename: "{{.InterfaceName | lower}}.go"
log-level: "warn"
disable-version-string: true
all: false
packages:
github.com/dashpay/tenderdash/abci/client:
interfaces:
Client:
github.com/dashpay/tenderdash/abci/types:
interfaces:
Application:
github.com/dashpay/tenderdash/dash/core:
interfaces:
Client:
github.com/dashpay/tenderdash/internal/consensus:
interfaces:
Gossiper:
github.com/dashpay/tenderdash/internal/consensus/versioned/selectproposer:
interfaces:
ProposerSelector:
github.com/dashpay/tenderdash/internal/evidence:
interfaces:
BlockStore:
github.com/dashpay/tenderdash/internal/mempool:
interfaces:
Mempool:
github.com/dashpay/tenderdash/internal/p2p:
interfaces:
Transport:
Connection:
Channel:
github.com/dashpay/tenderdash/internal/p2p/client:
interfaces:
Client:
BlockClient:
SnapshotClient:
github.com/dashpay/tenderdash/internal/state:
interfaces:
BlockStore:
EvidencePool:
Executor:
Store:
github.com/dashpay/tenderdash/internal/state/indexer:
interfaces:
EventSink:
github.com/dashpay/tenderdash/internal/statesync:
interfaces:
StateProvider:
github.com/dashpay/tenderdash/libs/store:
interfaces:
Store:
github.com/dashpay/tenderdash/light/provider:
interfaces:
Provider:
github.com/dashpay/tenderdash/light/rpc:
interfaces:
LightClient:
github.com/dashpay/tenderdash/rpc/client:
interfaces:
Client:
RemoteClient:
github.com/dashpay/tenderdash/types:
interfaces:
Store:
PrivValidator:
BlockEventPublisher:
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ build-docker:
###############################################################################

mockery:
go generate -run="./scripts/mockery_generate.sh" ./...
./scripts/mockery_generate.sh
.PHONY: mockery

###############################################################################
Expand Down
3 changes: 2 additions & 1 deletion cmd/tenderdash/commands/reindex_event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
abcitypes "github.com/dashpay/tenderdash/abci/types"
"github.com/dashpay/tenderdash/config"
"github.com/dashpay/tenderdash/internal/state/indexer"
indexermocks "github.com/dashpay/tenderdash/internal/state/indexer/mocks"
"github.com/dashpay/tenderdash/internal/state/mocks"
"github.com/dashpay/tenderdash/libs/log"
"github.com/dashpay/tenderdash/proto/tendermint/state"
Expand Down Expand Up @@ -136,7 +137,7 @@ func TestLoadBlockStore(t *testing.T) {
func TestReIndexEvent(t *testing.T) {
mockBlockStore := &mocks.BlockStore{}
mockStateStore := &mocks.Store{}
mockEventSink := &mocks.EventSink{}
mockEventSink := &indexermocks.EventSink{}

mockBlockStore.
On("Base").Return(base).
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ require (
github.com/creachadair/taskgroup v0.12.0
github.com/go-pkgz/jrpc v0.2.0
github.com/google/go-cmp v0.6.0
github.com/vektra/mockery/v2 v2.46.2
github.com/vektra/mockery/v2 v2.46.3
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,8 @@ github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZy
github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U=
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
github.com/vektra/mockery/v2 v2.46.2 h1:bpUncWvkiDzqn+aWwt4dY1aS0F8Ob4k8+WJrWU/Kh4s=
github.com/vektra/mockery/v2 v2.46.2/go.mod h1:dDivqi0ShM8A29mLgZn13yZ14MdXlTM4V360u8JDWCQ=
github.com/vektra/mockery/v2 v2.46.3 h1:Aia4iShZeNTy6CZJcvweK4X97XOzXcqb+k9jm8IqBS0=
github.com/vektra/mockery/v2 v2.46.3/go.mod h1:dDivqi0ShM8A29mLgZn13yZ14MdXlTM4V360u8JDWCQ=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
Expand Down
70 changes: 0 additions & 70 deletions internal/blocksync/mocks/block_client.go

This file was deleted.

72 changes: 0 additions & 72 deletions internal/consensus/mocks/fast_sync_reactor.go

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
67 changes: 0 additions & 67 deletions internal/proxy/mocks/app_conn_mempool.go

This file was deleted.

Loading

0 comments on commit d28d5a8

Please sign in to comment.