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

Poc add zombienet #668

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
7a04f1f
poc, add zombienet files to run in GH Actions
pepoviola Jan 21, 2022
7786795
Add within to bob test
pepoviola Jan 21, 2022
a4187f1
Clean ci config
pepoviola Jan 21, 2022
1c9be01
Merge branch 'master' into poc-add-zombienet
wirednkod Jan 21, 2022
5d33030
Merge branch 'master' into poc-add-zombienet
wirednkod Jan 21, 2022
685e81b
Add custom js example
pepoviola Jan 21, 2022
09e9de4
bump zombienet version and change custom test
pepoviola Jan 21, 2022
d0c6908
typo
pepoviola Jan 21, 2022
af83ca8
use jsdom
pepoviola Jan 21, 2022
901ab9f
debug, without lock
pepoviola Jan 21, 2022
11d5458
use jsdom directly
pepoviola Jan 21, 2022
1a49af3
bump zombienet version with jsdom
pepoviola Jan 21, 2022
010b11b
debug
pepoviola Jan 21, 2022
3880455
wip, debug
pepoviola Jan 21, 2022
4699acf
wip, debug
pepoviola Jan 21, 2022
ec0acf8
wip, debug
pepoviola Jan 21, 2022
5407b5a
typo
pepoviola Jan 21, 2022
7deae46
use ip4 instead of dns
pepoviola Jan 21, 2022
84c8265
clean tests
pepoviola Jan 22, 2022
6f598c6
Merge branch 'paritytech:master' into poc-add-zombienet
pepoviola Jan 22, 2022
8d1f79e
fix formating
pepoviola Jan 22, 2022
cdd7f76
change test to check new blocks
pepoviola Jan 22, 2022
b397069
remove run action on poc branch
pepoviola Jan 22, 2022
e5e90cf
add sleep to give time to sync
pepoviola Jan 22, 2022
fea2732
wrap subs in a promise
pepoviola Jan 22, 2022
19e4c7a
Merge branch 'master' into poc-add-zombienet
pepoviola Jan 26, 2022
c983b5e
use nikos script
pepoviola Jan 26, 2022
cd37fb7
fix comparator fn
pepoviola Jan 26, 2022
379e00e
Create zombinet needed files and test
wirednkod Jan 26, 2022
acb62d8
Merge remote-tracking branch 'upstream/master' into zombienet-configu…
wirednkod Jan 26, 2022
d9cc1a4
alter the yml in order to run
wirednkod Jan 26, 2022
da71178
Correct yml
wirednkod Jan 26, 2022
9bc1ce3
create 1 pass test and 2nd for headers
wirednkod Jan 26, 2022
17198c6
add validator = true
wirednkod Jan 27, 2022
0a0320d
add test for block producing/finalizing
pepoviola Jan 28, 2022
eacd974
Merge branch 'master' into poc-add-zombienet
wirednkod Jan 28, 2022
63edc9a
remove forkId workaround
wirednkod Jan 28, 2022
eb25bf1
merge
wirednkod Jan 28, 2022
db22320
merge
wirednkod Jan 28, 2022
8369a2d
Merge pull request #1 from pepoviola/zombienet-configuration-and-tests
wirednkod Jan 28, 2022
9ce8331
rebase
pepoviola Jan 28, 2022
2441ed2
add try/catch and log error
pepoviola Jan 28, 2022
7229215
bump zombienet version
pepoviola Feb 2, 2022
6feb197
Merge branch 'master' into poc-add-zombienet
pepoviola Feb 2, 2022
66a0730
lint
pepoviola Feb 2, 2022
df6617c
add debug bootnodes
pepoviola Feb 2, 2022
c83ffc0
change log level
pepoviola Feb 2, 2022
3946e39
Merge branch 'master' of github.com:pepoviola/substrate-connect into …
wirednkod Feb 2, 2022
128eaf7
Merge branch 'master' of github.com:pepoviola/substrate-connect into …
wirednkod Feb 3, 2022
ae76d0c
Merge branch 'master' of github.com:pepoviola/substrate-connect into …
wirednkod Feb 3, 2022
e202e01
Merge branch 'master' into poc-add-zombienet
wirednkod Feb 4, 2022
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
33 changes: 33 additions & 0 deletions .github/workflows/poc-zombienet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PoC zombienet CI

on:
push:
branches: [ poc-add-zombienet ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v2

- name: Get zombienet
run: |
curl -L -O https://github.com/paritytech/zombienet/releases/download/v1.2.7/zombienet-linux
chmod +x zombienet-linux

- name: Get polkadot
run: |
curl -L -O https://github.com/paritytech/polkadot/releases/download/v0.9.15-1/polkadot
chmod +x polkadot

- name: Run test
run: |
export PATH=$(pwd):$PATH
echo "running on $(pwd)"
echo $PATH
./zombienet-linux -p native test ./.zombienet-tests/0001-smoke-test.feature
17 changes: 17 additions & 0 deletions .zombienet-tests/0001-custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const polkadotApi = require("@polkadot/api");
wirednkod marked this conversation as resolved.
Show resolved Hide resolved

async function connect(apiUrl, types) {
const provider = new polkadotApi.WsProvider(apiUrl);
wirednkod marked this conversation as resolved.
Show resolved Hide resolved
const api = new polkadotApi.ApiPromise({ provider, types });
await api.isReady;
return api;
}

async function run(nodeName, networkInfo, args) {
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
const api = await connect(wsUri, userDefinedTypes);
wirednkod marked this conversation as resolved.
Show resolved Hide resolved
const validator = await api.query.session.validators();
return validator.length;
}

module.exports = { run }
14 changes: 14 additions & 0 deletions .zombienet-tests/0001-smoke-test.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Description: Smoke Test
Network: ./0001-smoke-test.toml
Creds: config


alice: is up
bob: is up
alice: reports node_roles is 4
alice: reports sub_libp2p_is_major_syncing is 0
alice: reports block height is at least 2 within 15 seconds
alice: reports peers count is at least 2
bob: reports block height is at least 2 within 15 seconds
bob: reports peers count is at least 2
alice: js-script ./0001-custom.js return is greater than 1 within 200 seconds
30 changes: 30 additions & 0 deletions .zombienet-tests/0001-smoke-test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[settings]
timeout = 1000
#provider = "Podman"

[relaychain]
default_image = "parity/polkadot:latest"
chain = "rococo-local"
default_command = "polkadot"

[[relaychain.nodes]]
name = "alice"
extra_args = [ "--alice" ]

[[relaychain.nodes]]
name = "bob"
extra_args = [ "--bob" ]

# [[parachains]]
# id = 100
# addToGenesis = true

# [parachains.collator]
# name = "collator01"
# image = "parity/colander:latest"
# command = "adder-collator"

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"