Add --no-clone-dependencies init script argument.
Summary: Add --no-clone-dependencies init script argument. Reviewers: matej.gradicek Reviewed By: matej.gradicek Subscribers: buda Differential Revision: https://phabricator.memgraph.io/D136
This commit is contained in:
parent
d8a33fc667
commit
eff4db5b27
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@
|
||||
*~
|
||||
*.pyc
|
||||
ve3/
|
||||
tests/
|
||||
|
27
init
27
init
@ -1,5 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# read arguments
|
||||
clone_dependencies=true
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
case $key in
|
||||
--no-clone-dependencies)
|
||||
clone_dependencies=false
|
||||
shift # past argument
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
shift # past argument
|
||||
done
|
||||
|
||||
# exit if any subcommand returns a non-zero status
|
||||
set -e
|
||||
|
||||
@ -18,19 +35,25 @@ done
|
||||
|
||||
# clean tests folder
|
||||
tests_folder=${script_dir}/tests
|
||||
rm -rf ${tests_folder}/*
|
||||
mkdir -p ${tests_folder}
|
||||
|
||||
# clone dressipi's tests
|
||||
cd ${tests_folder}
|
||||
if ${clone_dependencies} ; then
|
||||
rm -rf ${tests_folder}/*
|
||||
git clone https://phabricator.memgraph.io/source/pilot_dressipi.git
|
||||
fi
|
||||
|
||||
# clean dbms folder
|
||||
dbms_folder=${script_dir}/dbms
|
||||
rm -rf ${dbms_folder}/*
|
||||
mkdir -p ${dbms_folder}
|
||||
|
||||
# clone memgraph & checkout right commit
|
||||
cd ${dbms_folder}
|
||||
if ${clone_dependencies} ; then
|
||||
rm -rf ${dbms_folder}/*
|
||||
git clone https://phabricator.memgraph.io/diffusion/MG/memgraph.git
|
||||
fi
|
||||
memgraph_folder=${dbms_folder}/memgraph
|
||||
cd ${memgraph_folder}
|
||||
git checkout dev
|
||||
|
@ -5,7 +5,7 @@ Flask==0.12
|
||||
itsdangerous==0.24
|
||||
Jinja2==2.9.5
|
||||
MarkupSafe==1.0
|
||||
neo4j-driver==1.1.2
|
||||
neo4j-driver==1.0.2
|
||||
packaging==16.8
|
||||
parse==1.8.0
|
||||
parse-type==0.3.4
|
||||
|
42
run
42
run
@ -1,5 +1,22 @@
|
||||
#!/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
|
||||
|
||||
@ -11,19 +28,21 @@ 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}/tests/pilot_dressipi
|
||||
cd ${script_dir}
|
||||
# setup ve
|
||||
if [ ! -d "ve3" ]; then
|
||||
virtualenv -p python3 ve3
|
||||
source ve3/bin/activate
|
||||
pip3 install -r requirements.txt
|
||||
fi
|
||||
source ve3/bin/activate
|
||||
|
||||
# binary is available after the build
|
||||
binary_name=$(find ${memgraph_build_dir}/ -maxdepth 1 -executable -name "memgraph*")
|
||||
@ -32,18 +51,25 @@ 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
|
||||
source ve3/bin/activate
|
||||
cd ${script_dir}/tests/pilot_dressipi
|
||||
python run.py
|
||||
exit_code=$?
|
||||
if [[ ${exit_code} != 0 ]]; then
|
||||
cleanup_and_exit ${exit_code}
|
||||
fi
|
||||
|
||||
# cleanup
|
||||
pkill -9 -f "${binary_name}"
|
||||
|
||||
# return test status
|
||||
exit $exit_code
|
||||
# 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}
|
||||
|
@ -34,9 +34,8 @@ def set_logging(context):
|
||||
def create_db_driver(context):
|
||||
uri = context.config.database_uri
|
||||
auth_token = basic_auth(context.config.database_username, context.config.database_password)
|
||||
if context.config.database == "neo4j":
|
||||
driver = GraphDatabase.driver(uri, auth=auth_token)
|
||||
if context.config.database == "neo4j" or context.config.database == "memgraph":
|
||||
driver = GraphDatabase.driver(uri, auth=auth_token, encrypted=0)
|
||||
else:
|
||||
#Memgraph
|
||||
pass
|
||||
raise "Unsupported database type"
|
||||
return driver
|
||||
|
Loading…
Reference in New Issue
Block a user