-
Notifications
You must be signed in to change notification settings - Fork 28
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
Minor IBC integration-test improvements & fixes #497
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
integration-tests/chain.go
line 212 at r1 (raw file):
defer requestCancel() balanceRes, err := bankClient.Balance(requestCtx, &banktypes.QueryBalanceRequest{
I did it intentionally, to because you might use wrong denom during the development, and that error will show you the current state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the PR to Draft probably? Is see the commented code in it, but I guess it's temporary.
Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes my fault
fixed now
Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @wojtek-coreum)
integration-tests/chain.go
line 212 at r1 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
I did it intentionally, to because you might use wrong denom during the development, and that error will show you the current state.
I see
Rollbacked & added comment there
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
coreumRecipient := coreumChain.GenAccount() sendToCoreumCoin := gaiaChain.NewCoin(sdk.NewInt(2000))
IMO it is beneficial to send different amounts in different tests to make sure we don't have accidental successes because of using the same amounts. I had this confusion while running tests because I had failurs & in both TestIBCTransferFromCoreumToGaiaAndBack
& TestIBCTransferFromGaiaToCoreumAndBack
we have same amount 1000 & they run in parallel
Maybe it is even better to use rand.Int
in such places
WDYT ?
integration-tests/ibc/helpers.go
line 3 at r3 (raw file):
//go:build integrationtests package ibc
since this code is only used inside integration-tests/ibc I think it is reasonable to store it here
AwaitForBalance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, 3 of 3 files at r4, 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @ysv)
integration-tests/chain.go
line 235 at r6 (raw file):
// GetIBCChannelID returns the first opened channel of the IBC connected chain peer. func (c ChainContext) GetIBCChannelID(ctx context.Context, destChainID string) (string, error) {
Minor: I like "peer" word more and I think we use it consistently everywhere
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
IMO it is beneficial to send different amounts in different tests to make sure we don't have accidental successes because of using the same amounts. I had this confusion while running tests because I had failurs & in both
TestIBCTransferFromCoreumToGaiaAndBack
&TestIBCTransferFromGaiaToCoreumAndBack
we have same amount 1000 & they run in parallelMaybe it is even better to use
rand.Int
in such placesWDYT ?
Agree to use different amounts but let's avoid randomness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r2, 1 of 1 files at r3, 3 of 3 files at r4, 1 of 1 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @silverspase, and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 5 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @wojtek-coreum)
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
Agree to use different amounts but let's avoid randomness
agree, will keep hardcoded but different amounts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 5 files reviewed, 2 unresolved discussions (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
integration-tests/ibc/helpers.go
line 1 at r7 (raw file):
//go:build integrationtests
Let's keep the file name, and still call it ibc.go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r4, 1 of 1 files at r6, 3 of 3 files at r7, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r7, 1 of 1 files at r8, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
agree, will keep hardcoded but different amounts
But how does the different amount help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r8, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @wojtek-coreum)
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
But how does the different amount help?
because these amounts might unintentionally match and will not detect a mistake in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @wojtek-coreum)
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
because these amounts might unintentionally match and will not detect a mistake in tests
same issue as we have here:
https://github.com/CoreumFoundation/coreum/pull/503/files#diff-fdb4e65de50064f97071dbab024f3e4655b8c86de59115e67b47e8197824b068R23
Since all channels are named channel-0 we have mistake in our tests but because of same naming they pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @wojtek-coreum)
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
same issue as we have here:
https://github.com/CoreumFoundation/coreum/pull/503/files#diff-fdb4e65de50064f97071dbab024f3e4655b8c86de59115e67b47e8197824b068R23Since all channels are named channel-0 we have mistake in our tests but because of same naming they pass
But the accounts are new each time, if the issue with the amount the account won't receive it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @wojtek-coreum)
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
But the accounts are new each time, if the issue with the amount the account won't receive it.
What are the benefits of using same amounts ?
IMO there are no. While using different will protect agains these type of issues, it has already happened for channel names that is why it is always better to use different amounts as a rule, maybe in this case it is unlikely to happen but it helps in general. Also it makes debugging easier.
Debugging example:
E.g when I see 2000 in logs I know that refer to a specific test. But if I see 1000 everywhere it could any tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @wojtek-coreum)
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
What are the benefits of using same amounts ?
IMO there are no. While using different will protect agains these type of issues, it has already happened for channel names that is why it is always better to use different amounts as a rule, maybe in this case it is unlikely to happen but it helps in general. Also it makes debugging easier.
Debugging example:
E.g when I see 2000 in logs I know that refer to a specific test. But if I see 1000 everywhere it could any tests
OK, let's leave that comment until we discuss the https://github.com/CoreumFoundation/coreum/pull/503/files#diff-fdb4e65de50064f97071dbab024f3e4655b8c86de59115e67b47e8197824b068R23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 5 files reviewed, all discussions resolved (waiting on @dzmitryhil, @miladz68, @silverspase, and @wojtek-coreum)
integration-tests/ibc/transfer_test.go
line 64 at r3 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
OK, let's leave that comment until we discuss the https://github.com/CoreumFoundation/coreum/pull/503/files#diff-fdb4e65de50064f97071dbab024f3e4655b8c86de59115e67b47e8197824b068R23
rollbacked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r9, all commit messages.
Reviewable status: 3 of 5 files reviewed, all discussions resolved (waiting on @miladz68, @silverspase, and @wojtek-coreum)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r9, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @miladz68, @silverspase, and @wojtek-coreum)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r9, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @wojtek-coreum)
This change is