test: rename e2e tests (#13913)
This commit is contained in:
@@ -13,8 +13,8 @@ import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
func TestE2ETestSuite(t *testing.T) {
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 2
|
||||
suite.Run(t, NewIntegrationTestSuite(cfg))
|
||||
suite.Run(t, NewE2ETestSuite(cfg))
|
||||
}
|
||||
|
||||
+34
-36
@@ -41,20 +41,19 @@ import (
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
|
||||
)
|
||||
|
||||
type IntegrationTestSuite struct {
|
||||
type E2ETestSuite struct {
|
||||
suite.Suite
|
||||
|
||||
cfg network.Config
|
||||
network *network.Network
|
||||
}
|
||||
|
||||
func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite {
|
||||
return &IntegrationTestSuite{cfg: cfg}
|
||||
func NewE2ETestSuite(cfg network.Config) *E2ETestSuite {
|
||||
return &E2ETestSuite{cfg: cfg}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
|
||||
func (s *E2ETestSuite) SetupSuite() {
|
||||
s.T().Log("setting up e2e test suite")
|
||||
var err error
|
||||
s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg)
|
||||
s.Require().NoError(err)
|
||||
@@ -83,12 +82,12 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.Require().NoError(s.network.WaitForNextBlock())
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TearDownSuite() {
|
||||
s.T().Log("tearing down integration test suite")
|
||||
func (s *E2ETestSuite) TearDownSuite() {
|
||||
s.T().Log("tearing down e2e test suite")
|
||||
s.network.Cleanup()
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLIValidateSignatures() {
|
||||
func (s *E2ETestSuite) TestCLIValidateSignatures() {
|
||||
val := s.network.Validators[0]
|
||||
sendTokens := sdk.NewCoins(
|
||||
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)),
|
||||
@@ -124,7 +123,7 @@ func (s *IntegrationTestSuite) TestCLIValidateSignatures() {
|
||||
s.Require().EqualError(err, "signatures validation failed")
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLISignGenOnly() {
|
||||
func (s *E2ETestSuite) TestCLISignGenOnly() {
|
||||
val := s.network.Validators[0]
|
||||
val2 := s.network.Validators[1]
|
||||
|
||||
@@ -241,7 +240,7 @@ func (s *IntegrationTestSuite) TestCLISignGenOnly() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLISignBatch() {
|
||||
func (s *E2ETestSuite) TestCLISignBatch() {
|
||||
val := s.network.Validators[0]
|
||||
sendTokens := sdk.NewCoins(
|
||||
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)),
|
||||
@@ -328,7 +327,7 @@ func (s *IntegrationTestSuite) TestCLISignBatch() {
|
||||
s.Require().Equal(sigs[0].Sequence, seq1)
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCliGetAccountAddressByID() {
|
||||
func (s *E2ETestSuite) TestCliGetAccountAddressByID() {
|
||||
require := s.Require()
|
||||
val1 := s.network.Validators[0]
|
||||
testCases := []struct {
|
||||
@@ -372,7 +371,7 @@ func (s *IntegrationTestSuite) TestCliGetAccountAddressByID() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLISignAminoJSON() {
|
||||
func (s *E2ETestSuite) TestCLISignAminoJSON() {
|
||||
require := s.Require()
|
||||
val1 := s.network.Validators[0]
|
||||
txCfg := val1.ClientCtx.TxConfig
|
||||
@@ -474,7 +473,7 @@ func checkSignatures(require *require.Assertions, txCfg client.TxConfig, output
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLIQueryTxCmdByHash() {
|
||||
func (s *E2ETestSuite) TestCLIQueryTxCmdByHash() {
|
||||
val := s.network.Validators[0]
|
||||
|
||||
account2, err := val.ClientCtx.Keyring.Key("newAccount2")
|
||||
@@ -546,7 +545,7 @@ func (s *IntegrationTestSuite) TestCLIQueryTxCmdByHash() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLIQueryTxCmdByEvents() {
|
||||
func (s *E2ETestSuite) TestCLIQueryTxCmdByEvents() {
|
||||
val := s.network.Validators[0]
|
||||
|
||||
account2, err := val.ClientCtx.Keyring.Key("newAccount2")
|
||||
@@ -663,7 +662,7 @@ func (s *IntegrationTestSuite) TestCLIQueryTxCmdByEvents() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLIQueryTxsCmdByEvents() {
|
||||
func (s *E2ETestSuite) TestCLIQueryTxsCmdByEvents() {
|
||||
val := s.network.Validators[0]
|
||||
|
||||
account2, err := val.ClientCtx.Keyring.Key("newAccount2")
|
||||
@@ -736,7 +735,7 @@ func (s *IntegrationTestSuite) TestCLIQueryTxsCmdByEvents() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLISendGenerateSignAndBroadcast() {
|
||||
func (s *E2ETestSuite) TestCLISendGenerateSignAndBroadcast() {
|
||||
val1 := s.network.Validators[0]
|
||||
|
||||
account, err := val1.ClientCtx.Keyring.Key("newAccount")
|
||||
@@ -880,7 +879,7 @@ func (s *IntegrationTestSuite) TestCLISendGenerateSignAndBroadcast() {
|
||||
s.Require().NoError(err)
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLIMultisignInsufficientCosigners() {
|
||||
func (s *E2ETestSuite) TestCLIMultisignInsufficientCosigners() {
|
||||
val1 := s.network.Validators[0]
|
||||
|
||||
// Fetch account and a multisig info
|
||||
@@ -943,7 +942,7 @@ func (s *IntegrationTestSuite) TestCLIMultisignInsufficientCosigners() {
|
||||
s.Require().Error(err)
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLIEncode() {
|
||||
func (s *E2ETestSuite) TestCLIEncode() {
|
||||
val1 := s.network.Validators[0]
|
||||
|
||||
sendTokens := sdk.NewCoin(s.cfg.BondDenom, sdk.TokensFromConsensusPower(10, sdk.DefaultPowerReduction))
|
||||
@@ -975,7 +974,7 @@ func (s *IntegrationTestSuite) TestCLIEncode() {
|
||||
s.Require().Equal("deadbeef", txBuilder.GetTx().GetMemo())
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLIMultisignSortSignatures() {
|
||||
func (s *E2ETestSuite) TestCLIMultisignSortSignatures() {
|
||||
val1 := s.network.Validators[0]
|
||||
|
||||
// Generate 2 accounts and a multisig.
|
||||
@@ -1002,7 +1001,6 @@ func (s *IntegrationTestSuite) TestCLIMultisignSortSignatures() {
|
||||
s.Require().NoError(err)
|
||||
intialCoins := balRes.Balances
|
||||
|
||||
s.Require().NoError(s.network.WaitForNextBlock())
|
||||
// Send coins from validator to multisig.
|
||||
sendTokens := sdk.NewInt64Coin(s.cfg.BondDenom, 10)
|
||||
_, err = s.createBankMsg(
|
||||
@@ -1083,7 +1081,7 @@ func (s *IntegrationTestSuite) TestCLIMultisignSortSignatures() {
|
||||
s.Require().NoError(s.network.WaitForNextBlock())
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestSignWithMultisig() {
|
||||
func (s *E2ETestSuite) TestSignWithMultisig() {
|
||||
val1 := s.network.Validators[0]
|
||||
|
||||
// Generate a account for signing.
|
||||
@@ -1125,7 +1123,7 @@ func (s *IntegrationTestSuite) TestSignWithMultisig() {
|
||||
s.Require().Contains(err.Error(), "error getting account from keybase")
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLIMultisign() {
|
||||
func (s *E2ETestSuite) TestCLIMultisign() {
|
||||
val1 := s.network.Validators[0]
|
||||
|
||||
// Generate 2 accounts and a multisig.
|
||||
@@ -1219,7 +1217,7 @@ func (s *IntegrationTestSuite) TestCLIMultisign() {
|
||||
s.Require().NoError(s.network.WaitForNextBlock())
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestSignBatchMultisig() {
|
||||
func (s *E2ETestSuite) TestSignBatchMultisig() {
|
||||
val := s.network.Validators[0]
|
||||
|
||||
// Fetch 2 accounts and a multisig.
|
||||
@@ -1284,7 +1282,7 @@ func (s *IntegrationTestSuite) TestSignBatchMultisig() {
|
||||
s.Require().NoError(err)
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestMultisignBatch() {
|
||||
func (s *E2ETestSuite) TestMultisignBatch() {
|
||||
val := s.network.Validators[0]
|
||||
|
||||
// Fetch 2 accounts and a multisig.
|
||||
@@ -1368,7 +1366,7 @@ func (s *IntegrationTestSuite) TestMultisignBatch() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestGetAccountCmd() {
|
||||
func (s *E2ETestSuite) TestGetAccountCmd() {
|
||||
val := s.network.Validators[0]
|
||||
_, _, addr1 := testdata.KeyTestPubAddr()
|
||||
|
||||
@@ -1407,7 +1405,7 @@ func (s *IntegrationTestSuite) TestGetAccountCmd() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestGetAccountsCmd() {
|
||||
func (s *E2ETestSuite) TestGetAccountsCmd() {
|
||||
val := s.network.Validators[0]
|
||||
clientCtx := val.ClientCtx
|
||||
|
||||
@@ -1421,7 +1419,7 @@ func (s *IntegrationTestSuite) TestGetAccountsCmd() {
|
||||
s.Require().NotEmpty(res.Accounts)
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestQueryModuleAccountByNameCmd() {
|
||||
func (s *E2ETestSuite) TestQueryModuleAccountByNameCmd() {
|
||||
val := s.network.Validators[0]
|
||||
|
||||
testCases := []struct {
|
||||
@@ -1469,7 +1467,7 @@ func (s *IntegrationTestSuite) TestQueryModuleAccountByNameCmd() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestQueryModuleAccountsCmd() {
|
||||
func (s *E2ETestSuite) TestQueryModuleAccountsCmd() {
|
||||
val := s.network.Validators[0]
|
||||
clientCtx := val.ClientCtx
|
||||
|
||||
@@ -1525,7 +1523,7 @@ func TestGetBroadcastCommandWithoutOfflineFlag(t *testing.T) {
|
||||
require.Contains(t, out.String(), "connect: connection refused")
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestQueryParamsCmd() {
|
||||
func (s *E2ETestSuite) TestQueryParamsCmd() {
|
||||
val := s.network.Validators[0]
|
||||
|
||||
testCases := []struct {
|
||||
@@ -1567,7 +1565,7 @@ func (s *IntegrationTestSuite) TestQueryParamsCmd() {
|
||||
// TestTxWithoutPublicKey makes sure sending a proto tx message without the
|
||||
// public key doesn't cause any error in the RPC layer (broadcast).
|
||||
// See https://github.com/cosmos/cosmos-sdk/issues/7585 for more details.
|
||||
func (s *IntegrationTestSuite) TestTxWithoutPublicKey() {
|
||||
func (s *E2ETestSuite) TestTxWithoutPublicKey() {
|
||||
val1 := s.network.Validators[0]
|
||||
txCfg := val1.ClientCtx.TxConfig
|
||||
|
||||
@@ -1628,7 +1626,7 @@ func (s *IntegrationTestSuite) TestTxWithoutPublicKey() {
|
||||
// messages which has to be signed with 2 different keys. Sign and append the
|
||||
// signatures using the CLI with Amino signing mode. Finally, send the
|
||||
// transaction to the blockchain.
|
||||
func (s *IntegrationTestSuite) TestSignWithMultiSignersAminoJSON() {
|
||||
func (s *E2ETestSuite) TestSignWithMultiSignersAminoJSON() {
|
||||
require := s.Require()
|
||||
val0, val1 := s.network.Validators[0], s.network.Validators[1]
|
||||
val0Coin := sdk.NewCoin(fmt.Sprintf("%stoken", val0.Moniker), sdk.NewInt(10))
|
||||
@@ -1699,7 +1697,7 @@ func (s *IntegrationTestSuite) TestSignWithMultiSignersAminoJSON() {
|
||||
require.Equal(sdk.NewCoins(val0Coin, val1Coin), queryRes.Balances)
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestAuxSigner() {
|
||||
func (s *E2ETestSuite) TestAuxSigner() {
|
||||
require := s.Require()
|
||||
val := s.network.Validators[0]
|
||||
val0Coin := sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10))
|
||||
@@ -1755,7 +1753,7 @@ func (s *IntegrationTestSuite) TestAuxSigner() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestAuxToFeeWithTips() {
|
||||
func (s *E2ETestSuite) TestAuxToFeeWithTips() {
|
||||
// Skipping this test as it needs a simapp with the TipDecorator in post handler.
|
||||
s.T().Skip()
|
||||
|
||||
@@ -2014,7 +2012,7 @@ func (s *IntegrationTestSuite) TestAuxToFeeWithTips() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) createBankMsg(val *network.Validator, toAddr sdk.AccAddress, amount sdk.Coins, extraFlags ...string) (testutil.BufferWriter, error) {
|
||||
func (s *E2ETestSuite) createBankMsg(val *network.Validator, toAddr sdk.AccAddress, amount sdk.Coins, extraFlags ...string) (testutil.BufferWriter, error) {
|
||||
flags := []string{
|
||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
|
||||
@@ -2026,7 +2024,7 @@ func (s *IntegrationTestSuite) createBankMsg(val *network.Validator, toAddr sdk.
|
||||
return clitestutil.MsgSendExec(val.ClientCtx, val.Address, toAddr, amount, flags...)
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) getBalances(clientCtx client.Context, addr sdk.AccAddress, denom string) math.Int {
|
||||
func (s *E2ETestSuite) getBalances(clientCtx client.Context, addr sdk.AccAddress, denom string) math.Int {
|
||||
resp, err := clitestutil.QueryBalancesExec(clientCtx, addr)
|
||||
s.Require().NoError(err)
|
||||
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
)
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
func TestE2ETestSuite(t *testing.T) {
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
suite.Run(t, NewIntegrationTestSuite(cfg))
|
||||
suite.Run(t, NewE2ETestSuite(cfg))
|
||||
}
|
||||
@@ -13,19 +13,19 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli"
|
||||
)
|
||||
|
||||
type IntegrationTestSuite struct {
|
||||
type E2ETestSuite struct {
|
||||
suite.Suite
|
||||
|
||||
cfg network.Config
|
||||
network *network.Network
|
||||
}
|
||||
|
||||
func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite {
|
||||
return &IntegrationTestSuite{cfg: cfg}
|
||||
func NewE2ETestSuite(cfg network.Config) *E2ETestSuite {
|
||||
return &E2ETestSuite{cfg: cfg}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
func (s *E2ETestSuite) SetupSuite() {
|
||||
s.T().Log("setting up e2e test suite")
|
||||
|
||||
var err error
|
||||
s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg)
|
||||
@@ -33,12 +33,12 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.Require().NoError(s.network.WaitForNextBlock())
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TearDownSuite() {
|
||||
s.T().Log("tearing down integration test suite")
|
||||
func (s *E2ETestSuite) TearDownSuite() {
|
||||
s.T().Log("tearing down e2e test suite")
|
||||
s.network.Cleanup()
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() {
|
||||
func (s *E2ETestSuite) TestNewMsgCreateVestingAccountCmd() {
|
||||
val := s.network.Validators[0]
|
||||
|
||||
testCases := map[string]struct {
|
||||
@@ -145,7 +145,7 @@ func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestNewMsgCreatePermanentLockedAccountCmd() {
|
||||
func (s *E2ETestSuite) TestNewMsgCreatePermanentLockedAccountCmd() {
|
||||
val := s.network.Validators[0]
|
||||
|
||||
testCases := map[string]struct {
|
||||
Reference in New Issue
Block a user