Merge pull request #109 from blockworks-foundation/test_bash

bash script for testing
This commit is contained in:
galactus 2023-04-14 18:01:14 +02:00 committed by GitHub
commit 4156abc708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 7 deletions

View File

@ -43,10 +43,4 @@ jobs:
- name: Run and Test
run: |
sh -c "solana-test-validator" &
sleep 20 && solana airdrop 10000
cargo run &
sleep 20 && cargo test
yarn test
pkill lite-rpc
kill $(jobs -p)
bash ./test.bash

29
test.bash Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# kill background jobs on exit/failure
trap 'kill $(jobs -pr)' SIGINT SIGTERM EXIT
echo "Doing an early build"
cargo build --workspace --tests
yarn
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 &
echo "Air Dropping 10000 sol"
sleep 20 && solana airdrop 10000
echo "Starting LiteRpc"
cargo run &
echo "Running cargo tests in 20s"
sleep 20 && cargo test
echo "Running yarn tests"
yarn test
echo "Done. Killing background jobs"
kill "$(jobs -p)" || true