diff --git a/init b/init index b0fa6e4ea..dd49f85f0 100755 --- a/init +++ b/init @@ -111,22 +111,10 @@ if [[ "$setup_libs" == "true" ]]; then cd .. fi -# setup gql_behave dependencies -setup_virtualenv tests/gql_behave - -# setup stress dependencies -setup_virtualenv tests/stress - -# setup integration/ldap dependencies -setup_virtualenv tests/integration/ldap - # Setup tests dependencies. -# cd tests -# ./setup.sh -# cd .. -# TODO(gitbuda): Remove setup_virtualenv, replace it with tests/ve3. Take care -# of the build order because tests/setup.py builds pymgclient which depends on -# mgclient which is build after this script by calling make. +cd tests +./setup.sh +cd .. echo "Done installing dependencies for Memgraph" diff --git a/libs/setup.sh b/libs/setup.sh index 6a73f65d1..ab98d4929 100755 --- a/libs/setup.sh +++ b/libs/setup.sh @@ -122,6 +122,7 @@ declare -A primary_urls=( ["protobuf"]="http://$local_cache_host/git/protobuf.git" ["pulsar"]="http://$local_cache_host/git/pulsar.git" ["librdtsc"]="http://$local_cache_host/git/librdtsc.git" + ["gqlalchemy"]="http://$local_cache_host/git/gqlalchemy.git" ) # The goal of secondary urls is to have links to the "source of truth" of @@ -147,6 +148,7 @@ declare -A secondary_urls=( ["protobuf"]="https://github.com/protocolbuffers/protobuf.git" ["pulsar"]="https://github.com/apache/pulsar.git" ["librdtsc"]="https://github.com/gabrieleara/librdtsc.git" + ["gqlalchemy"]="http://github.com/memgraph/gqlalchemy.git" ) # antlr @@ -199,7 +201,7 @@ git apply ../rocksdb.patch popd # mgclient -mgclient_tag="96e95c6845463cbe88948392be58d26da0d5ffd3" # (2022-02-08) +mgclient_tag="v1.3.0" # (2022-02-08) repo_clone_try_double "${primary_urls[mgclient]}" "${secondary_urls[mgclient]}" "mgclient" "$mgclient_tag" sed -i 's/\${CMAKE_INSTALL_LIBDIR}/lib/' mgclient/src/CMakeLists.txt @@ -238,3 +240,10 @@ repo_clone_try_double "${primary_urls[librdtsc]}" "${secondary_urls[librdtsc]}" pushd librdtsc git apply ../librdtsc.patch popd + +#gqlalchemy +gqlalchemy_tag="v1.2.0" +repo_clone_try_double "${primary_urls[gqlalchemy]}" "${secondary_urls[gqlalchemy]}" "gqlalchemy" "$gqlalchemy_tag" true +pushd gqlalchemy +git apply ../gqlalchemy.patch +popd diff --git a/tests/gql_behave/continuous_integration b/tests/gql_behave/continuous_integration index 8fb6c2fcb..31f8ad80a 100755 --- a/tests/gql_behave/continuous_integration +++ b/tests/gql_behave/continuous_integration @@ -22,7 +22,7 @@ import subprocess import tempfile import yaml -from gqlalchemy import wait_for_port +from gqlalchemy import wait_for_port, MemgraphInstanceBinary SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) @@ -76,41 +76,6 @@ def generate_result_html(data): return ret -class MemgraphRunner(): - def __init__(self, build_directory): - self.build_directory = build_directory - self.proc_mg = None - self.args = [] - - def start(self, args=[]): - if args == self.args and self.is_running(): - return - - self.stop() - self.args = copy.deepcopy(args) - - self.data_directory = tempfile.TemporaryDirectory() - memgraph_binary = os.path.join(self.build_directory, "memgraph") - args_mg = [memgraph_binary, "--storage-properties-on-edges", - "--data-directory", self.data_directory.name] - self.proc_mg = subprocess.Popen(args_mg + self.args) - wait_for_port(port=7687, delay=1) - assert self.is_running(), "The Memgraph process died!" - - def is_running(self): - if self.proc_mg is None: - return False - if self.proc_mg.poll() is not None: - return False - return True - - def stop(self): - if not self.is_running(): - return - self.proc_mg.terminate() - code = self.proc_mg.wait() - assert code == 0, "The Memgraph process exited with non-zero!" - def main(): # Parse args @@ -130,7 +95,7 @@ def main(): output_dir = tempfile.TemporaryDirectory() # Memgraph runner - memgraph = MemgraphRunner(args.build_directory) + memgraph = MemgraphInstanceBinary(args.build_directory) @atexit.register def cleanup(): diff --git a/tests/setup.sh b/tests/setup.sh index a74ee6ff9..0893baa9c 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -6,12 +6,14 @@ set -Eeuo pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PIP_DEPS=( "behave==1.2.6" + "gqlalchemy==1.2.0" "ldap3==2.6" "kafka-python==2.0.2" "requests==2.25.1" "neo4j-driver==4.1.1" "parse==1.18.0" "parse-type==0.5.2" + "pymgclient=1.2.0" "pytest==6.2.3" "pyyaml==5.4.1" "six==1.15.0" @@ -46,12 +48,4 @@ for pkg in "${PIP_DEPS[@]}"; do pip --timeout 1000 install "$pkg" done -# Install mgclient from source becasue of full flexibility. -pushd "$DIR/../libs/pymgclient" > /dev/null -export MGCLIENT_INCLUDE_DIR="$DIR/../libs/mgclient/include" -export MGCLIENT_LIB_DIR="$DIR/../libs/mgclient/lib" -CFLAGS="-std=c99" python3 setup.py build -CFLAGS="-std=c99" python3 setup.py install -popd > /dev/null - deactivate