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

Make integration test suites reusable by apps #6711

Merged
merged 49 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
818400a
WIP on refactoring new integration tests.
aaronc Jul 13, 2020
3f0ad0a
godocs
aaronc Jul 13, 2020
ed3a63c
godocs
aaronc Jul 13, 2020
6439e0a
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into aa…
aaronc Jul 17, 2020
049d857
Fix ineff assign
aaronc Jul 17, 2020
fc68fb7
Merge branch 'master' into aaronc/6423-refactor
aaronc Jul 17, 2020
61d5e58
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into aa…
aaronc Oct 21, 2020
4542729
Updates
aaronc Oct 21, 2020
75c66b3
Updates
aaronc Oct 21, 2020
1ebcb8a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into aaronc/642…
atheeshp Nov 19, 2020
bd85bbe
fix test
atheeshp Nov 19, 2020
285613b
Merge branch 'master' of github.com:cosmos/cosmos-sdk into aaronc/642…
atheeshp Mar 30, 2021
58fe735
Merge branch 'master' of github.com:cosmos/cosmos-sdk into aaronc/642…
atheeshp Mar 30, 2021
3fa0933
refactor crisis, distr testsuites
atheeshp Mar 30, 2021
6aedb8e
fix import issue
atheeshp Mar 30, 2021
62fb975
Merge branch 'master' of github.com:cosmos/cosmos-sdk into aaronc/642…
atheeshp Mar 31, 2021
8160bd7
refactor x/auth
atheeshp Mar 31, 2021
1819581
refactor x/authz
atheeshp Mar 31, 2021
4e41864
refactor x/evidence
atheeshp Mar 31, 2021
6e629cc
refactor x/feegrant
atheeshp Mar 31, 2021
bf54933
refactor x/genutil
atheeshp Mar 31, 2021
aa6491c
refactor x/gov
atheeshp Mar 31, 2021
383dbe8
refactor x/mint
atheeshp Mar 31, 2021
7adfb8f
refactor x/params
atheeshp Mar 31, 2021
2574813
refactor x/{auth_vesting, slashing, staking}
atheeshp Mar 31, 2021
5ef53f8
fix lint
atheeshp Mar 31, 2021
041f09f
Merge branch 'master' of github.com:cosmos/cosmos-sdk into aaronc/642…
atheeshp Mar 31, 2021
1c71ffd
fix tests & lint
atheeshp Mar 31, 2021
ed3427a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into aaronc/642…
atheeshp Mar 31, 2021
f3b03c2
fix lint
atheeshp Mar 31, 2021
a35f929
fix tests
atheeshp Apr 1, 2021
27e3b7a
lint
atheeshp Apr 1, 2021
2a0e510
lint
atheeshp Apr 1, 2021
144828a
fix lint memory
atheeshp Apr 1, 2021
a6e3ca2
add missing `norace` build flag
atheeshp Apr 2, 2021
f6c3d19
Merge branch 'master' of github.com:cosmos/cosmos-sdk into aaronc/642…
atheeshp Apr 5, 2021
a6bce03
Merge branch 'master' into aaronc/6423-refactor
atheeshp Apr 5, 2021
85a3bd4
Merge branch 'master' into aaronc/6423-refactor
atheeshp Apr 6, 2021
73810b9
Merge branch 'aaronc/6423-refactor' of github.com:cosmos/cosmos-sdk i…
atheeshp Apr 7, 2021
b18f331
Merge branch 'master' of github.com:cosmos/cosmos-sdk into aaronc/642…
atheeshp Apr 7, 2021
68de88c
Merge branch 'master' of github.com:cosmos/cosmos-sdk into aaronc/642…
atheeshp Apr 15, 2021
713a3fe
update feegrant cfg
atheeshp Apr 15, 2021
ed174c1
fix lint
atheeshp Apr 15, 2021
2920179
Merge branch 'master' into aaronc/6423-refactor
atheeshp Apr 16, 2021
8a8fb16
Merge branch 'master' into aaronc/6423-refactor
atheeshp Apr 19, 2021
82d90c2
Merge branch 'master' into aaronc/6423-refactor
atheeshp Apr 20, 2021
feaf4fd
Merge branch 'master' into aaronc/6423-refactor
atheeshp Apr 22, 2021
0f1249d
Merge branch 'master' into aaronc/6423-refactor
atheeshp Apr 22, 2021
dcccac7
Merge branch 'master' into aaronc/6423-refactor
atheeshp Apr 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions x/auth/client/testutil/cli_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// +build norace

package testutil

import (
"testing"

"github.com/cosmos/cosmos-sdk/testutil/network"

"github.com/stretchr/testify/suite"
)

func TestIntegrationTestSuite(t *testing.T) {
cfg := network.DefaultConfig()
cfg.NumValidators = 2
suite.Run(t, NewIntegrationTestSuite(cfg))
}
137 changes: 67 additions & 70 deletions x/auth/client/cli/cli_test.go → x/auth/client/testutil/suite.go

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions x/auth/vesting/client/testutil/cli_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// +build norace

package testutil

import (
"testing"

"github.com/cosmos/cosmos-sdk/testutil/network"

"github.com/stretchr/testify/suite"
)

func TestIntegrationTestSuite(t *testing.T) {
cfg := network.DefaultConfig()
cfg.NumValidators = 1
suite.Run(t, NewIntegrationTestSuite(cfg))
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// +build norace

package cli_test
package testutil

import (
"fmt"
"testing"

"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/suite"
Expand All @@ -23,14 +20,14 @@ type IntegrationTestSuite struct {
network *network.Network
}

func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite {
return &IntegrationTestSuite{cfg: cfg}
}

func (s *IntegrationTestSuite) SetupSuite() {
s.T().Log("setting up integration test suite")

cfg := network.DefaultConfig()
cfg.NumValidators = 1

s.cfg = cfg
s.network = network.New(s.T(), cfg)
s.network = network.New(s.T(), s.cfg)

_, err := s.network.WaitForHeight(1)
s.Require().NoError(err)
Expand All @@ -47,8 +44,8 @@ func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() {
testCases := map[string]struct {
args []string
expectErr bool
respType proto.Message
expectedCode uint32
respType proto.Message
}{
"create a continuous vesting account": {
args: []string{
Expand All @@ -61,8 +58,8 @@ func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() {
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
},
expectErr: false,
respType: &sdk.TxResponse{},
expectedCode: 0,
respType: &sdk.TxResponse{},
},
"create a delayed vesting account": {
args: []string{
Expand All @@ -76,8 +73,8 @@ func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() {
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
},
expectErr: false,
respType: &sdk.TxResponse{},
expectedCode: 0,
respType: &sdk.TxResponse{},
},
"invalid address": {
args: []string{
Expand All @@ -87,8 +84,8 @@ func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() {
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
},
expectErr: true,
respType: &sdk.TxResponse{},
expectedCode: 0,
respType: &sdk.TxResponse{},
},
"invalid coins": {
args: []string{
Expand All @@ -98,8 +95,8 @@ func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() {
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
},
expectErr: true,
respType: &sdk.TxResponse{},
expectedCode: 0,
respType: &sdk.TxResponse{},
},
"invalid end time": {
args: []string{
Expand All @@ -109,8 +106,8 @@ func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() {
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
},
expectErr: true,
respType: &sdk.TxResponse{},
expectedCode: 0,
respType: &sdk.TxResponse{},
},
}

Expand All @@ -133,7 +130,3 @@ func (s *IntegrationTestSuite) TestNewMsgCreateVestingAccountCmd() {
})
}
}

func TestIntegrationTestSuite(t *testing.T) {
suite.Run(t, new(IntegrationTestSuite))
}
17 changes: 17 additions & 0 deletions x/authz/client/testutil/cli_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// +build norace

package testutil

import (
"testing"

"github.com/cosmos/cosmos-sdk/testutil/network"

"github.com/stretchr/testify/suite"
)

func TestIntegrationTestSuite(t *testing.T) {
cfg := network.DefaultConfig()
cfg.NumValidators = 1
suite.Run(t, NewIntegrationTestSuite(cfg))
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// +build norace
Copy link
Contributor

Choose a reason for hiding this comment

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

This might break race detection


package cli_test
package testutil

import (
"fmt"
Expand All @@ -14,7 +12,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/authz/client/cli"

authztestutil "github.com/cosmos/cosmos-sdk/x/authz/client/testutil"
"github.com/cosmos/cosmos-sdk/x/authz/types"
)

Expand All @@ -24,7 +21,7 @@ func (s *IntegrationTestSuite) TestQueryAuthorizations() {
grantee := s.grantee
twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix()

_, err := authztestutil.ExecGrantAuthorization(
_, err := ExecGrantAuthorization(
val,
[]string{
grantee.String(),
Expand Down Expand Up @@ -102,7 +99,7 @@ func (s *IntegrationTestSuite) TestQueryAuthorization() {
grantee := s.grantee
twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix()

_, err := authztestutil.ExecGrantAuthorization(
_, err := ExecGrantAuthorization(
val,
[]string{
grantee.String(),
Expand Down
Loading