Testing
May 23, 2023 ยท View on GitHub
Genesis DAO features three ways of ensuring quality assurance via testing:
- Unit tests on a per-pallet basis
- Integration tests using an external substrate client to run against a docker container
- Manual testing on the UI/Frontend
Unit tests
The unit tests are packaged per pallet.
While the suite is still under development all features submitted as part of a Milestone Proposal are fully tested.
From the root directory of the node, you can test all custom pallets of ours by running these lines:
cd pallets/dao-core && cargo test && cd ../..
cd pallets/dao-assets && cargo test && cd ../..
cd pallets/dao-votes && cargo test && cd ../..
Integration Tests
The integration-wrapper directory contains an integration test suite that
is utilizing the subxt substrate client. The test cases are located in the
tests folder - for the time being we have full integration tests for the
dao-core module.
The integration tests are running against our docker container.
Steps to run it:
- Run
docker compose upto start a docker container with the node - Wait until all dependencies are installed and the node starts producing blocks
- Enter the
integration-wrapperdirectory and runcargo test
Service
The user interface is available at genesis-dao.org. The backend service documentation is available here. Our testnet node is available here.
Running the node from source
Compile & run the node by either
- using
cargo release --dev --features local-node && ./target/release/genesis-dao --dev - or running
docker compose up
Afterwards navigate to to the respective port config on Polkadot.js.org and test the intrinsics.
Running the interface from source
There are again, different ways of running this - with docker or without.
Dockerized:
- Within the node directory run
docker compose upand wait for the node to produce blocks - Add the node to a local network using
docker network create genesis && docker network connect genesis genesis-dao - Run
docker network inspect genesis | grep Gatewayand add the IP address to the.envfile of the frontend repository - Run
docker compose upin the frontend repository and visit the interface atlocalhost:3000
Running the frontend locally:
- Start the node by either compiling or with docker.
- Run
yarn && yarn devin the frontend repository and visit the interface atlocalhost:3000