mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 08:15:19 +00:00
6a7fd4c8bd
* downgrade to ibc v7 for ibc tests * add conformance test (does not pass consistently) * limit number of nodes for more consistent passing * update to upstream v7 branch of interchaintest also, remove unnecessary go.mod replace statements * better names for int pointers
60 lines
1.8 KiB
Go
60 lines
1.8 KiB
Go
package main_test
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
|
|
"go.uber.org/zap/zaptest"
|
|
|
|
"github.com/strangelove-ventures/interchaintest/v7"
|
|
"github.com/strangelove-ventures/interchaintest/v7/conformance"
|
|
"github.com/strangelove-ventures/interchaintest/v7/ibc"
|
|
"github.com/strangelove-ventures/interchaintest/v7/testreporter"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
kavainterchain "github.com/kava-labs/kava/tests/interchain"
|
|
)
|
|
|
|
var (
|
|
numFullNodes = 0
|
|
numValidators = 1
|
|
)
|
|
|
|
func TestIbcConformance(t *testing.T) {
|
|
// t.Skip("skipping conformance test")
|
|
|
|
ctx := context.Background()
|
|
|
|
// setup chain factories: must be exactly two chains to run conformance between
|
|
cfs := make([]interchaintest.ChainFactory, 0)
|
|
cfs = append(cfs,
|
|
interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
|
|
{
|
|
Name: "kava",
|
|
ChainConfig: kavainterchain.DefaultKavaChainConfig(kavainterchain.KavaTestChainId),
|
|
// override default number of nodes to limit the number of ports we need to bind to
|
|
// running conformance tests without these limits result in errors that look like
|
|
// tendermint rpc client status: post failed: Post "http://127.0.0.1:<port>": dial tcp 127.0.0.1:<port>: connect: can't assign requested address
|
|
NumValidators: &numValidators,
|
|
NumFullNodes: &numFullNodes,
|
|
},
|
|
{Name: "osmosis", Version: "v24.0.1", NumValidators: &numValidators, NumFullNodes: &numFullNodes},
|
|
}),
|
|
)
|
|
|
|
// setup relayer factory
|
|
rfs := make([]interchaintest.RelayerFactory, 0)
|
|
rfs = append(rfs,
|
|
interchaintest.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t)),
|
|
)
|
|
|
|
// test reporter
|
|
f, err := interchaintest.CreateLogFile(fmt.Sprintf("%d.json", time.Now().Unix()))
|
|
require.NoError(t, err)
|
|
rep := testreporter.NewReporter(f)
|
|
|
|
conformance.Test(t, ctx, cfs, rfs, rep)
|
|
}
|