Add a test network setup and patch for E2E tests (#18)

- The E2E tests sometimes fail with error `timeout exceeded waiting for block` in CI (always passed locally)
- The error occurs in the test network (provided in cosmos-sdk) creation when [waiting](https://github.com/cosmos/cosmos-sdk/blob/v0.50.3/testutil/network/network.go#L622) for the first block because of block timeout being too short ([hardcoded](https://github.com/cosmos/cosmos-sdk/blob/v0.50.3/testutil/network/network.go#L670) to 5s)
- Copy over this network setup in the repo and patch to skip this check; we are waiting for a block to appear after the network creation anyway

Reviewed-on: deep-stack/laconic2d#18
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
2024-03-07 12:35:59 +00:00
committed by ashwin
parent aed2d6d4c6
commit 8c0540bdb5
10 changed files with 1179 additions and 7 deletions
+1 -1
View File
@@ -3,10 +3,10 @@ package auction
import (
"testing"
"github.com/cosmos/cosmos-sdk/testutil/network"
"github.com/stretchr/testify/suite"
"git.vdb.to/cerc-io/laconic2d/tests/e2e"
"git.vdb.to/cerc-io/laconic2d/testutil/network"
)
func TestAuctionE2ETestSuite(t *testing.T) {
+1 -1
View File
@@ -13,9 +13,9 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
"git.vdb.to/cerc-io/laconic2d/testutil/network"
types "git.vdb.to/cerc-io/laconic2d/x/auction"
"git.vdb.to/cerc-io/laconic2d/x/auction/client/cli"
)
+1 -1
View File
@@ -3,10 +3,10 @@ package bond
import (
"testing"
"github.com/cosmos/cosmos-sdk/testutil/network"
"github.com/stretchr/testify/suite"
"git.vdb.to/cerc-io/laconic2d/tests/e2e"
"git.vdb.to/cerc-io/laconic2d/testutil/network"
)
func TestBondE2ETestSuite(t *testing.T) {
+1 -1
View File
@@ -11,9 +11,9 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
"git.vdb.to/cerc-io/laconic2d/testutil/network"
bondtypes "git.vdb.to/cerc-io/laconic2d/x/bond"
"git.vdb.to/cerc-io/laconic2d/x/bond/client/cli"
)
+1 -1
View File
@@ -11,7 +11,6 @@ import (
bam "github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/flags"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/testutil/network"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/x/auth"
@@ -23,6 +22,7 @@ import (
registrymodule "git.vdb.to/cerc-io/laconic2d/x/registry/module"
_ "git.vdb.to/cerc-io/laconic2d/app/params" // import for side-effects (see init)
"git.vdb.to/cerc-io/laconic2d/testutil/network"
)
// NewTestNetworkFixture returns a new LaconicApp AppConstructor for network simulation tests
+1 -1
View File
@@ -3,10 +3,10 @@ package registry
import (
"testing"
"github.com/cosmos/cosmos-sdk/testutil/network"
"github.com/stretchr/testify/suite"
"git.vdb.to/cerc-io/laconic2d/tests/e2e"
"git.vdb.to/cerc-io/laconic2d/testutil/network"
)
func TestRegistryE2ETestSuite(t *testing.T) {
+1 -1
View File
@@ -13,9 +13,9 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
"git.vdb.to/cerc-io/laconic2d/testutil/network"
bondtypes "git.vdb.to/cerc-io/laconic2d/x/bond"
bondcli "git.vdb.to/cerc-io/laconic2d/x/bond/client/cli"
registrytypes "git.vdb.to/cerc-io/laconic2d/x/registry"