diff --git a/.github/workflows/e2e-test-workflow-call.yml b/.github/workflows/e2e-test-workflow-call.yml index 10ddfd9a..de990ce2 100644 --- a/.github/workflows/e2e-test-workflow-call.yml +++ b/.github/workflows/e2e-test-workflow-call.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: tests: - - "e2e-test-ibc" + - "e2e-test-ibc-success" - "e2e-test-ibc-timeout" fail-fast: false runs-on: ubuntu-latest diff --git a/.github/workflows/e2e_test.yml b/.github/workflows/e2e_test.yml index de1d1c71..81251353 100644 --- a/.github/workflows/e2e_test.yml +++ b/.github/workflows/e2e_test.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: tests: - - "e2e-test-ibc" + - "e2e-test-ibc-success" - "e2e-test-ibc-timeout" fail-fast: false runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 03cbe2dd..1483f0c7 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,15 @@ ############################################################################### # Executes IBC tests via rollup-e2e-testing -e2e-test-ibc: - cd tests && go test -timeout=25m -race -v -run TestIBCTransfer . +e2e-test-ibc-success: + cd tests && go test -timeout=25m -race -v -run TestIBCTransferSuccess . # Executes IBC tests via rollup-e2e-testing e2e-test-ibc-timeout: cd tests && go test -timeout=25m -race -v -run TestIBCTransferTimeout . # Executes all tests via rollup-e2e-testing -e2e-test-all: e2e-test-ibc e2e-test-ibc-timeout +e2e-test-all: e2e-test-ibc-success e2e-test-ibc-timeout -.PHONY: e2e-test-ibc e2e-test-ibc-timeout e2e-test-all +.PHONY: e2e-test-ibc-success e2e-test-ibc-timeout e2e-test-all diff --git a/tests/ibc_timeout_test.go b/tests/ibc_timeout_test.go index 2f0f704a..e0e63f2f 100644 --- a/tests/ibc_timeout_test.go +++ b/tests/ibc_timeout_test.go @@ -2,6 +2,7 @@ package tests import ( "context" + "fmt" "testing" "cosmossdk.io/math" @@ -28,7 +29,7 @@ func TestIBCTransferTimeout(t *testing.T) { configFileOverrides := make(map[string]any) dymintTomlOverrides := make(testutil.Toml) dymintTomlOverrides["settlement_layer"] = "dymension" - dymintTomlOverrides["node_address"] = "http://dymension_100-1-val-0-TestIBCTransferTimeout:26657" + dymintTomlOverrides["node_address"] = fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name()) dymintTomlOverrides["rollapp_id"] = "demo-dymension-rollapp" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -184,6 +185,11 @@ func TestIBCTransferTimeout(t *testing.T) { dymensionIBCDenom := transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, dymensionIBCDenom, math.NewInt(0)) + // According to delayedack module, we need the rollapp to have finalizedHeight > ibcClientLatestHeight + // in order to trigger ibc timeout or else it will trigger callback + err = testutil.WaitForBlocks(ctx, 5, rollapp1) + require.NoError(t, err) + err = r.StartRelayer(ctx, eRep, ibcPath) require.NoError(t, err) @@ -196,11 +202,10 @@ func TestIBCTransferTimeout(t *testing.T) { }, ) - err = testutil.WaitForBlocks(ctx, 5, rollapp1) + err = testutil.WaitForBlocks(ctx, 10, dymension) require.NoError(t, err) // Assert funds were returned to the sender after the timeout has occured - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, walletAmount) testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, dymensionIBCDenom, math.NewInt(0)) - + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, walletAmount) } diff --git a/tests/ibc_transfer_test.go b/tests/ibc_transfer_test.go index 033fe41c..ecc64bef 100644 --- a/tests/ibc_transfer_test.go +++ b/tests/ibc_transfer_test.go @@ -2,6 +2,7 @@ package tests import ( "context" + "fmt" "testing" "cosmossdk.io/math" @@ -18,7 +19,7 @@ import ( const ibcPath = "dymension-demo" // TestStart is a basic test to assert that spinning up a dymension network with 1 validator works properly. -func TestIBCTransfer(t *testing.T) { +func TestIBCTransferSuccess(t *testing.T) { if testing.Short() { t.Skip() } @@ -28,7 +29,7 @@ func TestIBCTransfer(t *testing.T) { configFileOverrides := make(map[string]any) dymintTomlOverrides := make(testutil.Toml) dymintTomlOverrides["settlement_layer"] = "dymension" - dymintTomlOverrides["node_address"] = "http://dymension_100-1-val-0-TestIBCTransfer:26657" + dymintTomlOverrides["node_address"] = fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name()) dymintTomlOverrides["rollapp_id"] = "demo-dymension-rollapp" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides