Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/spf13/cast-…
Browse files Browse the repository at this point in the history
…1.6.0
  • Loading branch information
mergify[bot] authored Feb 16, 2024
2 parents d5bb9bd + cfd3df3 commit 5150e45
Show file tree
Hide file tree
Showing 15 changed files with 2,223 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup Golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.20'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-smart-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
go-arch: ["amd64"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
Expand All @@ -79,7 +79,7 @@ jobs:
versions: ${{ fromJson(needs.get-cosmwasm-releases.outputs.cosmwasm_versions) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Download smart contracts
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/e2e-ibc.yml
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@v5
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@v5
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Display go version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
**/**.go
go.mod
go.sum
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: golangci/golangci-lint-action@v3
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip-sims')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Display go version
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Display go version
Expand All @@ -50,7 +50,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Display go version
Expand All @@ -76,7 +76,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Display go version
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Display go version
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Display go version
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
install-tparse:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Display go version
Expand All @@ -39,7 +39,7 @@ jobs:
go-arch: ["amd64"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: technote-space/get-diff-action@v6.1.2
Expand All @@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Create a file with all the pkgs
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
part: ["00", "01", "02", "03"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: technote-space/get-diff-action@v6.1.2
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
part: ["00", "01", "02", "03"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: technote-space/get-diff-action@v6.1.2
Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
part: ["00", "01", "02", "03"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: technote-space/get-diff-action@v6.1.2
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
needs: [build, tests]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Install docker-compose
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (ci) [\#291](https://github.com/Finschia/finschia/pull/291) fix goreleaser ci error and replace release-build
* (repo) [\#295](https://github.com/Finschia/finschia/pull/295) setup CODEOWNERS and backport action
* (ci) [\#296](https://github.com/Finschia/finschia/pull/296) bump actions/checkout from 3 to 4
* (ci) [\#305](https://github.com/Finschia/finschia/pull/305) add e2e-ibc ci
* (build) [\#316](https://github.com/Finschia/finschia/pull/316) change docker image version to fix build error

### Docs

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ARG GO_VERSION="1.20"
ARG RUNNER_IMAGE="alpine:3.17"

FROM golang:${GO_VERSION}-alpine AS build-env
FROM golang:${GO_VERSION}-alpine3.17 AS build-env

ARG FINSCHIA_BUILD_OPTIONS=""
ARG GIT_VERSION
Expand Down
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SDK_PACK := $(shell go list -m github.com/Finschia/finschia-sdk | sed 's/ /\@/g
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
OST_VERSION := $(shell go list -m github.com/Finschia/ostracon | sed 's:.* ::') # grab everything after the space in "github.com/Finschia/ostracon v0.34.7"
WASMVM_VERSION=$(shell go list -m github.com/Finschia/wasmvm | awk '{print $$2}')
HEIGHLINER_VERSION=v1.5.3
DOCKER := $(shell which docker)
LEDGER_ENABLED ?= true
BUILDDIR ?= $(CURDIR)/build
Expand Down Expand Up @@ -142,7 +143,18 @@ go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
@go mod download

.PHONY: all build install clean wasmvmlib build-reproducible
get-heighliner:
git clone --branch $(HEIGHLINER_VERSION) https://github.com/strangelove-ventures/heighliner.git $(TEMPDIR)/heighliner
cd $(TEMPDIR)/heighliner && go install

local-image:
ifeq (,$(shell which heighliner))
echo 'heighliner' binary not found. Consider running `make get-heighliner`
else
heighliner build -c finschia --local --dockerfile cosmos --build-target "wget https://github.com/Finschia/wasmvm/releases/download/$(WASMVM_VERSION)/libwasmvm_muslc.aarch64.a -O /lib/libwasmvm.aarch64.a && make install" --binaries "/go/bin/fnsad"
endif

.PHONY: all build install clean wasmvmlib build-reproducible get-heighliner local-image


###############################################################################
Expand Down Expand Up @@ -176,8 +188,10 @@ test-integration-multi-node: docker-build
test-upgrade-name:
@sh contrib/check-upgrade-name.sh

.PHONY: test test-all test-unit test-race test-cover benchmark test-integration test-integration-multi-node
test-e2e-ibc:
cd interchaintest && go test -v ./...

.PHONY: test test-all test-unit test-race test-cover benchmark test-integration test-integration-multi-node test-e2e-ibc

###############################################################################
### Docker ###
Expand Down
15 changes: 15 additions & 0 deletions interchaintest/README.md
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 ./...
```
67 changes: 67 additions & 0 deletions interchaintest/conformance_test.go
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,
}
}
Loading

0 comments on commit 5150e45

Please sign in to comment.