-
Notifications
You must be signed in to change notification settings - Fork 118
/
run-ci-live-tests.sh
executable file
·72 lines (66 loc) · 1.48 KB
/
run-ci-live-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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
set -o pipefail
# Function to add a prefix to each direct line of output
add_prefix() {
local prefix=$1
while IFS= read -r line; do
echo "$prefix : $line"
done
}
echo ""
echo "Running integration tests against the real Mina network."
echo ""
./run src/examples/zkapps/hello-world/run-live.ts --bundle | add_prefix "HELLO_WORLD" &
HELLO_WORLD_PROC=$!
./run src/examples/zkapps/reducer/run-live.ts --bundle | add_prefix "REDUCER" &
REDUCER_FLOW_PROC=$!
./run src/examples/zkapps/dex/run-live.ts --bundle | add_prefix "DEX" &
DEX_PROC=$!
./run src/examples/fetch-live.ts --bundle | add_prefix "FETCH" &
FETCH_PROC=$!
./run src/tests/transaction-flow.ts --bundle | add_prefix "TRANSACTION_FLOW" &
TRANSACTION_FLOW_PROC=$!
# Wait for each process and capture their exit statuses
FAILURE=0
wait $HELLO_WORLD_PROC
if [ $? -ne 0 ]; then
echo ""
echo "HELLO_WORLD test failed."
echo ""
FAILURE=1
fi
wait $DEX_PROC
if [ $? -ne 0 ]; then
echo ""
echo "DEX test failed."
echo ""
FAILURE=1
fi
wait $FETCH_PROC
if [ $? -ne 0 ]; then
echo ""
echo "FETCH test failed."
echo ""
FAILURE=1
fi
wait $TRANSACTION_FLOW_PROC
if [ $? -ne 0 ]; then
echo ""
echo "TRANSACTION_FLOW test failed."
echo ""
FAILURE=1
fi
wait $REDUCER_FLOW_PROC
if [ $? -ne 0 ]; then
echo ""
echo "REDUCER_FLOW test failed."
echo ""
FAILURE=1
fi
# Exit with failure if any process failed
if [ $FAILURE -ne 0 ]; then
exit 1
fi
echo ""
echo "All tests completed successfully."
echo ""