a1be0d5ad7
Reviewers: mferencevic, matej.gradicek, buda Reviewed By: buda Differential Revision: https://phabricator.memgraph.io/D225
65 lines
1.6 KiB
Bash
Executable File
65 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# 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
|
|
|
|
# setup dressipi
|
|
cd ${script_dir}
|
|
# setup ve
|
|
if [ ! -d "ve3" ]; then
|
|
virtualenv -p python3 ve3
|
|
fi
|
|
source ve3/bin/activate
|
|
pip3 install --upgrade pip
|
|
pip3 install -r requirements.txt
|
|
|
|
cd ${memgraph_build_dir}
|
|
# binary is available after the build
|
|
binary_name=$(find ${memgraph_build_dir}/ -maxdepth 1 -executable -name "memgraph*")
|
|
|
|
# get full path to memgraph config for hardcoded queries
|
|
hardcoded_queries_config_path="${memgraph_src_dir}/config/hardcoded_queries_memgraph.yaml"
|
|
# run memgraph
|
|
MEMGRAPH_CONFIG=${hardcoded_queries_config_path} ${binary_name} &
|
|
|
|
function cleanup_and_exit {
|
|
pkill -9 -f "${binary_name}"
|
|
exit $1
|
|
}
|
|
|
|
# the script has to be careful 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
|
|
|
|
# kill memgraph for hardcoded queries
|
|
pkill -9 -f "${binary_name}"
|
|
# get full path to memgraph config for interpreted queries
|
|
config_path="${memgraph_src_dir}/config/memgraph.yaml"
|
|
# run memgraph
|
|
MEMGRAPH_CONFIG=${config_path} ${binary_name} &
|
|
|
|
# run custom scenarios
|
|
cd ${script_dir}
|
|
python tck_engine/test_executor.py \
|
|
--root tck_engine/tests/memgraph_V1/features \
|
|
--graphs-root tck_engine/tests/memgraph_V1/graphs \
|
|
--no-side-effects \
|
|
--db memgraph
|
|
cleanup_and_exit ${exit_code}
|