Skip to content

Commit

Permalink
Add zombienet integration (polkadot-fellows#307)
Browse files Browse the repository at this point in the history
<!-- Remember that you can run `/merge` to enable auto-merge in the PR
-->

<!-- Remember to modify the changelog. If you don't need to modify it,
you can check the following box.
Instead, if you have already modified it, simply delete the following
line. -->

- [x] Does not require a CHANGELOG entry

Hi 👋 , this pr add a very small smoke test as PoC of using
[zombienet-sdk](https://github.com/paritytech/zombienet-sdk) with the
_runtimes_ repo. The idea is to explore the integration and add more
assertions (metrics, logs, etc) and complex scenarios in the future
(e.g: test upgrades, mix node's versions, etc).

This test use a set of _env vars_ that allow you to specify the images
and the provider to use:
`POLKADOT_IMAGE` (_default_: docker.io/parity/polkadot:latest)
`CUMULUS_IMAGE` (_default_: docker.io/parity/polkadot-parachain:latest)
`ZOMBIE_PROVIDER`(_default_: Docker)

And needs to have the `chain-spec-generator` binary as part of your
`PATH`, any feedback is welcome :)

--- 
Also worth notice that the `chain-spec-generator` tool is compiling all
the runtimes, and would be good to only compile the needed ones
(polkadot in this case), we can add some feature-gate logic or we can
also move _ presets_ to runtimes (ping @michalkucharczyk ).

Thanks!

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
pepoviola and bkchr authored May 22, 2024
1 parent dd8cb5d commit 65e23d8
Show file tree
Hide file tree
Showing 7 changed files with 4,763 additions and 1,020 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,54 @@ jobs:
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1

zombienet-smoke:
needs: [build-chain-spec-generator]
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0
with:
access_token: ${{ github.token }}

- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler

- name: Free space on the runner
run: |
df -h
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Checkout
uses: actions/checkout@v3

- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV

- name: Install stable toolchain
run: |
rustup install $RUST_STABLE_VERSION
rustup default $RUST_STABLE_VERSION
rustup target add wasm32-unknown-unknown
rustup component add rust-src
- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache-integration-tests"

- name: Build
run: |
cargo build -p chain-spec-generator --features fast-runtime --release --locked
- name: Zombienet smoke test
timeout-minutes: 20
run: |
export PATH=$(pwd)/target/release:$PATH
cargo test --manifest-path integration-tests/zombienet/Cargo.toml
Loading

0 comments on commit 65e23d8

Please sign in to comment.