-
Notifications
You must be signed in to change notification settings - Fork 586
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
Add E2ETestSuite Type (E2E #3) #1650
Add E2ETestSuite Type (E2E #3) #1650
Conversation
@@ -3,32 +3,24 @@ package main | |||
import ( |
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.
I had misunderstood the behaviour of the ref/pr values in GithubActions. I simplified this script to simply accept a PR number as a string, or use "main" if we are not in a PR.
) | ||
|
||
func TestFeeMiddlewareTestSuite(t *testing.T) { | ||
suite.Run(t, new(FeeMiddlewareTestSuite)) | ||
} | ||
|
||
type FeeMiddlewareTestSuite struct { | ||
suite.Suite | ||
testsuite.E2ETestSuite | ||
} | ||
|
||
func (s *FeeMiddlewareTestSuite) TestPlaceholder() { |
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.
the place holder test now creates chains in a container and starts a relayer (no assertions are made yet!)
I plan on applying the changes we discussed in the call today in a followup PR. |
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.
Excellent work @chatton! Reviewed mostly everything (still have the second half of testsuite.go). Left a lot of suggestions. Always open to opposing viewpoints on these suggestions. I realize some of the comments I suggested might require changes to ibctest, but I'd prefer to open issues and request the changes in these cases instead of leaving them as is
Will continue my review when I get a chance. If you feel any of my requested changes require a non-trivial amount of work, please feel free to open an issue for them. I find it easier to make progress in such situations
opts.DestPortName = "transfer" | ||
opts.SourcePortName = "transfer" |
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.
nit: rename to avoid dest
/source
naming. Maybe in a followup issue?
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.
This one is trickier as it is part of the ibctest library.
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.
Is there already an issue created? Would you like me to open one?
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.
I haven't created an issue against the ibctest repo yet for this. The src/dst
naming convention is widespread throughout the repo so it would be a relatively significant change.
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.
Yea you are right. Do you think it is too much work to request changes for?
In the past I've spent a fair amount of time debugging the difference between source/destination, that it seems worthwhile to me to consider changing naming conventions if a library is going to have increased usage. Happy to let the maintainers decide if they want to do the changes, but the "source" and "destination" terminology doesn't make much sense when packet flow is bidirectional
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.
looking at the ibctest code I see the following
func (commander) CreateChannel(pathName string, opts ibc.CreateChannelOptions, homeDir string) []string {
return []string{
"rly", "tx", "channel", pathName,
"--src-port", opts.SourcePortName,
"--dst-port", opts.DestPortName,
"--order", opts.Order.String(),
"--version", opts.Version,
"--home", homeDir,
}
}
It looks like the field names are mappings to the go relayer arguments for channel creation so in this case I think the name makes sense.
I definitely agree that overall we shouldn't use src/dst
for our chain names.
e2e/testsuite/testsuite.go
Outdated
if s.chainPairs == nil { | ||
s.chainPairs = map[string]chainPair{} | ||
} | ||
cp, ok := s.chainPairs[s.T().Name()] |
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.
I have a mild preference for avoiding one/two letter variable naming unless it is contained within a for loop. I think I'd prefer to just use chainPair
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.
I tend to use short variable names when the scope is limited (loops as you mentioned or small functions). I don't feel very strongly about it, so I'm happy to rename to chainPair
in this case. (or path
after the rename mentioned above)
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.
would be curious if @damiannolan has any thoughts?
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.
Agree with both, I usually prefer descriptive/informative names. For example rly
over r
says much more to me.
But in general it depends on the scope and lifespan of the variable, for small loops and functions I feel fine about one or two letter namings. In my opinion its usually fine if the type/variable is inferred from the function name that was invoked too. The exception is func receivers, I usually prefer short-hand for them.
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.
oh whoops, I meant to tag you on this comment @damiannolan. Agree with your response though
…' of https://github.com/cosmos/ibc-go into cian/issue#1648-add-baseline-e2e-test-suite-type-(e2e-#3)
// This should be called at the start of every test, unless fine grained control is required. | ||
func (s *E2ETestSuite) SetupChainsRelayerAndChannel(ctx context.Context, channelOpts ...func(*ibc.CreateChannelOptions)) ibc.Relayer { | ||
chainA, chainB := s.GetChains() | ||
home, err := ioutil.TempDir("", "") |
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.
Should we be using empty strings here? Is this the chain home directory?
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.
with empty strings we will just have a random string generated for the home directory. After this we don't need to interact with the home dir directly.
chainOptions := testconfig.DefaultChainOptions() | ||
for _, opt := range chainOpts { | ||
opt(&chainOptions) | ||
} |
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.
I'm a big fan of the functional opts pattern 👍
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.
Awesome job on this, excited to see the e2e suite come together! Super clean work 🚀
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.
Fantastic work! Thanks for pushing all of this forward!
e2e/testconfig/testconfig.go
Outdated
} | ||
|
||
// newDefaultSimappConfig creates an ibc configuration for simd. | ||
func newDefaultSimappConfig(tc TestConfig, name, chainId, denom string) ibc.ChainConfig { |
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.
func newDefaultSimappConfig(tc TestConfig, name, chainId, denom string) ibc.ChainConfig { | |
func newDefaultSimappConfig(tc TestConfig, name, chainID, denom string) ibc.ChainConfig { |
chainId -> chainID
e2e/testsuite/testsuite.go
Outdated
if s.chainPairs == nil { | ||
s.chainPairs = map[string]chainPair{} | ||
} | ||
cp, ok := s.chainPairs[s.T().Name()] |
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.
oh whoops, I meant to tag you on this comment @damiannolan. Agree with your response though
…' of https://github.com/cosmos/ibc-go into cian/issue#1648-add-baseline-e2e-test-suite-type-(e2e-#3)
* docs: msg types for fee middleware (#1572) * fix broken link * fix: rm AllowUpdateAfter... check (#1118) * update code & test * update proto and adr026 * update CHANGELOG * update cli docs * update broken milestone link * updated docs * update re: comments * nits: adding inline comments Co-authored-by: Sean King <sean@seking.dev> * chore: adding module name to incentivized packet events (#1580) * docs: adding events to fee middleware docs (#1578) * adding fee distribution docs for relayer operators * adding validation information and basic cli examples * removing unnecessary whitespace * updating definitions * adding ics29 fee middleware events docs * cleanup Co-authored-by: Sean King <seantking@users.noreply.github.com> * docs: adding End Users section to ics29 docs (#1579) * docs: adding End Users section to ics29 docs * Update docs/middleware/ics29-fee/end-users.md Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update docs/middleware/ics29-fee/end-users.md Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update docs/middleware/ics29-fee/end-users.md Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update docs/middleware/ics29-fee/end-users.md Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update docs/middleware/ics29-fee/end-users.md Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update docs/middleware/ics29-fee/end-users.md Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update docs/middleware/ics29-fee/end-users.md Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update docs/middleware/ics29-fee/end-users.md Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update docs/middleware/ics29-fee/end-users.md Co-authored-by: Damian Nolan <damiannolan@gmail.com> * chore: add link Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: Damian Nolan <damiannolan@gmail.com> * feat: emitting an event when handling a client upgrade proposal (#1570) * feat: emitting an event when handling a client upgrade proposal * refactor: only emit event if err is nil * refactor: idiotmatic go: * docs: nits (#1595) * docs: document that version string can be empty as argument of RegisterInterchainAccount (#1582) Co-authored-by: Carlos Rodriguez <crodveg@gmail.com> * docs: add upgrade client proposal event (#1596) * Consolidate usage of NewErrorAcknowledgement (#1565) * docs: adding line about module accounts / invariants (#1597) * docs: adding line about module accounts / invariants * Update docs/middleware/ics29-fee/fee-distribution.md Co-authored-by: Damian Nolan <damiannolan@gmail.com> * Update docs/middleware/ics29-fee/fee-distribution.md Co-authored-by: Damian Nolan <damiannolan@gmail.com> Co-authored-by: Damian Nolan <damiannolan@gmail.com> * follow up nits to #1565 (#1598) * delete test files and add error to transfer types * review comments * build(deps): bump github.com/stretchr/testify from 1.7.5 to 1.8.0 (#1616) Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.5 to 1.8.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](stretchr/testify@v1.7.5...v1.8.0) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: bump go package version to v4 (#1564) * chore: bump go package version to v4 * update go.mod * fix alignment * fix build * review comments * build fixes * deps: bumping go version 1.18 (#1627) * bumping go version 1.18 * updating broken workflow setup * add backport to v4.0.x and remove backports to v1 (EoL) (#1629) * delete unused 04-channel version functions (#1636) * delete unused code and associated tests * Update CHANGELOG.md * build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.5 to 0.45.6 (#1615) * build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.5 to 0.45.6 Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.45.5 to 0.45.6. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](cosmos/cosmos-sdk@v0.45.5...v0.45.6) --- updated-dependencies: - dependency-name: github.com/cosmos/cosmos-sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Update CHANGELOG.md * copying part of codeql workflow to try to make it pass Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: Carlos Rodriguez <crodveg@gmail.com> * update mergify.yml with new release branches (#1654) * Script to dynamically generate list of e2e tests (E2E #1) (#1644) * Add GitHub actions for e2e tests (E2E #2) (#1646) * Remove crossings hello (#1317) * remove crossing hellos from ChanOpenTry * remove crossing hellos testcase * revert single connectionHops check * add comment in MsgChannelOpenTry tx proto about deprecate field * Update proto/ibc/core/channel/v1/tx.proto Co-authored-by: Aditya <adityasripal@gmail.com> * minor fixes && UPDATE CHANGELOG.md * Update proto/ibc/core/channel/v1/tx.proto Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update proto/ibc/core/channel/v1/tx.proto Co-authored-by: Damian Nolan <damiannolan@gmail.com> * apply remaining changes for crossing hello removal Deprecate previous channel id with proto tag Remove unnecessary test cases from 04-channel Remove crossing hello check in transfer application and the associated test case * remove previous channel check in WriteChannelOpenTry * regenerate proto files * update documentation * add migration documentation * remove unnecessary doc * remove crossing hello notion from ChanOpenAck * apply review suggestions Co-authored-by: Aditya <adityasripal@gmail.com> Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: Damian Nolan <damiannolan@gmail.com> Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com> Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com> * docs: update roadmap (#1678) * update roadmap * update roadmap * Update roadmap.md Co-authored-by: Carlos Rodriguez <crodveg@gmail.com> * refactor: remove crossing hellos from 03-connection (#1672) * remove crossing hello check from ConnOpenTry and ConnOpenAck * remove unnecessary test cases and fix build * fix tests and add migration docs * fix connection version check in conn open ack * add changelog entry * Update modules/core/03-connection/keeper/handshake.go Co-authored-by: Aditya <adityasripal@gmail.com> * remove unnecessary testing function * improve migration documentation as per review suggestion Co-authored-by: Aditya <adityasripal@gmail.com> * (core/23-commitment/types) doc: fix typo (#1694) * remove spurious `TestABCICodeDeterminism` tests (#1695) ## Description Thanks @colin-axner for noticing this. closes: #XXXX --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [x] Re-reviewed `Files changed` in the Github PR explorer - [ ] Review `Codecov Report` in the comment section below once CI passes * update bug report issue template (#1693) * fix codeowners for 02-client (#1696) ## Description Thanks again @colin-axner for signaling this! closes: #XXXX --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [x] Re-reviewed `Files changed` in the Github PR explorer - [ ] Review `Codecov Report` in the comment section below once CI passes * build(deps): bump google.golang.org/grpc from 1.47.0 to 1.48.0 (#1699) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.47.0 to 1.48.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.47.0...v1.48.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: update middleware documentation (#1639) * docs: update middleware documentation * remove old text and add func keyword * alignment * fix alignment * Update develop.md * review comments * remove empty line * docs: add links in middleware docs to fee middleware implementation (#1641) * docs: add links in middleware docs to fee middleware implementation * add extra line for better readability * fix typos * Adding github action to run goimports (#1673) * Add E2ETestSuite Type (E2E #3) (#1650) * Separate go mod for e2e (E2E #4) (#1701) * put back module name in event (#1681) * fix typo * Extracting e2e tests into two separate workflows (#1719) * add categories * Add fee middleware test suite functions (E2E #5) (#1710) * Build local image to run tests with make e2e-test (#1722) * Remove leftover crossing hello tests in connection handshake (#1724) * remove leftover crossing hello tests in connection handshake * fix bug in tests * chore: adding environment variable to specify go relayer image (#1727) * Thomas/1584 update docs apps (#1675) * restructure content according to outline, fix image and syntax highlighting, fix titles and prepare for content updates * rewrite bind port section * restructure applications doc into folder structure * add keeper section, make some minor corrections in bind ports, custom packet and implmenent IBC module sections * update ibcmodule interface to encorporate the simpliefied handshake callbacks and version negotiation * fix broken links * fix remaining broken link * fix some nits, correct for removal of crossing hellos and add some more explanation on portIDs * update middleware docs to resolve merge confilicts * update fee mw docs, add formating, fix typos, increase readability (#1665) * update fee mw docs, add formating, fix typos, increase readability * fix broken link * Apply suggestions from code review (De)capitalize headings and references to headings for consistency Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * resolving merge conflict * split the CLI commands and small typo correction Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore: remove @fedekunze from CODEOWNERS (#1733) * Test for AsyncSingleSender (E2E #6) (#1682) * fix: running e2e-fork for dependabot PRs (#1745) * Adding manual triggering of e2e via workflow dispatch (#1749) * chore: denom traces migration handler (#1680) * update code & test * register migrator service * add changelog entry for #1680 * add issue templates for epics and releases (#1702) * add issue templates for epics and releases * remove text Co-authored-by: Carlos Rodriguez <crodveg@gmail.com> * fix typo * fix typo * feat: allow governance to update the TrustingPeriod of the 07-tendermint light client (#1713) * initial commit * format imports * update docs * update CHANGELOG * update upgrade dev docs * update re: pr comments * E2E Test: TestMsgPayPacketFeeSingleSender (#1756) * move entry to right place * build(deps): bump docker/build-push-action from 3.0.0 to 3.1.0 (#1743) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](docker/build-push-action@e551b19...1cb9d22) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore: Update makefile (#1770) * remove unused tools, remove incorrect import formatting * uncomment command in makefile * add version matrix (#1767) * add pseudocode to handle empty version string in OnChanOpenInit * fix broken link (#1776) * add item to update the version matrix after a release (#1775) * E2E Test: TestMsgPayPacketFeeSingleSenderTimesOut (#1751) * Move scripts from .github directory into cmd (#1787) Co-authored-by: Charly <charly@interchain.berlin> Co-authored-by: Sean King <sean@seking.dev> Co-authored-by: Sean King <seantking@users.noreply.github.com> Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: Carlos Rodriguez <crodveg@gmail.com> Co-authored-by: Cian Hatton <cian@interchain.io> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: vuong <56973102+vuong177@users.noreply.github.com> Co-authored-by: Aditya <adityasripal@gmail.com> Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com> Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: rene <41963722+renaynay@users.noreply.github.com> Co-authored-by: tmsdkeys <98807841+tmsdkeys@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Description
Should be reviewed after #1646 is mergedThis PR adds the
E2ETestSuite
type. This type has helper functions that interact with theibctest
libraries. All of our test suites should be composed of this type.closes: #1648
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes