forked from bblfsh/python-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration_test.sh
More file actions
executable file
·22 lines (20 loc) · 849 Bytes
/
integration_test.sh
File metadata and controls
executable file
·22 lines (20 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
echo "Running integration test... this usually takes about 30 seconds"
cd test 2> /dev/null
PY3PKGDIR=`python3 -c "import os, sys;sys.stdout.write(os.path.dirname(os.__file__))"`
PY2PKGDIR=`python2 -c "import os, sys;sys.stdout.write(os.path.dirname(os.__file__))"`
./sendmsg.py $PY2PKGDIR/*.py $PY3PKGDIR/*.py|python3 -m python_driver > integration_output.json
CMDOUT=$?
cat integration_output.json | egrep '"status": "(error|fatal)"' > /dev/null
EGREPOUT=$?
if [ $CMDOUT -ne 0 ] || [ $EGREPOUT -eq 0 ]
then
echo "The integration test failed. Some produced JSON outputs contain fatal" \
"or error status"
echo "Batch file parse output status: $CMDOUT"
echo "Grep for errors output status (1 == no error or fatal matches): $EGREPOUT"
exit 1
else
echo "Integration test completed successfully"
exit 0
fi