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: use non-deprecated gomock package & fix unit tests #88

Merged
merged 7 commits into from
Sep 28, 2023

Conversation

jtieri
Copy link
Member

@jtieri jtieri commented Aug 30, 2023

the github.com/golang/mock package has been archived with the suggestion to use the forked version here. this pr replaces the now abandoned repo in favor of the maintained fork and regenerates the mocks.

d72e83c also introduced some breakage in the unit tests which i've fixed.

@jtieri jtieri added BACKPORT Backport into maintained branches packet-forward-middleware Label for items related to the packet forward middleware labels Aug 30, 2023
@jtieri jtieri requested review from agouin and boojamya September 11, 2023 17:40
@@ -147,6 +147,7 @@ mocks: $(MOCKS_DIR)
mockgen -package=mock -destination=./test/mock/bank_keeper.go $(GOMOD)/router/types BankKeeper
mockgen -package=mock -destination=./test/mock/ics4_wrapper.go github.com/cosmos/ibc-go/v7/modules/core/05-port/types ICS4Wrapper
mockgen -package=mock -destination=./test/mock/ibc_module.go github.com/cosmos/ibc-go/v7/modules/core/05-port/types IBCModule
mockgen -package=mock -destination=./test/mock/channel_keeper.go $(GOMOD)/router/types ChannelKeeper
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add go install go.uber.org/mock/[email protected] into the mocks target, or a comment to use this for mockgen now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, i'll add this now!

@Reecepbcups
Copy link
Member

cc @jtieri this is actually approved now with me being added to the IBCApps team

@jtieri
Copy link
Member Author

jtieri commented Sep 28, 2023

cc @jtieri this is actually approved now with me being added to the IBCApps team

thanks! just getting back around to this, i'll add that line to the Makefile target for generating the mocks then get this merged.

@jtieri jtieri merged commit b1b6db8 into main Sep 28, 2023
5 checks passed
@jtieri jtieri deleted the justin/fix-tests branch September 28, 2023 18:15
mergify bot pushed a commit that referenced this pull request Sep 28, 2023
* test: use non-deprecated gomock package & fix unit tests

* build: add go install cmd to the mocks target

* test: fix failing test on empty packet payload

(cherry picked from commit b1b6db8)

# Conflicts:
#	middleware/packet-forward-middleware/Makefile
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/go.sum
#	middleware/packet-forward-middleware/router/module_test.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go
mergify bot pushed a commit that referenced this pull request Sep 28, 2023
* test: use non-deprecated gomock package & fix unit tests

* build: add go install cmd to the mocks target

* test: fix failing test on empty packet payload

(cherry picked from commit b1b6db8)

# Conflicts:
#	middleware/packet-forward-middleware/Makefile
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/router/module_test.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go
mergify bot pushed a commit that referenced this pull request Sep 28, 2023
* test: use non-deprecated gomock package & fix unit tests

* build: add go install cmd to the mocks target

* test: fix failing test on empty packet payload

(cherry picked from commit b1b6db8)

# Conflicts:
#	middleware/packet-forward-middleware/Makefile
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/router/module_test.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go
mergify bot added a commit that referenced this pull request Oct 2, 2023
…ix unit tests (#115)

* test: use non-deprecated gomock package & fix unit tests (#88)

* test: use non-deprecated gomock package & fix unit tests

* build: add go install cmd to the mocks target

* test: fix failing test on empty packet payload

(cherry picked from commit b1b6db8)

# Conflicts:
#	middleware/packet-forward-middleware/Makefile
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/router/module_test.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go

* fix backport v7 -> v6

* lint

---------

Co-authored-by: Justin Tieri <[email protected]>
Co-authored-by: Reece Williams <[email protected]>
mergify bot added a commit that referenced this pull request Oct 2, 2023
…ix unit tests (#114)

* test: use non-deprecated gomock package & fix unit tests (#88)

* test: use non-deprecated gomock package & fix unit tests

* build: add go install cmd to the mocks target

* test: fix failing test on empty packet payload

(cherry picked from commit b1b6db8)

# Conflicts:
#	middleware/packet-forward-middleware/Makefile
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/router/module_test.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go

* fix: backport v7 -> v5

---------

Co-authored-by: Justin Tieri <[email protected]>
Co-authored-by: Reece Williams <[email protected]>
mergify bot added a commit that referenced this pull request Oct 2, 2023
…ix unit tests (#113)

* test: use non-deprecated gomock package & fix unit tests (#88)

* test: use non-deprecated gomock package & fix unit tests

* build: add go install cmd to the mocks target

* test: fix failing test on empty packet payload

(cherry picked from commit b1b6db8)

# Conflicts:
#	middleware/packet-forward-middleware/Makefile
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/go.sum
#	middleware/packet-forward-middleware/router/module_test.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go

* fix backport v7 -> v4

---------

Co-authored-by: Justin Tieri <[email protected]>
Co-authored-by: Reece Williams <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BACKPORT Backport into maintained branches packet-forward-middleware Label for items related to the packet forward middleware
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants