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

Add moonwall integration tests #1194

Merged
merged 54 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5ce5bd1
add runtime upgrade integration tests
Chralt98 Nov 29, 2023
56e4a8c
update readme
Chralt98 Dec 6, 2023
e870647
wip chopticks runtime upgrade test
Chralt98 Dec 6, 2023
ca30c01
prepare chopsticks battery station upgrade test
Chralt98 Dec 7, 2023
9f941b1
add chopsticks and sqlite3
Chralt98 Dec 8, 2023
bdc5143
chopsticks runs locally after python installation
Chralt98 Dec 8, 2023
8923038
battery station rt-upgrade works, but not main-net
Chralt98 Dec 11, 2023
cd52bc2
fix zeitgeist chopsticks upgrade test
Chralt98 Dec 12, 2023
cc965e7
add zndsl test to workflow
Chralt98 Dec 12, 2023
a365585
update integration test workflow
Chralt98 Dec 13, 2023
e2b4b1b
wip
Chralt98 Dec 13, 2023
a69b61a
update download polkadot
Chralt98 Dec 13, 2023
d015679
wip
Chralt98 Dec 13, 2023
bf2e843
wip
Chralt98 Dec 13, 2023
0634057
wip
Chralt98 Dec 13, 2023
3b4ba2d
wip
Chralt98 Dec 13, 2023
793036a
wip
Chralt98 Dec 13, 2023
af2120b
wip
Chralt98 Dec 13, 2023
5846b71
use artifact storage in github actions
Chralt98 Dec 13, 2023
4e38cd4
use release instead of debug
Chralt98 Dec 14, 2023
6b4d57d
update ci
Chralt98 Dec 14, 2023
2fdadb2
update ci
Chralt98 Dec 14, 2023
3882a1d
update ci
Chralt98 Dec 14, 2023
6adbc6c
correct CI
Chralt98 Dec 14, 2023
f1c458b
avoid creating zeitgeist folder
Chralt98 Dec 18, 2023
9a478c9
download to target/release
Chralt98 Dec 18, 2023
e4f2fb1
add executive permission
Chralt98 Dec 18, 2023
c71a142
dump chopsticks
Chralt98 Dec 18, 2023
97dfea1
log chopsticks
Chralt98 Dec 18, 2023
faaf4da
increase timeouts for CI workflows
Chralt98 Dec 19, 2023
2ef912a
resolve ws port conflict, add xcm transfer test
Chralt98 Dec 19, 2023
695e52a
add xcm tests to ci
Chralt98 Dec 19, 2023
f2fb0f3
fix log print for chopsticks
Chralt98 Dec 19, 2023
68c4bfc
use polkadot v1.1.0 for it-tests
Chralt98 Dec 19, 2023
b272544
add xcm test to post rt upgrade suite
Chralt98 Dec 20, 2023
3ec7913
correct ci
Chralt98 Dec 20, 2023
abe7c7c
manually increase blocks for hydradx
Chralt98 Dec 20, 2023
acfcfb5
divide main and test-net it tests
Chralt98 Dec 21, 2023
128401d
avoid port conflict for parallel chopsticks jobs
Chralt98 Dec 22, 2023
55dc0d1
fix CI and typescript errors
Chralt98 Dec 22, 2023
661ba52
update ci
Chralt98 Dec 22, 2023
5c20361
exit cat command in ci
Chralt98 Dec 22, 2023
222d74b
update CI to stop immediately
Chralt98 Dec 22, 2023
ed6f652
restructure jobs
Chralt98 Dec 22, 2023
caffe05
update CI to only show logs for failure
Chralt98 Jan 4, 2024
ac8e60a
update readme
Chralt98 Jan 8, 2024
6d79feb
update readme
Chralt98 Jan 8, 2024
98c8108
delete outdated test instruction
Chralt98 Jan 8, 2024
1615822
delete unused files
Chralt98 Jan 8, 2024
027b87d
add copyrights
Chralt98 Jan 8, 2024
5bd843a
mkdir integration-tests/tmp
Chralt98 Jan 8, 2024
6e574ff
update integration test readme
Chralt98 Feb 7, 2024
ecb38d1
update gitignore
Chralt98 Feb 9, 2024
4e41a90
update download polkadot comment
Chralt98 Feb 9, 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
170 changes: 170 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
name: Integration Tests

on:
push:
branches: [ main, chralt98-add-it-tests ]

env:
CARGO_TERM_COLOR: always

jobs:
build_parachain:
name: Build Parachain
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install build tools
run: ./scripts/init.sh

- name: Build Parachain
run: cargo build --release --features parachain

- name: Save runtime wasm
run: |
mkdir -p runtimes
cp target/release/wbuild/battery-station-runtime/battery_station_runtime.compact.compressed.wasm runtimes/;
cp target/release/wbuild/zeitgeist-runtime/zeitgeist_runtime.compact.compressed.wasm runtimes/;

- name: Upload runtimes
uses: actions/[email protected]
with:
name: runtimes
path: runtimes

- name: Save zeitgeist binary
run: |
mkdir -p binaries
cp target/release/zeitgeist binaries/zeitgeist;

- name: Upload binary
uses: actions/[email protected]
with:
name: binaries
path: binaries

zombienet_zndsl:
name: ZNDSL Tests
runs-on: ubuntu-latest
needs: ["build_parachain"]
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install build tools
run: ./scripts/init.sh

- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "pnpm"
cache-dependency-path: "./integration-tests/pnpm-lock.yaml"

- name: Install pnpm packages
run: |
cd integration-tests
pnpm install

- name: Cache Dependencies
uses: Swatinem/rust-cache@v1

- name: "Download binaries"
uses: actions/[email protected]
with:
name: binaries
path: binaries/zeitgeist

- name: Run ZNDSL integration tests
run: ./integration-tests/scripts/deploy-zombienet.sh --test

chopsticks_battery_station_upgrade:
name: Runtime Upgrade Battery Station
runs-on: ubuntu-latest
needs: ["build_parachain"]
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install build tools
run: ./scripts/init.sh

- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "pnpm"
cache-dependency-path: "./integration-tests/pnpm-lock.yaml"

- name: Install pnpm packages
run: |
cd integration-tests
pnpm install

- name: Cache Dependencies
uses: Swatinem/rust-cache@v1

- name: Create local folders
run: |
mkdir -p target/release/wbuild/battery-station-runtime/
mkdir -p integration-tests/tmp

- name: "Download runtime"
uses: actions/[email protected]
with:
name: runtimes
path: target/release/wbuild/battery-station-runtime/

- name: Test battery station runtime upgrade using Chopsticks
run: |
cd integration-tests
pnpm exec moonwall test chopsticks_battery_station_upgrade

chopsticks_zeitgeist_upgrade:
name: Runtime Upgrade Zeitgeist
runs-on: ubuntu-latest
needs: ["build_parachain"]
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install build tools
run: ./scripts/init.sh

- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "pnpm"
cache-dependency-path: "./integration-tests/pnpm-lock.yaml"

- name: Install pnpm packages
run: |
cd integration-tests
pnpm install

- name: Cache Dependencies
uses: Swatinem/rust-cache@v1

- name: Create local folders
run: |
mkdir -p target/release/wbuild/zeitgeist-runtime/
mkdir -p integration-tests/tmp

- name: "Download runtime"
uses: actions/[email protected]
with:
name: runtimes
path: target/release/wbuild/zeitgeist-runtime/

- name: Test zeitgeist runtime upgrade using Chopsticks
run: |
cd integration-tests
pnpm exec moonwall test chopsticks_zeitgeist_upgrade
11 changes: 10 additions & 1 deletion integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@ import { ALITH_ADDRESS } from "@moonwall/util";

### Usage Examples (non-exhaustive)

You should have installed `python` for using `sqlite3` and then used `pnpm rebuild && pnpm rebuild sqlite3`.

Most common commands:

- `pnpm exec moonwall test zombienet_zeitgeist_upgrade`
Chralt98 marked this conversation as resolved.
Show resolved Hide resolved
- `pnpm exec moonwall test chopsticks_zeitgeist_upgrade`

Other moonwall commands:

- `moonwall` : If you have globally installed moonwall, here is the most minimal entrypoint

- `pnpm moonwall` : This can be used if locally installed, and will launch the main menu..
- `pnpm moonwall` : This can be used if locally installed, and will launch the main menu.. However, there were many bugs experienced when using this cli.

- `pnpx @moonwall/cli run <ENV_NAME>` : To download and run the latest moonwall binary from npm.js repository, and run a network specified in your config file.

Expand Down
29 changes: 29 additions & 0 deletions integration-tests/configs/battery-station.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
endpoint: wss://bsr.zeitgeist.pm
mock-signature-host: true
db: ./tmp/db_mba.sqlite
# wasm-override: battery-station-runtime.compact.compressed.wasm

import-storage:
Sudo:
Key: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" # Alice
System:
Account:
- - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- providers: 1
data:
free: "100000000000000000000000"
AdvisoryCommittee:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
AdvisoryCommitteeMembership:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
Council:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
CouncilMembership:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
TechnicalCommittee:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
TechnicalCommitteeMembership:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
AuthorFilter:
EligibleRatio: 100
EligibleCount: 100
29 changes: 29 additions & 0 deletions integration-tests/configs/zeitgeist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
endpoint: wss://main.rpc.zeitgeist.pm/ws
# endpoint: wss://zeitgeist-rpc.dwellir.com
# endpoint: wss://zeitgeist.api.onfinality.io/public-ws
mock-signature-host: true
db: ./tmp/db_mba.sqlite
# wasm-override: zeitgeist-runtime.compact.compressed.wasm

import-storage:
System:
Account:
- - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- providers: 1
data:
free: "100000000000000000000000"
AdvisoryCommittee:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
AdvisoryCommitteeMembership:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
Council:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
CouncilMembership:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
TechnicalCommittee:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
TechnicalCommitteeMembership:
Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY]
AuthorFilter:
EligibleRatio: 100
EligibleCount: 100
58 changes: 52 additions & 6 deletions integration-tests/moonwall.config.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"label": "moonwall_config",
"defaultTestTimeout": 30000,
"defaultTestTimeout": 120000,
"scriptsDir": "scripts/",
"environments": [
{
"name": "zombie_zeitgeist",
"name": "zombienet_zeitgeist_upgrade",
"testFileDir": [
"tests/"
"tests/rt-upgrade-zombienet"
],
"runScripts": [
"build-parachain.sh",
"build-zeitgeist-spec.sh",
"download-polkadot.sh"
],
"foundation": {
"launchSpec": [
{
"binPath": "../target/debug/zeitgeist"
"binPath": "../target/release/zeitgeist"
}
],
"rtUpgradePath": "../target/release/wbuild/zeitgeist-runtime/zeitgeist_runtime.compact.compressed.wasm",
"type": "zombie",
"zombieSpec": {
"configPath": "./configs/zombieZeitgeist.json"
Expand All @@ -31,11 +31,57 @@
"endpoints": ["ws://127.0.0.1:9947"]
},
{
"name": "Zeitgeist-Parachain-2101",
"name": "parachain",
"type": "polkadotJs",
"endpoints": ["ws://127.0.0.1:9944"]
}
]
},
{
"name": "chopsticks_zeitgeist_upgrade",
"testFileDir": ["tests/rt-upgrade-chopsticks"],
"foundation": {
"type": "chopsticks",
"rtUpgradePath": "../target/release/wbuild/zeitgeist-runtime/zeitgeist_runtime.compact.compressed.wasm",
"launchSpec": [
{
"name": "db",
"type": "parachain",
"configPath": "./configs/zeitgeist.yml"
}
]
},
"envVars": ["LOG_LEVEL=debug", "VERBOSE_LOG"],
"connections": [
{
"name": "DB",
"type": "polkadotJs",
"endpoints": ["ws://127.0.0.1:8000"]
}
]
},
{
"name": "chopsticks_battery_station_upgrade",
"testFileDir": ["tests/rt-upgrade-chopsticks"],
"foundation": {
"type": "chopsticks",
"rtUpgradePath": "../target/release/wbuild/battery-station-runtime/battery_station_runtime.compact.compressed.wasm",
"launchSpec": [
{
"name": "db",
"type": "parachain",
"configPath": "./configs/battery-station.yml"
}
]
},
"envVars": ["LOG_LEVEL=debug", "VERBOSE_LOG"],
"connections": [
{
"name": "DB",
"type": "polkadotJs",
"endpoints": ["ws://127.0.0.1:8000"]
}
]
}
]
}
5 changes: 5 additions & 0 deletions integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"author": "Zeitgeist PM <[email protected]>",
"dependencies": {
"@polkadot/keyring": "^12.6.1",
"@polkadot/util-crypto": "^12.6.1",
"sqlite3": "^5.1.6",
"typescript": "^5.2.2"
},
"devDependencies": {
"@acala-network/chopsticks": "^0.9.3",
"@moonwall/cli": "^4.4.1",
"@moonwall/util": "^4.4.1",
"@polkadot/api": "^10.10.1",
"@polkadot/types": "^10.10.1",
"@types/node": "^20.9.0",
Expand Down
Loading
Loading