-
Notifications
You must be signed in to change notification settings - Fork 75
/
test-ets.sh
executable file
·50 lines (39 loc) · 1.19 KB
/
test-ets.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
#!/usr/bin/env bash
git submodule init
git submodule update
echo "booting Mantis and waiting for RPC API to be up"
$SBT -Dconfig.file=./src/main/resources/conf/testmode.conf run &> mantis-log.txt &
while ! nc -z localhost 8546; do
sleep 0.1
done
final_exit_code=0
function run_and_annotate {
echo "running retesteth $1"
timeout 15m ets/retesteth -t "$1" -- --verbosity 3 &> "retesteth-$1-log.txt"
exit_code=$?
echo "retesteth $1 exit code: $exit_code"
style="info"
if [[ "$exit_code" -gt "0" ]]; then
final_exit_code="$exit_code"
style="error"
fi
summary=$(sed -n '/Total Tests Run/,$p' "retesteth-$1-log.txt")
if [[ -z "$summary" ]]; then
summary="retesteth crashed; check the artifacts"
fi
passed=$(grep -oP 'Total Tests Run: \d+' "retesteth-$1-log.txt")
failed=$(grep -oP 'TOTAL ERRORS DETECTED: \d+' "retesteth-$1-log.txt")
cat <<EOF | buildkite-agent annotate --context "retesteth-$1" --style "$style"
<details>
<summary>retesteth: $1 -- $passed -- $failed</summary>
<pre class="term"><code>
$summary
</code></pre>
</details>
EOF
}
run_and_annotate "GeneralStateTests"
run_and_annotate "BlockchainTests"
echo "shutting down mantis"
kill %1
exit $final_exit_code