Skip to content
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

Polkadot Functional Zombietests #2074

Merged
merged 75 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
d5b4192
Copy polkadot functional zombietests
kamilsa May 1, 2024
9b4bdf1
Use kagome as relay-chain nodes. Add tests-launchers
igor-egorov May 1, 2024
d3904b8
Add missing command and prometheus_prefix settings
igor-egorov May 1, 2024
d3c7e02
Enable Zombietests
igor-egorov May 1, 2024
8924de7
Enable CI 2
igor-egorov May 1, 2024
791b241
Add hard trigger for CI
igor-egorov May 1, 2024
bde5565
Temporarily fetch tests from this branch instead of master
kamilsa May 1, 2024
c70a32c
Update metrics names for 0001
kamilsa May 2, 2024
604dc2f
Merge branch 'master' into test/polkadot-functional-zombietests
kamilsa May 14, 2024
0eb492a
test runner script
qdrvm-ci May 16, 2024
9e3fd0c
use print with flush
qdrvm-ci May 16, 2024
60a953f
run tests in one container
qdrvm-ci May 16, 2024
b1bd6b6
warm up script / Merge remote-tracking branch 'origin/ci/zombietests-…
qdrvm-ci May 17, 2024
f4e1ea3
Use compiled wasm in test 1
kamilsa May 17, 2024
855529b
Merge branch 'master' into test/polkadot-functional-zombietests
kamilsa May 17, 2024
6f0be3d
Switch kagome and polkadot for 0001
kamilsa May 20, 2024
5fd7ecd
Try run spawn instead of test during warmup
kamilsa May 20, 2024
6491515
Revert "Try run spawn instead of test during warmup"
kamilsa May 20, 2024
5cc86ee
Again try run spawn instead of test during warmup
kamilsa May 20, 2024
89b09a1
Add first attempt
kamilsa May 20, 2024
61d8cf0
Leave only two kagome in 0001
kamilsa May 20, 2024
a9bfe96
Revert "Add first attempt"
kamilsa May 20, 2024
e8e57fd
Revert "Again try run spawn instead of test during warmup"
kamilsa May 20, 2024
26a5475
Revert "Revert "Try run spawn instead of test during warmup""
kamilsa May 20, 2024
f0bf8b5
Revert "Try run spawn instead of test during warmup"
kamilsa May 20, 2024
59551b3
Revert "run tests in one container"
kamilsa May 20, 2024
4643ea4
Revert "use print with flush"
kamilsa May 20, 2024
c8d6ca5
Revert "test runner script"
kamilsa May 20, 2024
3440e6d
Use zombie-tester with prebuilt runtimes
kamilsa May 20, 2024
0cde187
Update test 0002, Fix test 0003
kamilsa May 20, 2024
4086113
Update tester with timeout for precompile
kamilsa May 20, 2024
f457b23
Remove kamilsa in makefile, return tester step
kamilsa May 20, 2024
ac6c241
Update 0003, 0004 and 0011 with Compiled kagome
kamilsa May 20, 2024
5cd5045
Download runtime cache instead of creating new one
kamilsa May 20, 2024
3649f23
Fix kagome metric in 0011
kamilsa May 20, 2024
ebfe405
Merge branch 'master' into test/polkadot-functional-zombietests
kamilsa May 20, 2024
5968c26
Chown /tmp/kagome
kamilsa May 20, 2024
4351077
Merge remote-tracking branch 'origin/test/polkadot-functional-zombiet…
kamilsa May 20, 2024
2f66166
Fix /tmp/kagome, use commit hash
kamilsa May 20, 2024
b37fffb
Fix returning after cd
kamilsa May 20, 2024
f90fe85
Fix cd
kamilsa May 20, 2024
030c912
Return branch clone
kamilsa May 20, 2024
91ddff0
Pass branch instead of commit hash
kamilsa May 20, 2024
b4a701f
Pass branch name as arg from yml
kamilsa May 21, 2024
7530e05
Try env
kamilsa May 21, 2024
152548b
Pass branch name from env
kamilsa May 21, 2024
492222c
Merge branch 'test/polkadot-functional-zombietests' into ci/zombietes…
qdrvm-ci May 21, 2024
a6071fd
branch name from env
qdrvm-ci May 21, 2024
d4e3c2d
test branch name as params
qdrvm-ci May 21, 2024
ca14506
Merge branch 'ci/zombietests-warm-up' into test/polkadot-functional-z…
qdrvm-ci May 21, 2024
dcf102c
Try build kagome from current branch
kamilsa May 21, 2024
645ae80
Revert "Add hard trigger for CI"
kamilsa May 21, 2024
d1caf37
Remove hard trigger in CI
kamilsa May 21, 2024
ef7dec2
Merge branch 'test/polkadot-functional-zombietests' into ci/zombietes…
qdrvm-ci May 22, 2024
6116722
test build
qdrvm-ci May 22, 2024
08ca8dd
show directory in make step, save artifact
qdrvm-ci May 22, 2024
11f249c
tests with image from artifacts
qdrvm-ci May 23, 2024
2d5e841
Add --version flag
kamilsa May 23, 2024
fccb78b
change upload artifact version, minideb build workflow
qdrvm-ci May 23, 2024
6a6db57
kagome_image env fix
qdrvm-ci May 23, 2024
15ad9c7
change docker file in zombie tests to minideb-release.Dockerfile
qdrvm-ci May 23, 2024
1afd055
Merge branch 'ci/zombietests-warm-up' into test/polkadot-functional-z…
qdrvm-ci May 24, 2024
cff0028
Merge branch 'test/polkadot-functional-zombietests' into ci/zombietes…
qdrvm-ci May 24, 2024
172ac2c
Merge branch 'master' into ci/zombietests-warm-up
qdrvm-ci May 24, 2024
eb679f2
get kagome version on build state and precompile cache in build teste…
qdrvm-ci May 24, 2024
b6d1e2c
precompile path fix
qdrvm-ci May 25, 2024
7615ce0
separate docker tester step
qdrvm-ci May 28, 2024
4abf45c
use custom zombie-tester image in make step
qdrvm-ci May 29, 2024
14661dd
Merge branch 'ci/zombietests-warm-up' into test/polkadot-functional-z…
qdrvm-ci May 29, 2024
ef0c78c
Merge branch 'master' into test/polkadot-functional-zombietests
kamilsa May 29, 2024
c571a3d
zombie-tests CI text fixes
qdrvm-ci May 29, 2024
b640075
Add --wasm-execution=Compiled to kagome everywhere
kamilsa May 29, 2024
1292305
Remove old zombienet tests
kamilsa May 29, 2024
1465d52
Revert "Remove old zombienet tests"
kamilsa May 29, 2024
0ee175d
Move old tests to old folder
kamilsa May 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 26 additions & 70 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,91 +253,47 @@ jobs:
VERSION: ${{ github.ref }}
BUILD_TYPE: "${{ matrix.options.build-type }}"
run: ./housekeeping/docker/kagome/build_and_push.sh

Push-self-hosted-PR:
if: ${{ contains( github.event.pull_request.labels.*.name, 'Non-master push') }}
strategy:
fail-fast: false
matrix:
options:
- name: "Self-hosted: Push Debug Docker image"
build-type: "Debug"
- name: "Self-hosted: Push Release Docker image"
build-type: "Release"
- name: "Self-hosted: Push RelWithDebInfo Docker image"
build-type: "RelWithDebInfo"
runs-on: [ actions-runner-controller ]
timeout-minutes: 120
container: qdrvm/kagome-dev:9-minideb
steps:
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ github.job }}-${{ env.CACHE_VERSION }}
- run: git config --global --add safe.directory /__w/kagome/kagome
- run: git fetch --prune --unshallow
- name: build
env:
BUILD_TYPE: "${{ matrix.options.build-type }}"
run: ./housekeeping/docker/kagome-dev/make.sh
- uses: azure/docker-login@83efeb77770c98b620c73055fbb59b2847e17dc0
with:
login-server: https://index.docker.io/v1/
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: docker pack and push
env:
VERSION: ${{ github.ref }}
BUILD_TYPE: "${{ matrix.options.build-type }}"
run: ./housekeeping/docker/kagome/build_and_push.sh

zombie-tests:
if: false
if: true
strategy:
fail-fast: false
matrix:
options:
- name: "Parachains smoke test"
test: "test0001"
- name: "Parachains smoke test kagome"
test: "test0001_kagome"
- name: "Parachains upgrade smoke test"
test: "test0002"
- name: "Parachains upgrade smoke test kagome"
test: "test0002_kagome"
- name: "Parachains smoke test cumulus"
test: "test0003"
- name: "Parachains smoke test cumulus kagome"
test: "test0003_kagome"
- name: "Runtime upgrade"
test: "test0004"
- name: "Runtime upgrade kagome"
test: "test0004_kagome"
- name: "Dispute valid block"
test: "test0005"
- name: "Parachains disputes"
test: "test0006"
- name: "Deregister register validator smoke"
test: "test0008"
- name: "Basic warp sync"
test: "test0009"
- name: "Validators warp sync"
test: "test0010"
- name: "Block building warp sync"
test: "test0011"
- name: "PVF preparation & execution time"
test: "test-polkadot-functional-0001-parachains-pvf"
- name: "Disputes initiation, conclusion and lag"
test: "test-polkadot-functional-0002-parachains-disputes"
- name: "BEEFY voting and finality, test MMR proofs. Assumes Rococo sessions of 1 minute"
test: "test-polkadot-functional-0003-beefy-and-mmr"
- name: "Dispute finality lag when 1/3 of parachain validators always attempt to include an invalid block"
test: "test-polkadot-functional-0004-parachains-garbage-candidate"
- name: "Past-session dispute slashing"
test: "test-polkadot-functional-0005-parachains-disputes-past-session"
- name: "Test if parachains make progress with most of approvals being tranch0"
test: "test-polkadot-functional-0006-parachains-max-tranche0"
- name: "Test if disputes triggered on finalized blocks within scope always end as valid"
test: "test-polkadot-functional-0007-dispute-freshly-finalized"
- name: "Test if disputes triggered on finalized blocks out of scope never get to be confirmed and concluded"
test: "test-polkadot-functional-0008-dispute-old-finalized"
- name: "Approval voting coalescing does not lag finality"
test: "test-polkadot-functional-0009-approval-voting-coalescing"
- name: "Test validator disabling effects"
test: "test-polkadot-functional-0010-validator-disabling"
- name: "Test we are producing blocks at 6 seconds clip"
test: "test-polkadot-functional-0011-async-backing-6-seconds-rate"
runs-on: [ actions-runner-controller ]
timeout-minutes: 120
env:
BRANCH_NAME: ${{ github.head_ref }}
needs: [Push-self-hosted]
steps:
- name: Set owner of working dir recurively
run: sudo chown -R $(whoami) .
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
- name: build zombie-tester
working-directory: ./zombienet/docker
run: make tester
run: make tester BRANCH_NAME=${{ env.BRANCH_NAME }}
- name: Run test
working-directory: ./zombienet/docker
run: make ${{ matrix.options.test }}
Expand Down
158 changes: 124 additions & 34 deletions .github/workflows/zombie-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,141 @@
name: Zombie-Tests

on:
workflow_dispatch:
workflow_dispatch:

env:
CACHE_VERSION: v07
CACHE_PATHS: |
~/Library/Caches/pip
~/.cargo
~/.ccache
~/.hunter
~/.rustup

jobs:
zombie-tests:
Prepare-Kagome-Docker:
strategy:
fail-fast: false
matrix:
options:
- name: "Parachains smoke test"
test: "test0001"
- name: "Parachains smoke test kagome"
test: "test0001_kagome"
- name: "Parachains upgrade smoke test"
test: "test0002"
- name: "Parachains upgrade smoke test kagome"
test: "test0002_kagome"
- name: "Parachains smoke test cumulus"
test: "test0003"
- name: "Parachains smoke test cumulus kagome"
test: "test0003_kagome"
- name: "Runtime upgrade"
test: "test0004"
- name: "Runtime upgrade kagome"
test: "test0004_kagome"
- name: "Dispute valid block"
test: "test0005"
- name: "Parachains disputes"
test: "test0006"
- name: "Deregister register validator smoke"
test: "test0008"
- name: "Basic warp sync"
test: "test0009"
- name: "Validators warp sync"
test: "test0010"
- name: "Block building warp sync"
test: "test0011"
# - name: "Self-hosted: Debug Docker image"
# build-type: "Debug"
- name: "Self-hosted: Release Docker image"
build-type: "Release"
# - name: "Self-hosted: RelWithDebInfo Docker image"
# build-type: "RelWithDebInfo"
runs-on: [ actions-runner-controller ]
timeout-minutes: 120
container: qdrvm/kagome-dev:9-minideb
steps:
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
- uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ github.job }}-${{ matrix.options.name }}-${{ env.CACHE_VERSION }}
- run: git config --global --add safe.directory /__w/kagome/kagome
- run: git fetch --prune --unshallow
- name: Build Kagome
env:
BUILD_TYPE: "${{ matrix.options.build-type }}"
KAGOME_ROOT: /__w/kagome/kagome
run: bash -c "cd $KAGOME_ROOT && source /venv/bin/activate && ./housekeeping/docker/kagome-dev/make.sh"
- name: Copy Kagome
env:
KAGOME_BUILD_DIR: /__w/kagome/kagome/build
run: bash -c "mkdir -p ${KAGOME_BUILD_DIR}/docker_context && cp -a ${KAGOME_BUILD_DIR}/node/kagome ${KAGOME_BUILD_DIR}/docker_context"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
uses: docker/build-push-action@v5
with:
tags: kagome-dev:${{ github.run_number }}
file: ./housekeeping/docker/kagome/minideb-release.Dockerfile
context: /__w/kagome/kagome/build/docker_context
outputs: type=docker,dest=/tmp/kagome_dev.tar
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: kagome-dev
path: /tmp/kagome_dev.tar

Prepare-Zombie-Tests-Docker:
runs-on: [ actions-runner-controller ]
timeout-minutes: 60
needs: [Prepare-Kagome-Docker]
steps:
- name: Set owner of working dir recurively
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: kagome-dev
path: /tmp
- name: Load image
run: |
docker load --input /tmp/kagome_dev.tar
docker image ls -a
- name: Set owner of working dir recursively
run: sudo chown -R $(whoami) .
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
- name: build zombie-tester
- name: Extract branch name
shell: bash
run: |
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "branch=${branch}" >> $GITHUB_OUTPUT
echo "Branch name: ${branch}"
id: extract_branch
- name: Build zombie-tester
working-directory: ./zombienet/docker
run: make tester
run: make tester BRANCH_NAME=${{ steps.extract_branch.outputs.branch }} KAGOME_IMAGE=kagome-dev:${{ github.run_number }}
- name: Archive zombie-tester
shell: bash
run: docker save -o /tmp/zombie-tester.tar zombie-tester:latest
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: zombie-tester
path: /tmp/zombie-tester.tar

Zombie-Tests:
runs-on: [ actions-runner-controller ]
timeout-minutes: 60
needs: [Prepare-Zombie-Tests-Docker]
strategy:
fail-fast: false
matrix:
options:
- name: "PVF preparation & execution time"
test: "test-polkadot-functional-0001-parachains-pvf"
- name: "Disputes initiation, conclusion and lag"
test: "test-polkadot-functional-0002-parachains-disputes"
- name: "BEEFY voting and finality, test MMR proofs. Assumes Rococo sessions of 1 minute"
test: "test-polkadot-functional-0003-beefy-and-mmr"
- name: "Dispute finality lag when 1/3 of parachain validators always attempt to include an invalid block"
test: "test-polkadot-functional-0004-parachains-garbage-candidate"
- name: "Past-session dispute slashing"
test: "test-polkadot-functional-0005-parachains-disputes-past-session"
- name: "Test if parachains make progress with most of approvals being tranch0"
test: "test-polkadot-functional-0006-parachains-max-tranche0"
- name: "Test if disputes triggered on finalized blocks within scope always end as valid"
test: "test-polkadot-functional-0007-dispute-freshly-finalized"
- name: "Test if disputes triggered on finalized blocks out of scope never get to be confirmed and concluded"
test: "test-polkadot-functional-0008-dispute-old-finalized"
- name: "Approval voting coalescing does not lag finality"
test: "test-polkadot-functional-0009-approval-voting-coalescing"
- name: "Test validator disabling effects"
test: "test-polkadot-functional-0010-validator-disabling"
- name: "Test we are producing blocks at 6 seconds clip"
test: "test-polkadot-functional-0011-async-backing-6-seconds-rate"
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: zombie-tester
path: /tmp
- name: Load image
run: |
docker load --input /tmp/zombie-tester.tar
docker image ls -a
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
- name: Run test
working-directory: ./zombienet/docker
run: make ${{ matrix.options.test }}
run: make ${{ matrix.options.test }} ZOMBIE_TESTER_IMAGE=zombie-tester:latest
5 changes: 5 additions & 0 deletions core/application/impl/app_configuration_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@ namespace kagome::application {
po::options_description desc("General options");
desc.add_options()
("help,h", "show this help message")
("version,v", "show version information")
("log,l", po::value<std::vector<std::string>>(),
"Sets a custom logging filter. Syntax is `<target>=<level>`, e.g. -llibp2p=off.\n"
"Log levels (most to least verbose) are trace, debug, verbose, info, warn, error, critical, off. By default, all targets log `info`.\n"
Expand Down Expand Up @@ -944,6 +945,10 @@ namespace kagome::application {
std::cout << desc << std::endl;
return false;
}
if (vm.count("version") > 0) {
std::cout << "Kagome version " << buildVersion() << std::endl;
return false;
}

try {
// second-run parse to gather all known options
Expand Down
1 change: 1 addition & 0 deletions housekeeping/docker/kagome-dev/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#

cd "$(dirname "$0")"
echo "Building in $(pwd)"

VERSION=${VERSION:-5}
TAG=qdrvm/kagome-dev:$VERSION
Expand Down
1 change: 1 addition & 0 deletions housekeeping/docker/kagome-dev/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fi
git submodule update --init

cd "$(dirname $0)/../../.."
echo "Building in $(pwd)"

cmake . -B"${BUILD_DIR}" -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DBACKWARD=OFF
cmake --build "${BUILD_DIR}" --target kagome -- -j${BUILD_THREADS}
3 changes: 3 additions & 0 deletions housekeeping/docker/kagome/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ if [[ "${KAGOME_IN_DOCKER}" = 1 ]]; then
fi

KAGOME_ROOT="$(dirname "$0")/../../.."
echo "KAGOME_ROOT: $KAGOME_ROOT"

# cd to kagome source root
cd "$KAGOME_ROOT"

BUILD_DIR="${BUILD_DIR:-$(pwd)/build}"
echo "BUILD_DIR: $BUILD_DIR"

BUILD_TYPE="${BUILD_TYPE:?BUILD_TYPE variable is not defined}"

Expand Down Expand Up @@ -54,6 +56,7 @@ else
fi

CTX_DIR="${BUILD_DIR}/docker_context"
echo "CTX_DIR: $CTX_DIR"

# Cleanup docker context
rm -Rf ${CTX_DIR}
Expand Down
Loading
Loading