0g-chain/tests/e2e-ibc/conformance_test.go
Robert Pirtle 6a7fd4c8bd
test(e2e-ibc): downgrade to ibc v7 for ibc tests (#1901)
* 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
2024-05-07 13:15:38 -07:00

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)
}