Test guide
June 28, 2023 ยท View on GitHub
Unit test
Preparation
- Install
- Rust toolchain
Test
- Go to the root directory of this repository and run
cargo test
Integration test
Preparation
- Install
- Rust toolchain
- Docker
- Docker Compose
- Download
- Addition
- Move the downloads to the
test/integration/datadirectory - Ensure that no other programs are using ports
3000,8000, and9944
- Move the downloads to the
Basic test
- Go to the root directory of this repository
- Run
docker-compose -f test/integration/docker-compose.yml up -d - Run
cargo test --features node-test
Advance test
Configuration
- Open
test/integration/rococo.toml - Change the
para-idif you want to test with different id - Change the
leasesif you want to test with different lease(s) - Change to
watch-onlytotrueif you want to test without the bid components - Change the
typeto test different bidding type - Adjust the
upper-limitandincrementto test more situation if you want - Add some
webhooksto test the notification webhook component- You can use webhook.site, the result should be listed on the left of the website
- You can use any other webhook listener
- Edit the
mailto test the notification mail component- Add some
receivers - Add a
sender- Recommending using Gmail for testing
- Add
username, e.g. example@gmail.com - Add
password, e.g. app password
- Add some
Test
- Go to the root directory of this repository
- Run
docker-compose -f test/integration/docker-compose.yml down && rm -rf test/integration/data/db && docker-compose -f test/integration/docker-compose.yml up -dif you have run the basic test beforedocker-compose -f test/integration/docker-compose.yml up -dif you haven't run the basic test before
- Run
cargo run -- -c test/integration/rococo.toml - Open browser and navigate to Polkadot/Substrate Portal
- Optional for crowdloan
- Navigate to
Network tab -> Parachains tab -> Crowdloan tab -> Add fund button - Set
crowdfund caprecommend1000 UNIT - Set
ending blockrecommend1000 - Set
periodsrecommend(0, 0)
- Navigate to
- Navigate to
Developer tab -> Sudo tab -> auctions module -> newAuction call - Submit the new auction call, remember to uncheck the
use a proxy for this callin the pop-up window - A notification should appear in the webhook and mail to indicate the start of an auction
- Additionally, a notification regarding the initial bid should be included in both the webhook and mail
- Use
CharlieandDaveto bid for2001and2002and check the results- E.G.
Charliebid5 UNITfor(0, 0). Slothunter should bid7 UNITfor(0, 0)with the default configurationsDavebid1 UNITfor(1, 1)first, and thenCharliebid5 UNITfor(0, 1). Slothunter should bid11 UNITfor(0, 0)with the default configurations
- E.G.
- Wait until the auction ends, you should receive a notification via webhook and mail indicating that the auction has ended
Addition
- Default real account is
//Alice - Default proxy accounts are
//Alice/stashwithProxyType::Alland//BobwithProxyType::Auction - Default parachains and their owners are
(Alice, 2000),(Charlie, 2001)and(Dave, 2002)
All of this data is pre-set and was built from Polkadot's latest rococo-local chain with the assistance of Subalfred fork-off.