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

test: update mockery configuration and regenerate mocks #955

Merged
merged 22 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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 .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.

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

This file was deleted.

Loading
Loading