Skip to content

Commit

Permalink
fix: interchaintest (#422)
Browse files Browse the repository at this point in the history
* update makefile

* fix

* temp pull request workflow

* fix makefile

* fixfix

* fixfixfix

* fixfixfixfix

* make fix

* local make

* setup

* deps

* remove test on push

---------

Co-authored-by: aljo242 <[email protected]>
  • Loading branch information
Alex Johnson and aljo242 authored May 11, 2023
1 parent d24c6bc commit 28aaa6d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 64 deletions.
65 changes: 28 additions & 37 deletions .github/workflows/interchaintest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- 'go.sum'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-e2e
REGISTRY: quicksilverzone
IMAGE_NAME: quicksilver-e2e

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -22,94 +22,85 @@ concurrency:
jobs:
build-and-push-image:
runs-on: ubuntu-latest
outputs:
branchTag: ${{ steps.meta.outputs.version }}
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Log in to the Container registry
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
go-version: '1.20.4'

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v4
- name: Setup Golang caches
uses: actions/cache@v3
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
- name: build and push container
run: make ictest-build-push

test-quicksilver-basic:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '1.20.4'
id: go

- name: checkout chain
uses: actions/checkout@v3

- run: make ictest-basic
env:
BRANCH_CI: ${{needs.build-and-push-image.outputs.branchTag}}
BRANCH_CI: "latest"

test-quicksilver-ibc:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '1.20.4'
id: go

- name: checkout chain
uses: actions/checkout@v3

- run: make ictest-ibc
env:
BRANCH_CI: ${{needs.build-and-push-image.outputs.branchTag}}
BRANCH_CI: "latest"

test-quicksilver-interchainstaking:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '1.20.4'
id: go

- name: checkout chain
uses: actions/checkout@v3

- run: make ictest-interchainstaking
env:
BRANCH_CI: ${{needs.build-and-push-image.outputs.branchTag}}
BRANCH_CI: "latest"
53 changes: 27 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -345,65 +345,67 @@ vet:
@go vet ./...
@echo "Done!"

RUNNER_BASE_IMAGE_DISTROLESS := gcr.io/distroless/static-debian11
RUNNER_BASE_IMAGE_ALPINE := alpine:3.17
RUNNER_BASE_IMAGE_NONROOT := gcr.io/distroless/static-debian11:nonroot

docker-build-debug:
@DOCKER_BUILDKIT=1 $(DOCKER) build -t quicksilver:${COMMIT} --build-arg BASE_IMG_TAG=debug --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_ALPINE) -f test/e2e/e2e.Dockerfile .
@DOCKER_BUILDKIT=1 $(DOCKER) tag quicksilver:${COMMIT} quicksilver:debug

.PHONY: run-tests test test-all test-import test-rpc $(TEST_TARGETS)

###############################################################################
### e2e interchain test ###
###############################################################################

# Executes basic chain tests via interchaintest
ictest-basic:
ictest-basic: ictest-deps
@cd test/interchaintest && go test -v -run TestBasicQuicksilverStart .

# Executes a basic chain upgrade test via interchaintest
ictest-upgrade:
ictest-upgrade: ictest-deps
@cd test/interchaintest && go test -v -run TestBasicQuicksilverUpgrade .

# Executes a basic chain upgrade locally via interchaintest after compiling a local image as quicksilver:local
ictest-upgrade-local: local-image ictest-upgrade
ictest-upgrade-local: local-image ictest-deps ictest-upgrade

# Executes IBC Transfer tests via interchaintest
ictest-ibc:
ictest-ibc: ictest-deps
@cd test/interchaintest && go test -v -run TestQuicksilverJunoIBCTransfer .

# Executes TestInterchainStaking tests via interchaintest
ictest-interchainstaking:
ictest-interchainstaking: ictest-deps
@cd test/interchaintest && go test -v -run TestInterchainStaking .

# Executes all tests via interchaintest after compiling a local image as quicksilver:local
ictest-all: local-image ictest-basic ictest-upgrade ictest-ibc ictest-interchainstaking
ictest-all: ictest-setup ictest-basic ictest-upgrade ictest-ibc ictest-interchainstaking

ictest-setup: ictest-build ictest-deps

ictest-build: get-heighliner local-image

.PHONY: ictest-basic ictest-upgrade ictest-ibc ictest-all
ictest-deps:
# install other docker images
@$(DOCKER) image pull quicksilverzone/xcclookup:v0.4.3
@$(DOCKER) image pull quicksilverzone/interchain-queries:e2e

ictest-build-push: ictest-setup
@$(DOCKER) tag quicksilver:local quicksilverzone/quicksilver-e2e:latest
@$(DOCKER) push quicksilverzone/quicksilver-e2e:latest

.PHONY: ictest-basic ictest-upgrade ictest-ibc ictest-all ictest-deps ictest-build ictest-build-push

###############################################################################
### heighliner ###
###############################################################################

get-heighliner:
@rm -rf heighliner
@git clone https://github.com/strangelove-ventures/heighliner.git
@cd heighliner && go install
@cd heighliner && go build

local-image:
ifeq (,$(shell which heighliner))
@echo 'heighliner' binary not found. Consider running `make get-heighliner`
else
heighliner build -c quicksilver --local --build-env BUILD_TAGS=muslc
endif
# install other docker images
$(DOCKER) image pull quicksilverzone/xcclookup:v0.4.3
$(DOCKER) image pull quicksilverzone/interchain-queries:e2e

@heighliner/heighliner build -c quicksilver --local --build-env BUILD_TAGS=muslc

.PHONY: get-heighliner local-image

###############################################################################
### simulation ###
###############################################################################

SIM_NUM_BLOCKS ?= 500
SIM_BLOCK_SIZE ?= 200
SIM_CI_NUM_BLOCKS ?= 125
Expand All @@ -412,7 +414,6 @@ SIM_PERIOD ?= 5
SIM_COMMIT ?= true
SIM_TIMEOUT ?= 24h


test-sim-nondeterminism:
@echo "Running non-determinism test..."
@go test -short -mod=readonly $(PACKAGES_SIM) -run ^TestAppStateDeterminism -Enabled=true \
Expand Down
2 changes: 1 addition & 1 deletion test/interchaintest/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

var (
QuickSilverE2ERepo = "ghcr.io/ingenuity-build/quicksilver-e2e"
QuickSilverE2ERepo = "quicksilverzone/quicksilver-e2e"
QuicksilverMainRepo = "quicksilverzone/quicksilver"

repo, version = GetDockerImageInfo()
Expand Down

0 comments on commit 28aaa6d

Please sign in to comment.