The cli-tool for testing parachains.
With maximal possible automatisation and simple configuration, but flexibility as priority in mind.
So with this tool you'll can run tests on you single node or parachain, send calls, check/watch state, read & check storage (raw or specific runtime-module), etc.
Project is in heavy development state. This is a first draft and partially implemented PoC.
Any contributions are highly welcome and will be appreciated ❤️.
Prerequisites:
- to run nodes one of the following options:
- installed polkadot-launch bin package (optional but gives easy setup)
- polkadot-launch config for parachain in
../../substrate/node
- polkadot-launch config for parachain in
- other tool or script
- installed polkadot-launch bin package (optional but gives easy setup)
For example run it with Pontem local parachain:
- download the release-build for you OS here or build it manually.
- use instructions about prerequisites such as polkadot-launch optionally.
- download or build manually polkadot-node and put it to
nodes/
-directory as specified in example test-suit inexamples/cases/case-test.yaml
- edit paths & ports in
case-test.yaml
andpontem/launch-config.json
if needed - run
paratesting -i examples/cases
Just one parameter is required - --input
path to directory with tests or the one test file.
Test is a yaml formatted file looks like this one.
Logging configurable as any other standard rust-log configuration with env
-variables: RUST_LOG
& RUST_LOG_STYLE
.
We're recommend RUST_LOG=trace,async_io=info,polling=info
for this project now.
See documentation for more info.
There is special logging & reporting configuration implemented as feature github
. If enabled, logs throws in gh-format.
As planned almost all fealds about keys, values, arguments or success criteria (conditions) will be evaluated. So you'll be able use some simple expressions like success: account("//Alice").balance.free > 42
.
Prerequisites:
- Rust toolchain (nightly channel)
Just run cargo build
.
Supported runtimes:
Runtime | Feature |
---|---|
Pontem | runtime-pontem |
Rococo | runtime-rococo |
Polkadot | runtime-polkadot |
Prerequisites:
- subxt executable to generate metadata for custom runtime types support
- Query node metadata and generate types in rust:
- start your node
- query node runtime metadata:
See docs for that tool.
# node api url & port output subxt metadata -f=bytes --url=http://127.0.0.1:9933 > metadata/custom.scale
- generate sources:
subxt codegen -f ./metadata.scale | rustfmt --emit=stdout > metadata.rs
- replace client/gen/pontem.rs with generated code and build with feature
runtime-pontem
or put generated to client/gen/custom.rs (rel to root of paratesting)currently planned but not implemented yet.pub metadata.scale to metadata/custom.scale and build with featureruntime-custom
- Build with ^mentioned feature
Dynamic (any) runtime types and metadata support without rebuild requirement are planned and probably will.
There are two kinds of tests:
- standard tests with
cargo test --all
- system tests, run
cargo run -- -i tests/assets