535a947026
Summary: KPI service docker file. Reviewers: matej.gradicek Reviewed By: matej.gradicek Subscribers: matej.gradicek Differential Revision: https://phabricator.memgraph.io/D140
77 lines
1.6 KiB
Bash
Executable File
77 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# read arguments
|
|
memgraph_compile=true
|
|
while [[ $# -gt 0 ]]
|
|
do
|
|
key="$1"
|
|
case $key in
|
|
--no-memgraph-compile)
|
|
memgraph_compile=false
|
|
shift # past argument
|
|
;;
|
|
*)
|
|
# unknown option
|
|
;;
|
|
esac
|
|
shift # past argument
|
|
done
|
|
|
|
# exit if any subcommand returns a non-zero status
|
|
set -e
|
|
|
|
## build memgraph
|
|
|
|
# save the path where this script is
|
|
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
memgraph_src_dir=${script_dir}/dbms/memgraph
|
|
memgraph_build_dir=${script_dir}/dbms/memgraph/build
|
|
|
|
# compile memgraph
|
|
if ${memgraph_compile} ; then
|
|
cd ${memgraph_build_dir}
|
|
cmake ..
|
|
make -j8
|
|
make copy_hardcoded_queries
|
|
fi
|
|
|
|
# setup dressipi
|
|
cd ${script_dir}
|
|
# setup ve
|
|
if [ ! -d "ve3" ]; then
|
|
virtualenv -p python3 ve3
|
|
fi
|
|
source ve3/bin/activate
|
|
pip3 install --upgrade pip3
|
|
pip3 install -r requirements.txt
|
|
|
|
# binary is available after the build
|
|
binary_name=$(find ${memgraph_build_dir}/ -maxdepth 1 -executable -name "memgraph*")
|
|
# get full path to memgraph config
|
|
config_path="${memgraph_src_dir}/config/memgraph.yaml"
|
|
# run memgraph
|
|
MEMGRAPH_CONFIG=${config_path} ${binary_name} &
|
|
|
|
function cleanup_and_exit {
|
|
pkill -9 -f "${binary_name}"
|
|
exit $1
|
|
}
|
|
|
|
# the script has to be carefull because one process has been detached
|
|
set +e
|
|
|
|
## run tests
|
|
|
|
# run Dressipi test
|
|
cd ${script_dir}/tests/pilot_dressipi
|
|
python run.py
|
|
exit_code=$?
|
|
if [[ ${exit_code} != 0 ]]; then
|
|
cleanup_and_exit ${exit_code}
|
|
fi
|
|
|
|
# run TCK test
|
|
cd ${script_dir}
|
|
python tck_engine/test_executor.py --root tck_engine/tests/openCypher_M05/tck/features --no-side-effects --db memgraph
|
|
cleanup_and_exit ${exit_code}
|