-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add conformance test for ibc (#305)
* test: add conformance test for ibc * ci: add e2e-ibc ci * chore: update CHANGELOG * chore: fix for docker image name for localhost * Update .github/workflows/e2e-ibc.yml Co-authored-by: Shogo Hyodo <mmoshg8u@gmail.com> * chore: set heighliner's version and rename chain's name in ChainSpec. * chore: rename chain's name to finschia-2 in ChainSpec. * chore: change gas price for finschia-2 --------- Co-authored-by: Shogo Hyodo <mmoshg8u@gmail.com>
- Loading branch information
1 parent
61c46fe
commit df5fc00
Showing
7 changed files
with
2,202 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
name: E2E-IBC | ||
|
||
on: | ||
pull_request: | ||
push: | ||
tags: | ||
- "**" | ||
branches: | ||
- "main" | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
env: | ||
GO_VERSION: '1.20' | ||
TAR_PATH: /tmp/fnsad-docker-image.tar | ||
IMAGE_NAME: finschia | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
cache-dependency-path: interchaintest/go.sum | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and export | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
tags: finschia:local | ||
outputs: type=docker,dest=${{ env.TAR_PATH }} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.IMAGE_NAME }} | ||
path: ${{ env.TAR_PATH }} | ||
|
||
e2e-tests: | ||
needs: build-docker | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# names of `make` commands to run tests | ||
test: | ||
- "test-e2e-ibc" | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Set up Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
cache-dependency-path: interchaintest/go.sum | ||
|
||
- name: checkout chain | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Tarball Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ env.IMAGE_NAME }} | ||
path: /tmp | ||
|
||
- name: Load Docker Image | ||
run: | | ||
docker image load -i ${{ env.TAR_PATH }} | ||
docker image ls -a | ||
- name: Run Test | ||
run: make ${{ matrix.test }} |
This file contains 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 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 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,15 @@ | ||
# IBC conformance test suite | ||
|
||
# Quick Start | ||
|
||
* Install and Build docker image for conformance test | ||
```bash | ||
# From finschia root folder | ||
make get-heighliner | ||
make local-image | ||
``` | ||
* Run conformance test and other custom IBC tests | ||
```bash | ||
cd interchaintest | ||
go test -v ./... | ||
``` |
This file contains 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,67 @@ | ||
package interchaintest_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
interchaintest "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" | ||
"go.uber.org/zap/zaptest" | ||
) | ||
|
||
func TestConformance(t *testing.T) { | ||
// Arrange | ||
numOfValidators := 2 | ||
numOfFullNodes := 0 | ||
|
||
cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ | ||
latestFinschiaChain(numOfValidators, numOfFullNodes), | ||
builtinCosmosChainV13(numOfValidators, numOfFullNodes), | ||
}) | ||
|
||
rlyFactory := interchaintest.NewBuiltinRelayerFactory( | ||
ibc.CosmosRly, | ||
zaptest.NewLogger(t), | ||
) | ||
|
||
// Act & Assert | ||
conformance.Test(t, context.Background(), []interchaintest.ChainFactory{cf}, []interchaintest.RelayerFactory{rlyFactory}, testreporter.NewNopReporter()) | ||
} | ||
|
||
func latestFinschiaChain(numOfValidators, numOfFullNodes int) *interchaintest.ChainSpec { | ||
return &interchaintest.ChainSpec{ | ||
Version: "local", | ||
ChainConfig: ibc.ChainConfig{ | ||
Type: "cosmos", | ||
Name: "finschia-2", | ||
ChainID: "finschia-2", | ||
Images: []ibc.DockerImage{ | ||
{ | ||
Repository: "finschia", | ||
Version: "local", | ||
UidGid: "1025:1025", | ||
}, | ||
}, | ||
Bin: "fnsad", | ||
Bech32Prefix: "link", | ||
Denom: "cony", | ||
GasPrices: "0.015cony", | ||
GasAdjustment: 1.3, | ||
TrustingPeriod: "336h", | ||
}, | ||
NumValidators: &numOfValidators, | ||
NumFullNodes: &numOfFullNodes, | ||
} | ||
} | ||
|
||
func builtinCosmosChainV13(numOfValidators, numOfFullNodes int) *interchaintest.ChainSpec { | ||
return &interchaintest.ChainSpec{ | ||
Name: "gaia", | ||
ChainName: "cosmoshub-2", | ||
Version: "v13.0.1", | ||
NumValidators: &numOfValidators, | ||
NumFullNodes: &numOfFullNodes, | ||
} | ||
} |
Oops, something went wrong.