Skip to content

Commit

Permalink
add test wasm gas less
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Dec 20, 2024
1 parent 299ad13 commit 31fee6e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 67 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/interchaintest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,20 @@ jobs:
uses: actions/checkout@v4

- run: make ictest-ibchooks
env:
BRANCH_CI: "latest"
ictest-wasm-gasless:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22.7'

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-wasm-gasless
env:
BRANCH_CI: "latest"
3 changes: 2 additions & 1 deletion .github/workflows/sims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ jobs:
go-version: "1.22.7"
check-latest: true
- name: test-sim-multi-seed-short
run: make test-sim-multi-seed-short
run: |
make test-sim-multi-seed-short
65 changes: 2 additions & 63 deletions tests/interchaintest/ibc_hooks_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package interchaintest

import (
"context"
"fmt"
"testing"

Expand All @@ -11,11 +10,8 @@ import (
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/relayer"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

// TestStartOrai is a basic test to assert that spinning up a Orai network with 1 validator works properly.
Expand All @@ -25,66 +21,9 @@ func TestIbcHooks(t *testing.T) {
}

t.Parallel()

ctx := context.Background()

numVals := 1
numFullNodes := 1

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
{
Name: "orai",
ChainConfig: oraiConfig,
NumValidators: &numVals,
NumFullNodes: &numFullNodes,
},
{
Name: "gaia",
Version: GaiaImageVersion,
NumValidators: &numVals,
NumFullNodes: &numFullNodes,
},
})

// Get chains from the chain factory
chains, err := cf.Chains(t.Name())
require.NoError(t, err)

chains := CreateChains(t, 1, 1)
orai, gaia := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain)

// Create relayer factory to utilize the go-relayer
client, network := interchaintest.DockerSetup(t)
r := interchaintest.NewBuiltinRelayerFactory(
ibc.CosmosRly,
zaptest.NewLogger(t),
relayer.CustomDockerImage(IBCRelayerImage, IBCRelayerVersion, "100:1000"),
).Build(t, client, network)

ic := interchaintest.NewInterchain().
AddChain(orai).
AddChain(gaia).
AddRelayer(r, "rly").
AddLink(interchaintest.InterchainLink{
Chain1: orai,
Chain2: gaia,
Relayer: r,
Path: pathOraiGaia,
})

rep := testreporter.NewNopReporter()
eRep := rep.RelayerExecReporter(t)

err = ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{
TestName: t.Name(),
Client: client,
NetworkID: network,
SkipPathCreation: false,

// This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc.
// BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(),
})
require.NoError(t, err)

ic, r, ctx, _, eRep, _ := BuildInitialChain(t, chains)
t.Cleanup(func() {
_ = ic.Close()
})
Expand Down
4 changes: 2 additions & 2 deletions tests/interchaintest/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func BuildInitialChainNoIbc(t *testing.T, chain ibc.Chain) (*interchaintest.Inte
return ic, ctx
}

func BuildInitialChain(t *testing.T, chains []ibc.Chain) (*interchaintest.Interchain, ibc.Relayer, context.Context, *client.Client, string) {
func BuildInitialChain(t *testing.T, chains []ibc.Chain) (*interchaintest.Interchain, ibc.Relayer, context.Context, *client.Client, *testreporter.RelayerExecReporter, string) {
// Create a new Interchain object which describes the chains, relayers, and IBC connections we want to use
require.Equal(t, len(chains), 2) // we only initial 2 chain for now
ic := interchaintest.NewInterchain()
Expand Down Expand Up @@ -228,5 +228,5 @@ func BuildInitialChain(t *testing.T, chains []ibc.Chain) (*interchaintest.Interc
})
require.NoError(t, err)

return ic, r, ctx, client, network
return ic, r, ctx, client, eRep, network
}
2 changes: 1 addition & 1 deletion tests/interchaintest/tokenfactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestTokenfactoryParamChange(t *testing.T) {
t.Parallel()
chains := CreateChains(t, 1, 1)
orai := chains[0].(*cosmos.CosmosChain)
ic, _, ctx, _, _ := BuildInitialChain(t, chains)
ic, _, ctx, _, _, _ := BuildInitialChain(t, chains)
t.Cleanup(func() {
_ = ic.Close()
})
Expand Down

0 comments on commit 31fee6e

Please sign in to comment.