Skip to content

Commit

Permalink
adding TestChainStart interchaintest
Browse files Browse the repository at this point in the history
  • Loading branch information
spoo-bar committed Jun 7, 2024
1 parent 694dc3f commit a231b83
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/interchaintest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,42 @@ jobs:
cd interchaintest
go test -v -race -run TestChainUpgrade
run_chain_start:
name: Run chain start test
needs: [build_images]
runs-on: ubuntu-latest

steps:
- name: Checkout archway-network/archway/interchaintest
uses: actions/checkout@v3
with:
fetch-depth: 0
sparse-checkout: interchaintest

- name: Setup up Golang
uses: actions/setup-go@v4
with:
go-version-file: 'interchaintest/go.mod'

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Download current image
uses: actions/download-artifact@v3
with:
name: action_image_artifact_archway_local

- name: Load current image
run: docker load --input archway_local

- name: Run interchain transactions test
run: |
cd interchaintest
go test -v -race -run TestChainStart
ibc_conformance_tests:
name: Gaia <> Archway Conformance
needs: [build_images]
needs: [build_images, run_chain_start]
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -144,7 +177,7 @@ jobs:
cwica_tests:
name: Interchain transactions test
needs: [build_images]
needs: [build_images, run_chain_start]
runs-on: ubuntu-latest

steps:
Expand Down
25 changes: 25 additions & 0 deletions interchaintest/chain_start_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package interchaintest

import (
"context"
"testing"
"time"

"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"
)

func TestChainStart(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}

archwayChain, _, ctx := startChain(t, "local")

timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*45)
defer timeoutCtxCancel()

// just wait for 10 blocks to be produced
err := testutil.WaitForBlocks(timeoutCtx, 10, archwayChain)
require.NoError(t, err, "chain did not produce blocks")
}
2 changes: 1 addition & 1 deletion interchaintest/chain_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func fundChainUser(t *testing.T, ctx context.Context, archwayChain *cosmos.Cosmo

func startChain(t *testing.T, startingVersion string) (*cosmos.CosmosChain, *client.Client, context.Context) {
numOfVals := 1
archwayChainSpec := GetArchwaySpec(initialVersion, numOfVals)
archwayChainSpec := GetArchwaySpec(startingVersion, numOfVals)
archwayChainSpec.ChainConfig.ModifyGenesis = cosmos.ModifyGenesis(getTestGenesis())
cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
archwayChainSpec,
Expand Down

0 comments on commit a231b83

Please sign in to comment.