-
Notifications
You must be signed in to change notification settings - Fork 98
test: Add IBC conformance test and enable as gh workflow #431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c9649e4
adding conformance test
spoo-bar 321ec22
adding gh worflow for ibc conformance test
spoo-bar 6bdeeab
cleanup
spoo-bar cd80216
Updating changelog
spoo-bar bcca8e9
Adding local testing docs
spoo-bar e366c7d
Merge branch 'main' into spoorthi/ibc-confomance-test
spoo-bar cba0c85
setting gaia latest version
spoo-bar ef8eee5
Merge branch 'main' into spoorthi/ibc-confomance-test
spoo-bar 2024b95
heighliner using --chain archway
spoo-bar fecc50c
Merge branch 'spoorthi/ibc-confomance-test' of https://github.com/arc…
spoo-bar b53c9e4
removing osmosis test as it doesnt offer anything new
spoo-bar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,46 @@ | ||
| # Interchain Test | ||
|
|
||
| ## Chain upgrade test | ||
| To run the interchain tests, we need to use Heighliner. | ||
|
|
||
| To run the chain upgrade test locally: | ||
| To install Heighliner | ||
|
|
||
| ```sh | ||
| git clone https://github.com/strangelove-ventures/heighliner.git | ||
| cd heighliner | ||
| go install | ||
| ``` | ||
|
|
||
| 1. Install Heighliner | ||
|
|
||
| ```sh | ||
| git clone https://github.com/strangelove-ventures/heighliner.git | ||
| cd heighliner | ||
| go install | ||
| ``` | ||
|
|
||
| 2. Build the current branch docker image | ||
|
|
||
| ```sh | ||
| heighliner build --org archway-network --repo archway --dockerfile cosmos --build-target "make build" --build-env "BUILD_TAGS=muslc" --binaries "build/archwayd" --git-ref <local_branch_name> --tag local | ||
| docker image tag acrechain:local archway:local # There is an issue with heighliner where it wrongly names the docker image | ||
| docker rmi acrechain:local | ||
| ``` | ||
|
|
||
| 3. Build the last release docker image | ||
|
|
||
| ```sh | ||
| heighliner build --org archway-network --repo archway --dockerfile cosmos --build-target "make build" --build-env "BUILD_TAGS=muslc" --binaries "build/archwayd" --git-ref v3.0.0 --tag local | ||
| docker image tag acrechain:3.0.0archway:3.0.0 | ||
| docker rmi acrechain:3.0.0 | ||
| ``` | ||
| Using Heighliner, build a docker image of your local branch | ||
|
|
||
| ```sh | ||
| heighliner build --org archway-network --repo archway --dockerfile cosmos --build-target "make build" --build-env "BUILD_TAGS=muslc" --binaries "build/archwayd" --git-ref <local_branch_name> --tag local | ||
| docker image tag acrechain:local archway:local # There is an issue with heighliner where it wrongly names the docker image | ||
| docker rmi acrechain:local | ||
| ``` | ||
|
|
||
| ## IBC conformance test | ||
|
|
||
| To run the IBC conformance test locally go to Archway repo root and | ||
|
|
||
| ```sh | ||
| cd interchaintest | ||
| go test -v -race -run TestGaiaConformance | ||
| go test -v -race -run TestOsmosisConformance | ||
| ``` | ||
|
|
||
| ## Chain upgrade test | ||
|
|
||
| To run the chain upgrade test locally, first build the last release docker image. The version should match the value of `initialVersion` in [setup.go](./setup.go) | ||
|
|
||
| ```sh | ||
| heighliner build --org archway-network --repo archway --dockerfile cosmos --build-target "make build" --build-env "BUILD_TAGS=muslc" --binaries "build/archwayd" --git-ref v3.0.0 --tag local | ||
| docker image tag acrechain:3.0.0archway:3.0.0 | ||
|
spoo-bar marked this conversation as resolved.
Outdated
|
||
| docker rmi acrechain:3.0.0 | ||
| ``` | ||
|
|
||
| 4. Now go to Archway repo root and | ||
| Now go to Archway repo root and run | ||
|
|
||
| ```sh | ||
| cd interchaintest | ||
| go test -v -race -run TestChainUpgrade | ||
| ``` | ||
| ```sh | ||
| cd interchaintest | ||
| go test -v -race -run TestChainUpgrade | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| package interchaintest | ||
|
|
||
| import ( | ||
| "context" | ||
| "testing" | ||
|
|
||
| interchaintest "github.com/strangelove-ventures/interchaintest/v4" | ||
| "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" | ||
| "github.com/strangelove-ventures/interchaintest/v4/conformance" | ||
| "github.com/strangelove-ventures/interchaintest/v4/ibc" | ||
| "github.com/strangelove-ventures/interchaintest/v4/relayer" | ||
| "github.com/strangelove-ventures/interchaintest/v4/testreporter" | ||
| "github.com/stretchr/testify/require" | ||
| "go.uber.org/zap/zaptest" | ||
| ) | ||
|
|
||
| func TestGaiaConformance(t *testing.T) { | ||
| if testing.Short() { | ||
| t.Skip("skipping in short mode") | ||
| } | ||
|
|
||
| gaiaChainSpec := &interchaintest.ChainSpec{ | ||
| Name: "gaia", | ||
| ChainName: "gaia", | ||
| Version: "latest", | ||
| } | ||
| runConformanceTest(t, gaiaChainSpec) | ||
| } | ||
|
|
||
| func runConformanceTest(t *testing.T, gaiaChainSpec *interchaintest.ChainSpec) { | ||
| numOfVals := 1 | ||
| archwayChainSpec := GetArchwaySpec("local", numOfVals) | ||
|
|
||
| // Setup the chains | ||
| chainFactory := interchaintest.NewBuiltinChainFactory( | ||
| zaptest.NewLogger(t), | ||
| []*interchaintest.ChainSpec{ | ||
| archwayChainSpec, | ||
| gaiaChainSpec, | ||
| }) | ||
| chains, err := chainFactory.Chains(t.Name()) | ||
| require.NoError(t, err) | ||
| archwayChain, counterpartyChain := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain) | ||
|
|
||
| // Setup the relayer | ||
| const ( | ||
| path = "ibc-upgrade-test-path" | ||
| relayerName = "relayer" | ||
| ) | ||
| relayerFactory := interchaintest.NewBuiltinRelayerFactory( | ||
| ibc.CosmosRly, | ||
| zaptest.NewLogger(t), | ||
| relayer.StartupFlags("-b", "100"), | ||
| ) | ||
| client, network := interchaintest.DockerSetup(t) | ||
| relayer := relayerFactory.Build(t, client, network) | ||
|
|
||
| // Create the IBC network with the chains and relayer | ||
| ic := interchaintest.NewInterchain(). | ||
| AddChain(archwayChain). | ||
| AddChain(counterpartyChain). | ||
| AddRelayer(relayer, "relayer"). | ||
| AddLink(interchaintest.InterchainLink{ | ||
| Chain1: archwayChain, | ||
| Chain2: counterpartyChain, | ||
| Relayer: relayer, | ||
| Path: path, | ||
| }) | ||
| rep := testreporter.NewNopReporter() | ||
| ctx := context.Background() | ||
|
|
||
| // Starts all the components of the IBC network | ||
| require.NoError(t, ic.Build(ctx, rep.RelayerExecReporter(t), interchaintest.InterchainBuildOptions{ | ||
| TestName: t.Name(), | ||
| Client: client, | ||
| NetworkID: network, | ||
| SkipPathCreation: false, | ||
| })) | ||
| t.Cleanup(func() { | ||
| _ = ic.Close() | ||
| }) | ||
|
|
||
| // Perform the conformance test between the two chains | ||
| conformance.TestChainPair(t, ctx, client, network, archwayChain, counterpartyChain, relayerFactory, rep, relayer, path) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.