-
Notifications
You must be signed in to change notification settings - Fork 12
/
chopsticks_tests.sh
50 lines (33 loc) · 1.08 KB
/
chopsticks_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
echo "Starting Chopsticks tests :)"
SELECTED_NAME=""
# Check if a name was passed as an argument
if [ $# -gt 0 ]; then
SELECTED_NAME="$1"
fi
# Load chains data from the chains.json file
CHAINS=$(jq -c '.chains[]' "chains.json")
cd PlutoWalletTests
# Loop through all chains
echo "$CHAINS" | while read -r chain; do
# Extract the name and websocket values from the current chain object
NAME=$(echo "$chain" | jq -r '.name')
# skip other chains, generate only the selected name chain
if [ "$SELECTED_NAME" != "" ]; then
if [ "$SELECTED_NAME" != $NAME ]; then
continue
fi
fi
echo "Starting chopsticks for: "$NAME
# Prepare data to be used as parameter
WEBSOCKET=$(echo "$chain" | jq -r '.websocket')
npx @acala-network/chopsticks@latest --endpoint=$WEBSOCKET &
PID=$!
echo "Now running actual tests :)))"
dotnet test --filter "FullyQualifiedName~PlutoWalletTests.TransferTests"
echo "dotnet test finished"
# Kill the process using its PID
kill $PID
# Optionally, wait for the process to stop
wait $PID
echo "Chopsticks stopped"
done