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 17 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 @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: "1.23"
go-version: "1.23.2"
lklimek marked this conversation as resolved.
Show resolved Hide resolved

- uses: actions/checkout@v4

Expand All @@ -35,7 +35,7 @@ jobs:
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 @@ -336,7 +336,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"
imocks "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 := &imocks.EventSink{}
lklimek marked this conversation as resolved.
Show resolved Hide resolved

mockBlockStore.
On("Base").Return(base).
Expand Down
10 changes: 6 additions & 4 deletions dash/core/mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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