Note
This folder contains a set of functional tests designed for Moonbeam network. It is written in typescript, using the Moonwall framework.
smoke: Read-only tests that execute against live networks, primarily to verify state consistency and invariant conditions.dev: Tests that execute a single local dev node, using PolkadotJs / Ethers.js / Web3.js, to check the runtime and client in a relatively end-to-end manner.chopsticks: Tests that use the Chopsticks framework to execute simulations of the state transition function against live state values - but in a sandboxed local environment.para: Tests that use the ZombieNet framework to verify Moonbeam in the context of a parachain connected to a relay chain, and other topologies.
Note
PNPM is the package manager of choice for this repo, due to its superior handling of heavily nested dependencies.
There are various ways to install it, but perhaps the easiest is sudo npm -g i pnpm
Build the node before running tests (metadata-hash feature is required to run /test-transaction/test-transaction-with-metadata-hash.ts):
cargo build --release --features metadata-hash
Always install and update the package dependencies:
cd test
pnpm i Launch the CLI:
pnpm moonwallExecute all dev tests:
pnpm moonwall test dev_moonbaseExecute a single test:
pnpm moonwall test dev_moonbase <test_case_id>Execute a single test and keep node running:
pnpm moonwall run dev_moonbase <test_case_id>Downloading the latest polkadot binary:
pnpm moonwall download polkadot latestRunning a chopsticks forked Moonbeam network:
pnpm moonwall run upgrade_moonbeamRunning a particular smoke test:
pnpm moonwall test smoke_moonbeam S100Rename all prefixes for a suite (to keep them consistent)
pnpm moonwall derive <suite_root_dir> Note
For a full list of test environments and suites available, inspect the moonwall.config.json file.
Alternatively, use the CLI to browse networks and tests available.