2018-08-22 22:05:38 +08:00
|
|
|
#!/bin/bash -e
|
2017-06-12 17:29:46 +08:00
|
|
|
|
2018-08-22 22:05:38 +08:00
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
cd "$DIR"
|
2017-06-12 17:29:46 +08:00
|
|
|
|
|
|
|
# system check
|
2018-08-22 22:05:38 +08:00
|
|
|
if ! which virtualenv >/dev/null; then
|
2017-06-12 17:29:46 +08:00
|
|
|
echo "Please install virtualenv!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# setup virtual environment
|
|
|
|
if [ ! -d "ve3" ]; then
|
2018-08-22 22:05:38 +08:00
|
|
|
# Driver downloaded from: https://pypi.org/project/neo4j-driver/1.5.3/
|
|
|
|
wget -nv http://deps.memgraph.io/drivers/python/neo4j-driver-1.5.3.tar.gz -O neo4j-driver.tar.gz || exit 1
|
|
|
|
tar -xzf neo4j-driver.tar.gz || exit 1
|
|
|
|
mv neo4j-driver-1.5.3 neo4j-driver || exit 1
|
2017-07-13 02:17:26 +08:00
|
|
|
virtualenv -p python3 ve3 || exit 1
|
2018-08-22 22:05:38 +08:00
|
|
|
source ve3/bin/activate
|
|
|
|
cd neo4j-driver
|
|
|
|
python3 setup.py install || exit 1
|
|
|
|
cd ..
|
|
|
|
deactivate
|
|
|
|
rm -rf neo4j-driver neo4j-driver.tar.gz || exit 1
|
2017-06-12 17:29:46 +08:00
|
|
|
fi
|
2018-08-22 22:05:38 +08:00
|
|
|
|
|
|
|
# activate virtualenv
|
2017-06-12 17:29:46 +08:00
|
|
|
source ve3/bin/activate
|
|
|
|
|
|
|
|
# execute test
|
2018-08-22 22:05:38 +08:00
|
|
|
python3 basic.py || exit 1
|
|
|
|
python3 max_query_length.py || exit 1
|
|
|
|
python3 transactions.py || exit 1
|