Skip to content

Commit

Permalink
feat(tests): e2e test network upgrades
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed May 10, 2023
1 parent 7fbf044 commit 13f8fda
Show file tree
Hide file tree
Showing 19 changed files with 1,454 additions and 32 deletions.
8 changes: 3 additions & 5 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ if ! has make ; then
echo "make is not installed"; exit 1
fi

if ! has go ; then
echo "go is not installed"; exit 1
fi

if ! has unzip ; then
echo "unzip is not installed"; exit 1
fi
Expand All @@ -30,7 +26,9 @@ if ! has readlink ; then
echo "readlink is not installed"; exit 1
fi

export AKASH_ROOT=$(pwd)
AKASH_ROOT=$(pwd)

export AKASH_ROOT

dotenv

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release-dry-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ defaults:
shell: bash

on:
pull_request:
push:
branches:
- master
- mainnet/main
pull_request:
tags:
- v*

jobs:
dry-run:
Expand Down
41 changes: 37 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,44 @@ on:
- v*

jobs:
ensure-dry-run:
runs-on: ubuntu-latest
steps:
- name: Ensure release/dry-run PASS
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'dry-run'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
allowed-conclusions: success
ensure-tests:
runs-on: ubuntu-latest
steps:
- name: Ensure tests PASS
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'tests'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
allowed-conclusions: success
ensure-tools:
runs-on: ubuntu-latest
steps:
- name: Ensure tools PASS
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'tools'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
allowed-conclusions: success
publish:
runs-on: ubuntu-latest
needs:
- ensure-dry-run
- ensure-tests
steps:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
Expand All @@ -27,10 +63,7 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: release version
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- if: (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/mainnet/main')
name: release dry-run GORELEASER_SKIP_VALIDATE=true
run: make release-dry-run GORELEASER_SKIP_VALIDATE=true
- name: release dry-run
- name: release
run: make release
- name: Login to GHCR
uses: docker/login-action@v2
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/upgrades-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: upgrades
defaults:
run:
shell: bash

on:
push:
tags:
- v*
jobs:
ensure-release:
runs-on: ubuntu-latest
steps:
- name: Ensure release PASS
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'release'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
allowed-conclusions: success
test:
runs-on: upgrade-tester
needs:
- ensure-release
steps:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
- uses: actions/setup-go@v3
with:
go-version: "${{ env.GOLANG_VERSION }}"
- name: configure variables
run: |
test_required=$(./script/upgrades.sh test-required ${{ github.ref }})
echo "TEST_REQUIRED=$test_required" >> $GITHUB_ENV
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: run test
if: env.TEST_REQUIRED == 'true'
run: |
cd tests/upgrade
UPGRADE_BINARY_VERSION=${{ env.RELEASE_TAG }} make test
44 changes: 44 additions & 0 deletions .github/workflows/upgrades.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: tests
defaults:
run:
shell: bash

on:
pull_request:
push:
branches:
- master
- mainnet/main

jobs:
upgrade:
runs-on: upgrade-tester
steps:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
- uses: actions/setup-go@v3
with:
go-version: "${{ env.GOLANG_VERSION }}"
- name: configure variables
run: |
test_required=$(./script/upgrades.sh test-required ${{ github.ref }})
echo "TEST_REQUIRED=$test_required" >> $GITHUB_ENV
- name: run test
if: env.TEST_REQUIRED == 'true'
run: |
cd tests/upgrade
make test
- name: upload stderr
if: always() && steps."run test".outcome != 'skipped'
uses: actions/upload-artifact@v3
with:
name: stderr.log
path: .cache/run/upgrade/stderr.log
- name: upload stdout
if: always() && steps."run test".outcome != 'skipped'
uses: actions/upload-artifact@v3
with:
name: stdout.log
path: .cache/run/upgrade/stdout.log
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ KIND_APP_IP ?= $(shell make -sC _run/kube kind-k8s-ip)
KIND_APP_PORT ?= $(shell make -sC _run/kube app-http-port)
KIND_VARS ?= KUBE_INGRESS_IP="$(KIND_APP_IP)" KUBE_INGRESS_PORT="$(KIND_APP_PORT)"

UNAME_OS := $(shell uname -s)
UNAME_ARCH := $(shell uname -m)

include make/init.mk

.DEFAULT_GOAL := bins
Expand Down
3 changes: 2 additions & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"log"
"math/rand"

"github.com/spf13/viper"

abci "github.com/tendermint/tendermint/abci/types"
logger "github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
Expand All @@ -17,7 +19,6 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/spf13/viper"
)

// ExportAppStateAndValidators exports the state of the application for a genesis
Expand Down
18 changes: 13 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ require (
github.com/cosmos/cosmos-sdk v0.45.15
github.com/cosmos/ibc-go/v3 v3.4.0
github.com/gogo/protobuf v1.3.3
github.com/google/go-github/v52 v52.0.0
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0
Expand All @@ -26,6 +28,8 @@ require (
github.com/tendermint/tm-db v0.6.7
github.com/theckman/yacspin v0.13.12
go.step.sm/crypto v0.26.0
golang.org/x/mod v0.8.0
golang.org/x/oauth2 v0.7.0
golang.org/x/sync v0.1.0
google.golang.org/grpc v1.53.0
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -66,13 +70,15 @@ require (
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/DataDog/zstd v1.5.0 // indirect
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/Workiva/go-datastructures v1.0.53 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudflare/circl v1.3.1 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 // indirect
Expand Down Expand Up @@ -112,6 +118,7 @@ require (
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
Expand Down Expand Up @@ -167,12 +174,13 @@ require (
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/exp v0.0.0-20221019170559-20944726eadf // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc // indirect
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
Loading

0 comments on commit 13f8fda

Please sign in to comment.