lite-rpc/test.bash

30 lines
595 B
Bash
Raw Normal View History

2023-04-04 04:18:50 -07:00
#!/bin/bash
# kill background jobs on exit/failure
trap 'kill $(jobs -pr)' SIGINT SIGTERM EXIT
echo "Doing an early build"
2023-09-19 04:50:05 -07:00
cargo build --bin lite-rpc --tests
2023-04-04 04:28:12 -07:00
yarn
2023-04-04 04:18:50 -07:00
echo "Switching to local lite-rpc rpc config"
solana config set --url "http://0.0.0.0:8899"
echo "Starting the test validator"
solana-test-validator &
2023-04-14 05:57:11 -07:00
echo "Air Dropping 10000 sol"
2023-04-04 04:18:50 -07:00
sleep 20 && solana airdrop 10000
echo "Starting LiteRpc"
2023-09-19 04:50:05 -07:00
cargo run --bin lite-rpc &
2023-04-04 04:18:50 -07:00
echo "Running cargo tests in 20s"
sleep 20 && cargo test
echo "Running yarn tests"
yarn test
echo "Done. Killing background jobs"
2023-04-14 05:57:11 -07:00
kill "$(jobs -p)" || true