First version of external integration test.

Summary: First version of external integration test.

Reviewers: matej.gradicek, dgleich, teon.banek, mferencevic

Reviewed By: mferencevic

Subscribers: buda

Differential Revision: https://phabricator.memgraph.io/D81
This commit is contained in:
Marko Budiselic 2017-03-07 12:44:40 +01:00
parent d920d40800
commit 6f87588214
6 changed files with 114 additions and 0 deletions

5
.arcconfig Normal file
View File

@ -0,0 +1,5 @@
{
"project_id" : "memgraph",
"conduit_uri" : "https://phabricator.memgraph.io",
"phabricator_uri" : "https://phabricator.memgraph.io"
}

View File

@ -1 +1,12 @@
# Memgraph quality assurance
In order to test dressipi's queries agains memgraph the following commands have
to be executed:
1. ./init [Dxyz] # downloads query implementations + memgraph
# (the auth is manually for now) + optionally user can
# define arcanist diff which will be applied on the
# memgraph source code
2. ./run # compiles and runs database instance, also runs the
# test queries
TODO: automate further

2
dbms/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

45
init Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
# exit if any subcommand returns a non-zero status
set -e
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# optional argument; if diff_id exists arcanist patch will be applied
arcanist_diff_id=${1:-""}
# install all dependencies on debian based operating systems
for pkg in git arcanist python3-virtualenv python3-pip; do
dpkg -s $pkg 2>/dev/null >/dev/null || sudo apt-get -y install $pkg
done
# TODO: use pullbot and read a password from program arg or env var
# (in order to use this script inside CI infrastructure)
# clean tests folder
tests_folder=${script_dir}/tests
rm -rf ${tests_folder}/*
# clone dressipi's tests
cd ${tests_folder}
git clone https://phabricator.memgraph.io/source/pilot_dressipi.git
# clean dbms folder
dbms_folder=${script_dir}/dbms
rm -rf ${dbms_folder}/*
# clone memgraph & checkout right commit
cd ${dbms_folder}
git clone https://phabricator.memgraph.io/diffusion/MG/memgraph.git
memgraph_folder=${dbms_folder}/memgraph
cd ${memgraph_folder}
git checkout dev
# optionally apply arcanist patch
if [[ ! -z ${arcanist_diff_id} ]]; then
# nocommit is here because arc tries to commit the patch
# and it fails if user isn't set (inside CI infrastructure the user
# probably won't be defined because CI infrastructure doesn't push
# any code back to the repository)
arc parch ${arcanist_diff_id} --nocommit
fi
./init

49
run Executable file
View File

@ -0,0 +1,49 @@
#!/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
# compile memgraph
cd ${memgraph_build_dir}
cmake ..
make -j8
make copy_hardcoded_queries
# setup dressipi
cd ${script_dir}/tests/pilot_dressipi
# setup ve
if [ ! -d "ve3" ]; then
virtualenv -p python3 ve3
source ve3/bin/activate
pip3 install -r requirements.txt
fi
# 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} &
# the script has to be carefull because one process has been detached
set +e
## run tests
# run Dressipi test
source ve3/bin/activate
python run.py
exit_code=$?
# cleanup
pkill -9 -f "${binary_name}"
# return test status
exit $exit_code

2
tests/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore