forked from MinaProtocol/mina
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient-sdk-unit-tests.sh
More file actions
executable file
·36 lines (27 loc) · 961 Bytes
/
client-sdk-unit-tests.sh
File metadata and controls
executable file
·36 lines (27 loc) · 961 Bytes
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
#!/bin/bash
set -eo pipefail
# run client SDK tests in node
echo "Building client SDK..."
source ~/.profile
make client_sdk
echo "Running unit tests in Javascript"
node src/app/client_sdk/tests/run_unit_tests.js
# the Rosetta encodings are not part of the client SDK as such,
# but the SDK relies on them, so it's reasonable to compare
# the encodings here, rather than create another CI test
# native/consensus
echo "Building consensus native code for encodings..."
make rosetta_lib_encodings
echo "Running"
./_build/default/src/lib/rosetta_lib/test/test_encodings.exe > encodings.consensus
# js/nonconsensus
echo "Building nonconsensus Javascript code for encodings..."
make client_sdk
echo "Running"
node src/app/client_sdk/tests/test_encodings.js > encodings.js.nonconsensus
diff encodings.consensus encodings.js.nonconsensus
if [ $? -ne 0 ]; then
echo "Consensus and Javascript code generate different encodings";
exit 1
fi
echo "SUCCESS"