#!/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 cd ${memgraph_build_dir} if ${memgraph_compile} ; then 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 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 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}