blockchainsubstratesystem-testingpolkadot

How do you write a system test for your runtime?


Hi I am developing a runtime using Substrate-FRAME and I would like to know how can I write a system test for my runtime?

The main purpose of writing a system test is to ensure that the final build is fulfilling all of the required specifications and also to ensure nothing is compromised on a runtime upgrade. The idea for me is something similar to point no. 2 mentioned in this thread.

Any documentation regarding this type of tests would be greatly helpful.

Update:

I ended up using py-substrate-interface to make test scenarios. Now I can automatically deploy nodes to form a network (thanks to Python) and run my custom system test scenarios. Very useful tool for developing runtimes in Substrate.


Solution

  • There is an overview here on the DevHub

    And there are examples throughout substrate that include tests.rs and mock.rs files to use as reference.

    If you have not already, checkout the create a pallet tutorial and the recipes all have some tasty examples to look at for these as well.