Skip to content

Commit 618a409

Browse files
e2e: Create only required number of chains. (#8371)
* sync deps * feat: create only necessary chains * updated changelog * feat: default chain setings * fix: missing tags for chain C and D * test * chore: remove e2e fork and draft restrictions (#8359) * bump wasmvm to v2.2.4, go-etheruem to v1.15.11, spf13/cast to v1.8.0 (#8369) * sync deps * bump wasmvm to v2.2.4, go-etheruem to v1.15.11, spf13/cast to v1.8.0 (#8369) * sync deps * bump wasmvm to v2.2.4, go-etheruem to v1.15.11, spf13/cast to v1.8.0 (#8369) * fix dep * sync dep * fix missing tags for C and D * remove comments --------- Signed-off-by: tamjidahmed <mail.to.tamjid@gmail.com> Co-authored-by: Gjermund Garaba <gjermund@garaba.net>
1 parent 3cfc3f6 commit 618a409

File tree

28 files changed

+184
-84
lines changed

28 files changed

+184
-84
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
5353
### Bug Fixes
5454

5555
### Testing API
56+
* [\#8371](https://github.com/cosmos/ibc-go/pull/8371) e2e: Create only necessary number of chains for e2e suite.
5657

5758
## [v10.2.0](https://github.com/cosmos/ibc-go/releases/tag/v10.2.0) - 2022-04-30
5859

e2e/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ running tests locally via `make test`. For an example of this, see any of the ex
5959
New test suites should be composed of `testsuite.E2ETestSuite`. This type has lots of useful helper functionality that will
6060
be quite common in most tests.
6161

62+
Override the default `SetupSuite` function with the number of chains required for the suite. Example:
63+
64+
```go
65+
// SetupSuite sets up chains for the current test suite
66+
func (s *ConnectionTestSuite) SetupSuite() {
67+
s.SetupChains(context.TODO(), 2, nil) // This suite requires at most two chains.
68+
}
69+
```
70+
6271
> Note: see [here](#how-tests-are-run) for details about these requirements.
6372
6473
### Example of running a single test

e2e/ci-e2e-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# | CHAIN_IMAGE | The image that will be used for the chain | ghcr.io/cosmos/ibc-go-simd |
88
# | CHAIN_A_TAG | The tag used for chain A | N/A (must be set) |
99
# | CHAIN_B_TAG | The tag used for chain B | N/A (must be set) |
10-
# | CHAIN_C_TAG | The tag used for chain C | N/A (must be set) |
11-
# | CHAIN_D_TAG | The tag used for chain D | N/A (must be set) |
10+
# | CHAIN_C_TAG | The tag used for chain C | N/A (optional; fallback to A)|
11+
# | CHAIN_D_TAG | The tag used for chain D | N/A (optional; fallback to A)|
1212
# | CHAIN_BINARY | The binary used in the container | simd |
1313
# | RELAYER_TAG | The tag used for the relayer | 1.10.4 |
1414
# | RELAYER_ID | The type of relayer to use (rly/hermes) | hermes |

e2e/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ require (
5353
filippo.io/edwards25519 v1.1.0 // indirect
5454
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
5555
github.com/99designs/keyring v1.2.2 // indirect
56-
github.com/BurntSushi/toml v1.4.0 // indirect
56+
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
5757
github.com/CosmWasm/wasmvm/v2 v2.2.4 // indirect
5858
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
5959
github.com/DataDog/zstd v1.5.7 // indirect
@@ -127,7 +127,7 @@ require (
127127
github.com/google/flatbuffers v24.3.25+incompatible // indirect
128128
github.com/google/go-cmp v0.7.0 // indirect
129129
github.com/google/orderedcode v0.0.1 // indirect
130-
github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect
130+
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
131131
github.com/google/s2a-go v0.1.9 // indirect
132132
github.com/google/uuid v1.6.0 // indirect
133133
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect

e2e/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,8 @@ github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCk
731731
github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
732732
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
733733
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
734-
github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U=
735-
github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
734+
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
735+
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
736736
github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c=
737737
github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE=
738738
github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw=

e2e/tests/core/02-client/client_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ func (s *ClientTestSuite) QueryAllowedClients(ctx context.Context, chain ibc.Cha
6161
return res.Params.AllowedClients
6262
}
6363

64+
// SetupSuite sets up chains for the current test suite
65+
func (s *ClientTestSuite) SetupSuite() {
66+
s.SetupChains(context.TODO(), 2, nil)
67+
}
68+
6469
// TestScheduleIBCUpgrade_Succeeds tests that a governance proposal to schedule an IBC software upgrade is successful.
6570
// compatibility:TestScheduleIBCUpgrade_Succeeds:from_versions: v8.7.0,v10.0.0
6671
func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() {

e2e/tests/core/03-connection/connection_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ type ConnectionTestSuite struct {
3434
testsuite.E2ETestSuite
3535
}
3636

37+
// SetupSuite sets up chains for the current test suite
38+
func (s *ConnectionTestSuite) SetupSuite() {
39+
s.SetupChains(context.TODO(), 2, nil)
40+
}
41+
3742
func (s *ConnectionTestSuite) CreateConnectionTestPath(testName string) (ibc.Relayer, ibc.ChannelOutput) {
3843
return s.CreatePaths(ibc.DefaultClientOpts(), s.TransferChannelOptions(), testName), s.GetChainAToChainBChannel(testName)
3944
}

e2e/tests/interchain_accounts/base_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ type InterchainAccountsTestSuite struct {
4545
testsuite.E2ETestSuite
4646
}
4747

48+
// SetupSuite sets up chains for the current test suite
49+
func (s *InterchainAccountsTestSuite) SetupSuite() {
50+
s.SetupChains(context.TODO(), 2, nil)
51+
}
52+
4853
// RegisterInterchainAccount will attempt to register an interchain account on the counterparty chain.
4954
func (s *InterchainAccountsTestSuite) RegisterInterchainAccount(ctx context.Context, chain ibc.Chain, user ibc.Wallet, msgRegisterAccount *controllertypes.MsgRegisterInterchainAccount) {
5055
txResp := s.BroadcastMessages(ctx, chain, user, msgRegisterAccount)

e2e/tests/interchain_accounts/gov_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ type InterchainAccountsGovTestSuite struct {
3737
testsuite.E2ETestSuite
3838
}
3939

40+
// SetupSuite sets up chains for the current test suite
41+
func (s *InterchainAccountsGovTestSuite) SetupSuite() {
42+
s.SetupChains(context.TODO(), 2, nil)
43+
}
44+
4045
func (s *InterchainAccountsGovTestSuite) TestInterchainAccountsGovIntegration() {
4146
t := s.T()
4247
ctx := context.TODO()

e2e/tests/interchain_accounts/groups_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ type InterchainAccountsGroupsTestSuite struct {
6868
testsuite.E2ETestSuite
6969
}
7070

71+
// SetupSuite sets up chains for the current test suite
72+
func (s *InterchainAccountsGroupsTestSuite) SetupSuite() {
73+
s.SetupChains(context.TODO(), 2, nil)
74+
}
75+
7176
func (s *InterchainAccountsGroupsTestSuite) QueryGroupPolicyAddress(ctx context.Context, chain ibc.Chain) string {
7277
res, err := query.GRPCQuery[grouptypes.QueryGroupPoliciesByGroupResponse](ctx, chain, &grouptypes.QueryGroupPoliciesByGroupRequest{
7378
GroupId: InitialGroupID, // always use the initial group id

0 commit comments

Comments
 (0)