GithubHelp home page GithubHelp logo

paratesting's Introduction

Paratesting

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 ❤️.

Usage

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
    • other tool or script

For example run it with Pontem local parachain:

  1. download the release-build for you OS here or build it manually.
  2. use instructions about prerequisites such as polkadot-launch optionally.
  3. download or build manually polkadot-node and put it to nodes/-directory as specified in example test-suit in examples/cases/case-test.yaml
  4. edit paths & ports in case-test.yaml and pontem/launch-config.json if needed
  5. run paratesting -i examples/cases

UI

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

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.

Github CI environment

There is special logging & reporting configuration implemented as feature github. If enabled, logs throws in gh-format.

Evaluation

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.

Development

Prerequisites:

  • Rust toolchain (nightly channel)

How to build

Just run cargo build.

Supported runtimes:

Runtime Feature
Pontem runtime-pontem
Rococo runtime-rococo
Polkadot runtime-polkadot

How to build especially with/for metadata by your node, where publicly used custom types

Prerequisites:

  • subxt executable to generate metadata for custom runtime types support
  1. Query node metadata and generate types in rust:
    1. start your node
    2. query node runtime metadata:
      #                             node api url & port     output
      subxt metadata -f=bytes --url=http://127.0.0.1:9933 > metadata/custom.scale
      
      See docs for that tool.
    3. generate sources: subxt codegen -f ./metadata.scale | rustfmt --emit=stdout > metadata.rs
    4. replace client/gen/pontem.rs with generated code and build with feature runtime-pontem or
    5. put generated to client/gen/custom.rs (rel to root of paratesting) currently planned but not implemented yet.
    6. pub metadata.scale to metadata/custom.scale and build with feature runtime-custom
  2. Build with ^mentioned feature

Dynamic (any) runtime types and metadata support without rebuild requirement are planned and probably will.

Tests

There are two kinds of tests:

  • standard tests with cargo test --all
  • system tests, run cargo run -- -i tests/assets

paratesting's People

Contributors

boozook avatar borispovod avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.