gaia
gaia copied to clipboard
Refactor: e2e test
Summary
More e2e tests are added to test different tx/queries for a gaiad chain. the following refactor will be done to improve the code
- [ ] when paying fees, all the tx cli use
--fees
rather than--gas-prices
- [ ] refator
ssubmitLegacyProposalFundGovAccount
tosubmitLegacyProposal
- [ ] refactor
banksend
to includefees
as argument - [ ] tidy up variables in
e2e_setup_test.go
- [ ] refactor
executeGaiaTxCommand
with considerexpectedErr
likewithdrawReward
andsendMsgSend
, so thatwithdrawReward
andsendMsgSend
can also use it. - [ ] pr https://github.com/cosmos/gaia/pull/1652
- [ ] pass fees as argument to
submitNewGovProposal
- [ ] add check err code: 13, insufficient fees.
- [ ] move submit, deposit voteGovProposal to e2e_cli_util.go
- [ ] separate relayer accounts from normal accounts
- [ ] avoid to hardcode the gaia home folder
/home/nonroot/.gaia/config/ica_bank_send.json
- [ ] define consts for all generated json files:
ica_bank_send.json
,proposal.json
etc - [ ] check if all the sleeps in tests are necessary.
Problem Definition
Proposal
For Admin Use
- [ ] Not duplicate issue
- [ ] Appropriate labels applied
- [ ] Appropriate contributors tagged
- [ ] Contributor assigned/self-assigned
- [ ] Is a spike necessary to map out how the issue should be approached?
- [ ] refactor
exeGaiacmd
into pass and fail cases
- [ ] Rename the prefix from helpers methods from
query...
tocheck...
. E.g.func queryGaiaTx(endpoint, txHash string) error
this method does the query in the middle of the method but does not represent a query method returning the response values. - [ ] Create real query methods we can use in the new check methods above.
- [ ] Avoid using
common
,util
,shared
, orlib
as a package or filenames. These are bad, uninformative names.
- [ ] Use subtest (
s.Run("<DESCRIPTION>", func() {}
) for we can tracke better issues; - [ ] Avoid too many global vars. The variable can live in the primary structure;
- [ ] Split libraries into packages. E.g.:
genesis
package should handle genesis logic; - [ ] Too many methods to manipulate the genesis. Tries Manipulate the genesis only one time before launch;
- [ ] Gaiad commands can run locally without exec into the container;
- [ ] Avoid creating extensions to change the current object. E.g.:
initValidatorConfigs
change all states ofIntegrationTestSuite
. Without knowing the code, we cannot know the lifecycle of the vars; - [ ] Split thee2e_util_test.go
file intoe2e_exec_test.go
,e2e_query_test.go
ande2e_ibc_test.go
- [ ] Add the ability to initiate how many chains we need for the tests. We can pass the number of chains we want and store them in a chain slice;
- [ ] Automatically use the other chain API endpoint if we select another chain;
- [ ] Add a map of all reusable global flags to
IntegrationTestSuite
so we can avoid passing values everytime like the home folder for each command; - [ ] Pass the optional flags to the exec method as a variadic variable. E.g., https://github.com/cosmos/gaia/pull/1738/files#diff-fa97566cde4f0e8006578cd218b1986e64bd02b6ff21f6286bd1c2678087cd6cR10-R53;
- [ ] Avoid big functions
- [ ] Avoid too many generic var names for globals. Use consistency in methods naming in the entire project. E.g.:
LoadFile
,LoadImageFromFile
,GenerateFilePeriod
,GetTx
,CheckTx
; - [ ] Parse stderr for TxResponse and throw the error if the code is not zero;
this is outdated.