-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Make zombienet tests native friendly #6588
Changes from 5 commits
931b4dc
523e2c6
7d182d2
a563ac6
71006a9
eaac881
5a981da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| pathprepend() { | ||
| for ((i=$#; i>0; i--)); | ||
| do | ||
| ARG="$@[$i]" | ||
| if [ -d "$ARG" ] && [[ ":$PATH:" != *":$ARG:"* ]]; then | ||
| PATH="$ARG${PATH:+":$PATH"}" | ||
| fi | ||
| done | ||
| } | ||
|
|
||
| # paths are prepend in order, so you can manage with version will run | ||
| # by the order of this array | ||
| CUSTOM_PATHS=( | ||
| "<path>/polkadot/target/release" | ||
| "<path>/polkadot/target/testnet" | ||
| "<path>/cumulus/target/release" | ||
| ) | ||
|
|
||
| pathprepend $CUSTOM_PATHS | ||
| export PATH=$PATH | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,49 @@ _The content of this directory is meant to be used by Parity's private CI/CD inf | |
| * [zombienet repo](https://github.com/paritytech/zombienet) | ||
| * [zombienet book](https://paritytech.github.io/zombienet/) | ||
|
|
||
| ## Running tests locally | ||
|
|
||
| To run any test locally use the native provider (`zombienet test -p native ...`) you need first build the binaries. They are: | ||
|
|
||
| * adder-collator -> polkadot/target/testnet/adder-collator | ||
| * malus -> polkadot/target/testnet/malus | ||
| * polkadot -> polkadot/target/testnet/polkadot | ||
| * polkadot-collator -> cumulus/target/release/polkadot-parachain | ||
| * undying-collator -> polkadot/target/testnet/undying-collator | ||
|
|
||
| To build them use: | ||
| * adder-collator -> `cargo build --profile testnet -p test-parachain-adder-collator` | ||
| * undying-collator -> `cargo build --profile testnet -p test-parachain-undying-collator` | ||
| * malus -> cargo build --profile testnet -p polkadot-test-malus | ||
| * polkadot (in polkadot repo) and polkadot-collator (in cumulus repo) -> `cargo build --profile testnet` | ||
|
|
||
| One solution is to use the `.set_env` file (from this directory) and fill the `CUSTOM_PATHS` before *source* it to patch the PATH of your system to find the binaries you just built. | ||
|
|
||
| E.g.: | ||
| ``` | ||
| $ cat .set_env | ||
| (...) | ||
| # by the order of this array | ||
| CUSTOM_PATHS=( | ||
| "<path>/polkadot/target/release" | ||
| "<path>/polkadot/target/testnet" | ||
| "<path>/cumulus/target/release" | ||
| ) | ||
| (...) | ||
|
|
||
| source .set_env | ||
| ``` | ||
|
|
||
| Then you have your `PATH` customized and ready to run `zombienet`. | ||
| **NOTE**: You should need to do this ones per terminal session, since we are patching the `PATH` and re-exporting. | ||
|
||
|
|
||
| Example: | ||
|
|
||
| You can run a test locally by executing: | ||
| ```sh | ||
| zombienet test -p native 0001-parachains-pvf.zndsl | ||
| ``` | ||
|
|
||
| ## Questions / permissions | ||
|
|
||
| Ping in element Javier (@javier:matrix.parity.io) to ask questions or grant permission to run the test from your local setup. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,4 +21,3 @@ command = "polkadot" | |
| [[relaychain.nodes]] | ||
| name = "dave" | ||
| args = [ "-lruntime=debug,parachain=trace" ] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my case at least is my home directory. I think it make sense to change
<path>here to~to have a default that can work without altering this file (at least in my case :P but I assume others have similar setups)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense, I will change it to have a nice default that can work out of the box.
Thanks!