diff --git a/smoke-release-testing/experiment.bash b/smoke-release-testing/experiment.bash index 3fe7d4f02..84ca44e8d 100755 --- a/smoke-release-testing/experiment.bash +++ b/smoke-release-testing/experiment.bash @@ -10,8 +10,8 @@ echo "Waiting for memgraph to initialize..." wait_for_memgraph $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT echo "Memgraph is up and running!" -source ./mgconsole/vector_search.bash -test_vector_search $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT +source ./mgconsole/user_profiles.bash +test_user_profiles $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT # NOTE: Test what's the exit status of the script by using `echo $?`: # * if it's == 0 -> all good diff --git a/smoke-release-testing/mgconsole/auth_roles.bash b/smoke-release-testing/mgconsole/auth_roles.bash index 7cf24846c..726af9f69 100755 --- a/smoke-release-testing/mgconsole/auth_roles.bash +++ b/smoke-release-testing/mgconsole/auth_roles.bash @@ -3,42 +3,17 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_show_database_settings() { - __host="$1" - __port="$2" - echo "SHOW DATABASE SETTINGS;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + echo "FEATURE: Show Database Settings" + run_next_admin "SHOW DATABASE SETTINGS;" } test_auth_roles() { - __host="$1" - __port="$2" echo "FEATURE: Auth Roles" - - echo "CREATE ROLE IF NOT EXISTS test_reader;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "SHOW ROLES;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next_admin "CREATE ROLE IF NOT EXISTS test_reader;" + run_next_admin "SHOW ROLES;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then - # NOTE: Take a look at session_trace.bash for the v1 implementation of binary-docker picker. - trap cleanup_memgraph_binary_processes EXIT # To make sure cleanup is done. - set -e # To make sure the script will return non-0 in case of a failure. - - # NOTE: If you want to run custom memgraph binary just set MEMGRAPH_BUILD_PATH to your memgraph build directory. - run_memgraph_binary "--bolt-port $MEMGRAPH_DEFAULT_PORT --log-level=TRACE --log-file=mg_test_auth_roles_enterprise.logs --data-directory=test_auth_roles_enterprise" - wait_for_memgraph $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_DEFAULT_PORT - # test_show_database_settings $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_DEFAULT_PORT - test_auth_roles $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_DEFAULT_PORT - cleanup_memgraph_binary_processes - - rm -rf $MG_BUILD_PATH/test_auth_roles_enterprise/auth - ORIG_MEMGRAPH_ENTEPRISE_LICENSE="$MEMGRAPH_ENTERPRISE_LICENSE" - ORIG_MEMGRAPH_ORGANIZATION_NAME="$MEMGRAPH_ORGANIZATION_NAME" - unset MEMGRAPH_ENTERPRISE_LICENSE - unset MEMGRAPH_ORGANIZATION_NAME - # NOTE: License is not stored in settings. - run_memgraph_binary "--bolt-port 7688 --log-level=TRACE --log-file=mg_test_auth_roles_community.logs --data-directory=test_auth_roles_enterprise" - wait_for_memgraph $MEMGRAPH_DEFAULT_HOST 7688 - # test_show_database_settings $MEMGRAPH_DEFAULT_HOST 7688 - test_auth_roles $MEMGRAPH_DEFAULT_HOST 7688 - export MEMGRAPH_ENTERPRISE_LICENSE="$ORIG_MEMGRAPH_ENTEPRISE_LICENSE" - export MEMGRAPH_ORGANIZATION_NAME="$ORIG_MEMGRAPH_ORGANIZATION_NAME" + # A place to run tests using memgraph binary and debug issues directly. + echo "pass" fi diff --git a/smoke-release-testing/mgconsole/basic_auth.bash b/smoke-release-testing/mgconsole/basic_auth.bash index 75b29705b..250b66fd7 100755 --- a/smoke-release-testing/mgconsole/basic_auth.bash +++ b/smoke-release-testing/mgconsole/basic_auth.bash @@ -3,11 +3,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_basic_auth() { - __host="$1" - __port="$2" echo "FEATURE: Basic Authentication" - - echo "SHOW ACTIVE USERS INFO;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "SHOW ACTIVE USERS INFO;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then diff --git a/smoke-release-testing/mgconsole/durability.bash b/smoke-release-testing/mgconsole/durability.bash new file mode 100644 index 000000000..f3c5b84bb --- /dev/null +++ b/smoke-release-testing/mgconsole/durability.bash @@ -0,0 +1,19 @@ +#!/bin/bash +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "$SCRIPT_DIR/../utils.bash" + +test_durability() { + echo "FEATURE: Durability and Persistence" + + echo "SUBFEATURE: Create snapshot query" + run_next "CREATE SNAPSHOT;" + + echo "Durability testing completed successfully" +} + +if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then + # NOTE: Take a look at session_trace.bash for the v1 implementation of binary-docker picker. + trap cleanup_memgraph_binary_processes EXIT # To make sure cleanup is done. + set -e # To make sure the script will return non-0 in case of a failure. + run_memgraph_binary_and_test "--log-level=TRACE --log-file=mg_test_durability.logs" test_durability +fi diff --git a/smoke-release-testing/mgconsole/dynamic_algos.bash b/smoke-release-testing/mgconsole/dynamic_algos.bash index 94ec84910..1cc8298e4 100755 --- a/smoke-release-testing/mgconsole/dynamic_algos.bash +++ b/smoke-release-testing/mgconsole/dynamic_algos.bash @@ -3,9 +3,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_dynamic_algos() { - __host="$1" - __port="$2" echo "FEATURE: Dynamic Algorithms" - - echo "CALL mg.procedures() YIELD name;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port | grep "online" + run_next "CALL mg.procedures() YIELD name;" | grep "online" } diff --git a/smoke-release-testing/mgconsole/edge_type_operations.bash b/smoke-release-testing/mgconsole/edge_type_operations.bash index 13bcb5579..a2676e083 100755 --- a/smoke-release-testing/mgconsole/edge_type_operations.bash +++ b/smoke-release-testing/mgconsole/edge_type_operations.bash @@ -3,9 +3,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_edge_type_operations() { - __host="$1" - __port="$2" echo "FEATURE: Edge Type Operations" - - echo "WITH {my_edge_type: \"KNOWS\"} as x CREATE ()-[:x.my_edge_type]->() RETURN x; MATCH (n) DETACH DELETE n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "WITH {my_edge_type: \"KNOWS\"} as x CREATE ()-[:x.my_edge_type]->() RETURN x; MATCH (n) DETACH DELETE n;" } diff --git a/smoke-release-testing/mgconsole/expressions.bash b/smoke-release-testing/mgconsole/expressions.bash index f016b8217..16ad4a3b7 100755 --- a/smoke-release-testing/mgconsole/expressions.bash +++ b/smoke-release-testing/mgconsole/expressions.bash @@ -3,11 +3,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_or_expression_for_labels() { - __host="$1" - __port="$2" echo "FEATURE: OR expression for labels" - - echo "EXPLAIN MATCH (n:Label1|Label2) RETURN n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "EXPLAIN MATCH (n:Label1|Label2) RETURN n;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then diff --git a/smoke-release-testing/mgconsole/functions.bash b/smoke-release-testing/mgconsole/functions.bash index bea1ac9f0..0ba5620fd 100755 --- a/smoke-release-testing/mgconsole/functions.bash +++ b/smoke-release-testing/mgconsole/functions.bash @@ -3,12 +3,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_functions() { - __host="$1" - __port="$2" echo "FEATURE: Built-in functions" - # Added in v3.1. - echo "RETURN toSet([1, 2, 1]) AS a;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "RETURN length([1,2,3]) AS a;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CREATE (a), (b), (a)-[c:Type]->(b) RETURN project([a,b], [c]) AS x; MATCH (n) DETACH DELETE n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "RETURN toSet([1, 2, 1]) AS a;" + run_next "RETURN length([1, 2, 3]) AS a;" + run_next "CREATE (a), (b), (a)-[c:Type]->(b) RETURN project([a,b], [c]) AS x; MATCH (n) DETACH DELETE n;" } diff --git a/smoke-release-testing/mgconsole/ha.bash b/smoke-release-testing/mgconsole/ha.bash deleted file mode 100755 index cf4d45718..000000000 --- a/smoke-release-testing/mgconsole/ha.bash +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source "$SCRIPT_DIR/../utils.bash" - -test_ha_under_k8s() { - __host="$1" - __port="$2" - echo "FEATURE: High-availability Automatic Failover" - - echo "SHOW INSTANCES;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port -} - -if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then - # NOTE: Take a look at session_trace.bash for the v1 implementation of binary-docker picker. - # TODO(gitbuda): Run HA cluster here (at the moment manually run k8s.bash). - # TODO(gitbuda): Figure out how to properly port forward from the bash script. - # kubectl port-forward memgraph-coordinator-1-0 10000:7687 & - test_ha_under_k8s localhost 10000 -fi diff --git a/smoke-release-testing/mgconsole/impersonate.bash b/smoke-release-testing/mgconsole/impersonate.bash index d3ca53eb5..016761c7b 100755 --- a/smoke-release-testing/mgconsole/impersonate.bash +++ b/smoke-release-testing/mgconsole/impersonate.bash @@ -3,9 +3,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_impersonate_user() { - __host="$1" - __port="$2" echo "FEATURE: Impersonate User" - - echo "CREATE USER admin; GRANT IMPERSONATE_USER * TO admin;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next_admin "GRANT IMPERSONATE_USER * TO admin;" } diff --git a/smoke-release-testing/mgconsole/indices.bash b/smoke-release-testing/mgconsole/indices.bash index fd8c1bb10..f6854649b 100755 --- a/smoke-release-testing/mgconsole/indices.bash +++ b/smoke-release-testing/mgconsole/indices.bash @@ -3,22 +3,17 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_composite_indices() { - __host="$1" - __port="$2" echo "FEATURE: Label Property Composit Index" - - echo "CREATE INDEX ON :Label(prop1, prop2);" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CREATE (:Label {prop1:0, prop2: 1});" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "EXPLAIN MATCH (n:Label {prop1:0, prop2: 1}) RETURN n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port | grep -E "ScanAllByLabelProperties \(n :Label \{prop1, prop2\}\)" + run_next "CREATE INDEX ON :Label(prop1, prop2);" + run_next "CREATE (:Label {prop1:0, prop2: 1});" + run_next "EXPLAIN MATCH (n:Label {prop1:0, prop2: 1}) RETURN n;" | grep -E "ScanAllByLabelProperties \(n :Label \{prop1, prop2\}\)" + run_next "SHOW INDEXES;" } test_nested_indices() { - __host="$1" - __port="$2" echo "FEATURE: Nested Indices" - - echo "CREATE INDEX ON :Project(delivery.status.due_date);" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CREATE (:Project {delivery: {status: {due_date: date('2025-06-04'), milestone: 'v3.14'}}});" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "EXPLAIN MATCH (proj:Project) WHERE proj.delivery.status.due_date = date('2025-06-04') RETURN *;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port | grep -E "ScanAllByLabelProperties" - + run_next "CREATE INDEX ON :Project(delivery.status.due_date);" + run_next "CREATE (:Project {delivery: {status: {due_date: date('2025-06-04'), milestone: 'v3.14'}}});" + run_next "EXPLAIN MATCH (proj:Project) WHERE proj.delivery.status.due_date = date('2025-06-04') RETURN *;" | grep -E "ScanAllByLabelProperties" + run_next "SHOW INDEXES;" } diff --git a/smoke-release-testing/mgconsole/label_operations.bash b/smoke-release-testing/mgconsole/label_operations.bash index c1f6d3fc3..d94a7797a 100755 --- a/smoke-release-testing/mgconsole/label_operations.bash +++ b/smoke-release-testing/mgconsole/label_operations.bash @@ -3,9 +3,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_label_operations() { - __host="$1" - __port="$2" echo "FEATURE: Label Operations" - - echo "WITH {my_labels: [\"Label1\", \"Label2\"]} as x CREATE (n:x.my_labels) RETURN n; MATCH (n) DETACH DELETE n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "WITH {my_labels: [\"Label1\", \"Label2\"]} as x CREATE (n:x.my_labels) RETURN n; MATCH (n) DETACH DELETE n;" } diff --git a/smoke-release-testing/mgconsole/monitoring.bash b/smoke-release-testing/mgconsole/monitoring.bash index c31ce1d68..137a270b1 100755 --- a/smoke-release-testing/mgconsole/monitoring.bash +++ b/smoke-release-testing/mgconsole/monitoring.bash @@ -3,10 +3,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_monitoring() { - __host="$1" - __port="$2" echo "FEATURE: Monitoring" - response=$(curl -X GET "http://localhost:$MEMGRAPH_NEXT_MONITORING_PORT/metrics") if ! echo "$response" | jq -e '.General | has("vertex_count")'; then echo "Monitoring data is missing vertex count." diff --git a/smoke-release-testing/mgconsole/multi_tenancy.bash b/smoke-release-testing/mgconsole/multi_tenancy.bash index b02d65563..40e10df5d 100644 --- a/smoke-release-testing/mgconsole/multi_tenancy.bash +++ b/smoke-release-testing/mgconsole/multi_tenancy.bash @@ -3,9 +3,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_multi_tenancy() { - __host="$1" - __port="$2" echo "FEATURE: Multi-tenancy basic check" - - echo "SHOW DATABASES;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "SHOW DATABASES;" } diff --git a/smoke-release-testing/mgconsole/query.bash b/smoke-release-testing/mgconsole/query.bash index 6e0274947..aad070a42 100755 --- a/smoke-release-testing/mgconsole/query.bash +++ b/smoke-release-testing/mgconsole/query.bash @@ -3,16 +3,14 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_query() { - __host="$1" - __port="$2" echo "FEATURE: Cypher query engine" echo "SUBFEATURE: Peridic commit" - echo "MATCH (n) DETACH DELETE n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "UNWIND range(1, 10) as x CALL { WITH x CREATE (n:Label {id: x}) RETURN n } IN TRANSACTIONS OF 1 ROWS;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "MATCH (n) RETURN n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "USING PERIODIC COMMIT 1 MATCH (n) DETACH DELETE n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "MATCH (n) RETURN n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "MATCH (n) DETACH DELETE n;" + run_next "UNWIND range(1, 10) as x CALL { WITH x CREATE (n:Label {id: x}) RETURN n } IN TRANSACTIONS OF 1 ROWS;" + run_next "MATCH (n) RETURN n;" + run_next "USING PERIODIC COMMIT 1 MATCH (n) DETACH DELETE n;" + run_next "MATCH (n) RETURN n;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then diff --git a/smoke-release-testing/mgconsole/query_modules.bash b/smoke-release-testing/mgconsole/query_modules.bash index ed7160ac2..3e612ca3b 100755 --- a/smoke-release-testing/mgconsole/query_modules.bash +++ b/smoke-release-testing/mgconsole/query_modules.bash @@ -3,15 +3,10 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_query_modules() { - __host="$1" - __port="$2" echo "FEATURE: All MAGE query modules" - - # TODO(gitbuda): What are the 3 added modules? -> Probably the migration modules. - echo "CALL mg.procedures() YIELD * RETURN count(*) AS cnt;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port --output-format=csv | python3 $SCRIPT_DIR/validator.py first_as_int -f cnt -e 312 - - echo "CREATE (a), (b), (c), (d), (a)-[:ET]->(b), (c)-[:ET]->(d);" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CALL leiden_community_detection.get() YIELD * RETURN communities, community_id, node;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next_csv "CALL mg.procedures() YIELD * RETURN count(*) AS cnt;" | python3 $SCRIPT_DIR/validator.py first_as_int -f cnt -e 313 + run_next "CREATE (a), (b), (c), (d), (a)-[:ET]->(b), (c)-[:ET]->(d);" + run_next "CALL leiden_community_detection.get() YIELD * RETURN communities, community_id, node;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then diff --git a/smoke-release-testing/mgconsole/regex.bash b/smoke-release-testing/mgconsole/regex.bash index fd183b50f..2271d273f 100755 --- a/smoke-release-testing/mgconsole/regex.bash +++ b/smoke-release-testing/mgconsole/regex.bash @@ -2,15 +2,11 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" -# TODO(gitbuda): Introduce default __host and __port values. test_regex() { - __host="$1" - __port="$2" echo "FEATURE: Regex" - - echo "CREATE (:Hero {name: 'xSPIDERy'});" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CREATE (:Hero {name: 'test'});" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "MATCH (h:Hero) WHERE h.name =~ \".*SPIDER.+\" RETURN h.name as PotentialSpiderDude ORDER BY PotentialSpiderDude;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "CREATE (:Hero {name: 'xSPIDERy'});" + run_next "CREATE (:Hero {name: 'test'});" + run_next "MATCH (h:Hero) WHERE h.name =~ \".*SPIDER.+\" RETURN h.name as PotentialSpiderDude ORDER BY PotentialSpiderDude;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then diff --git a/smoke-release-testing/mgconsole/session_trace.bash b/smoke-release-testing/mgconsole/session_trace.bash index cb9c7f2e8..eafd31ea5 100755 --- a/smoke-release-testing/mgconsole/session_trace.bash +++ b/smoke-release-testing/mgconsole/session_trace.bash @@ -3,14 +3,11 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_session_trace() { - __host="$1" - __port="$2" echo "FEATURE: Inspection" - echo "SUBFEATURE: Session trace" - echo "SET SESSION TRACE ON;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CREATE (n);" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "MATCH (n) RETURN n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "SET SESSION TRACE ON;" + run_next "CREATE (n);" + run_next "MATCH (n) RETURN n;" } # NOTE: No extra functions to not polute the namespace, flags could be different for each mgconsole test. @@ -26,7 +23,7 @@ if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then cleanup_docker docker run -d --rm -p $MEMGRAPH_NEXT_DATA_BOLT_PORT:7687 --name memgraph_next_data \ $ENTERPRISE_DOCKER_ENVS_UNLIMITED $MEMGRAPH_NEXT_DOCKERHUB_IMAGE $MEMGRAPH_GENERAL_FLAGS \ - $MEMGRAPH_PROPERTY_COMPRESSION_FALGS $MEMGRAPH_SHOW_SCHEMA_INFO_FLAG $MEMGRAPH_SESSION_TRACE_FLAG + $MEMGRAPH_PROPERTY_COMPRESSION_FLAGS $MEMGRAPH_SHOW_SCHEMA_INFO_FLAG $MEMGRAPH_SESSION_TRACE_FLAG sleep 2 test_session_trace localhost $MEMGRAPH_NEXT_DATA_BOLT_PORT ;; diff --git a/smoke-release-testing/mgconsole/shortest_paths.bash b/smoke-release-testing/mgconsole/shortest_paths.bash new file mode 100644 index 000000000..a31a38890 --- /dev/null +++ b/smoke-release-testing/mgconsole/shortest_paths.bash @@ -0,0 +1,54 @@ +#!/bin/bash +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "$SCRIPT_DIR/../utils.bash" + +test_shortest_paths() { + echo "FEATURE: Deep-path Traversal Capabilities" + run_next "MATCH (n) DETACH DELETE n;" + + create_graph_query=" + CREATE + (a:Node {id: 'A'}), + (b:Node {id: 'B'}), + (c:Node {id: 'C'}), + (d:Node {id: 'D'}), + (e:Node {id: 'E'}), + (f:Node {id: 'F'}), + (g:Node {id: 'G'}), + (a)-[:REL {weight: 1}]->(b), + (a)-[:REL {weight: 2}]->(c), + (b)-[:REL {weight: 1}]->(e), + (c)-[:REL {weight: 1}]->(e), + (a)-[:REL {weight: 3}]->(e), + (b)-[:REL {weight: 2}]->(d), + (d)-[:REL {weight: 1}]->(e), + (a)-[:REL {weight: 1}]->(f), + (f)-[:REL {weight: 1}]->(g), + (g)-[:REL {weight: 1}]->(e); + " + run_next "$create_graph_query" + + echo "SUBFEATURE: KShortest paths - find top 3 shortest paths from A to E" + run_next "MATCH (n1:Node {id: 'A'}), (n2:Node {id: 'E'}) WITH n1, n2 MATCH p=(n1)-[*KShortest | 3]->(n2) RETURN p;" + echo "SUBFEATURE: KShortest paths - with path length bounds" + run_next "MATCH (n1:Node {id: 'A'}), (n2:Node {id: 'E'}) WITH n1, n2 MATCH p=(n1)-[*KShortest 2..4]->(n2) RETURN p;" + echo "SUBFEATURE: Test KShortest paths with the bounds and limit" + run_next "MATCH (n1:Node {id: 'A'}), (n2:Node {id: 'E'}) WITH n1, n2 MATCH p=(n1)-[*KShortest 2..4 | 5]->(n2) RETURN p;" + + echo "SUBFEATURE: AllShortest paths - find all shortest paths from A to E (with weight lambda)" + run_next "MATCH (n1:Node {id: 'A'}), (n2:Node {id: 'E'}) WITH n1, n2 MATCH p=(n1)-[*AllShortest (r, n | r.weight)]->(n2) RETURN p;" + echo "SUBFEATURE: AllShortest paths - with the upper bound and total_weight" + run_next "MATCH (n1:Node {id: 'A'}), (n2:Node {id: 'E'}) WITH n1, n2 MATCH p=(n1)-[*AllShortest ..4 (r, n | r.weight) total_weight]->(n2) RETURN p, total_weight;" + echo "SUBFEATURE: AllShortest paths - using weight lambda + total_weight + the filter" + run_next "MATCH p=(n1:Node {id: 'A'})-[*AllShortest ..4 (r, n | r.weight) total_weight (r, n, p, w | r.weight > 0 AND length(p) > 0)]->(n2:Node {id: 'E'}) RETURN p;" + + run_next "MATCH (n) DETACH DELETE n;" + echo "Smoking Deep-path Traversal Capabilities DONE" +} + +if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then + # NOTE: Take a look at session_trace.bash for the v1 implementation of binary-docker picker. + trap cleanup_memgraph_binary_processes EXIT # To make sure cleanup is done. + set -e # To make sure the script will return non-0 in case of a failure. + run_memgraph_binary_and_test "--log-level=TRACE --log-file=mg_test_shortest_paths.logs" test_shortest_paths +fi diff --git a/smoke-release-testing/mgconsole/show_schema.bash b/smoke-release-testing/mgconsole/show_schema.bash index 7bdd54242..50dd8f927 100755 --- a/smoke-release-testing/mgconsole/show_schema.bash +++ b/smoke-release-testing/mgconsole/show_schema.bash @@ -3,12 +3,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_show_schema_info() { - __host="$1" - __port="$2" - echo "FEATURE: Show schema info" - - echo "CREATE (:Node {prop: 1});" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - data=$(echo "SHOW SCHEMA INFO;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port --output-format=csv --csv-doublequote=true) + echo "FEATURE: Fast Graph Schema" + run_next "CREATE (:Node {prop: 1});" + data=$(echo "SHOW SCHEMA INFO;" | $MGCONSOLE_NEXT_DEFAULT --output-format=csv --csv-doublequote=true) schema=$(echo "$data" | sed 1d) echo $schema diff --git a/smoke-release-testing/mgconsole/spatial.bash b/smoke-release-testing/mgconsole/spatial.bash index 5d5d79171..6373d0f4a 100755 --- a/smoke-release-testing/mgconsole/spatial.bash +++ b/smoke-release-testing/mgconsole/spatial.bash @@ -3,16 +3,12 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_spatial() { - __host="$1" - __port="$2" echo "FEATURE: Spatial data types and functionalities" - - echo "MATCH (n) DETACH DELETE n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CREATE (n {xy: point({x:1, y:2})}) RETURN n.xy.x;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CREATE (n {xy: point({x:1, y:2})}) RETURN n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - - echo "CREATE POINT INDEX ON :School(location);" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "SHOW INDEX INFO;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "MATCH (n) DETACH DELETE n;" + run_next "CREATE (n {xy: point({x:1, y:2})}) RETURN n.xy.x;" + run_next "CREATE (n {xy: point({x:1, y:2})}) RETURN n;" + run_next "CREATE POINT INDEX ON :School(location);" + run_next "SHOW INDEX INFO;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then diff --git a/smoke-release-testing/mgconsole/storage.bash b/smoke-release-testing/mgconsole/storage.bash index 902fb2675..84729ae80 100755 --- a/smoke-release-testing/mgconsole/storage.bash +++ b/smoke-release-testing/mgconsole/storage.bash @@ -3,13 +3,11 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_storage() { - __host="$1" - __port="$2" echo "FEATURE: Storage: IN_MEMORY_TRANSACTIONAL" - echo "SUBFEATURE: Property compression" - echo "CREATE (n:Label $MEMGRAPH_FULL_PROPERTIES_SET)-[:Edge $MEMGRAPH_FULL_PROPERTIES_SET]->(:Label);" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "MATCH (n) RETURN n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + # TODO(gitbuda): Under the CI, under test_single_mage.bash, the property compression is not enabled. + run_next "CREATE (n:Label $MEMGRAPH_FULL_PROPERTIES_SET)-[:Edge $MEMGRAPH_FULL_PROPERTIES_SET]->(:Label);" + run_next "MATCH (n) RETURN n;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then diff --git a/smoke-release-testing/mgconsole/streams.bash b/smoke-release-testing/mgconsole/streams.bash index b39dd1c38..d76287d74 100755 --- a/smoke-release-testing/mgconsole/streams.bash +++ b/smoke-release-testing/mgconsole/streams.bash @@ -3,11 +3,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_streams() { - __host="$1" - __port="$2" - echo "FEATURE: ABC" - - echo "SHOW STREAMS;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + echo "FEATURE: Graph streams" + run_next "SHOW STREAMS;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then diff --git a/smoke-release-testing/mgconsole/template.bash b/smoke-release-testing/mgconsole/template.bash index b1c732523..e68862b9e 100755 --- a/smoke-release-testing/mgconsole/template.bash +++ b/smoke-release-testing/mgconsole/template.bash @@ -2,13 +2,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" -# TODO(gitbuda): Introduce default __host and __port values. test_template() { - __host="$1" - __port="$2" echo "FEATURE: ABC" - - echo "RETURN 1;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "RETURN 1;" } if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then diff --git a/smoke-release-testing/mgconsole/text_search.bash b/smoke-release-testing/mgconsole/text_search.bash new file mode 100644 index 000000000..e8f518ef7 --- /dev/null +++ b/smoke-release-testing/mgconsole/text_search.bash @@ -0,0 +1,19 @@ +#!/bin/bash +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "$SCRIPT_DIR/../utils.bash" + +test_text_search() { + echo "FEATURE: Indexing: Text Search" + + run_next "CREATE TEXT INDEX index_name ON :Label(prop1, prop2, prop3);" + run_next "SHOW INDEX INFO;" + + echo "Text search and text property indices testing completed successfully" +} + +if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then + # NOTE: Take a look at session_trace.bash for the v1 implementation of binary-docker picker. + trap cleanup_memgraph_binary_processes EXIT # To make sure cleanup is done. + set -e # To make sure the script will return non-0 in case of a failure. + run_memgraph_binary_and_test "--log-level=TRACE --log-file=mg_test_text_search.logs" test_text_search +fi diff --git a/smoke-release-testing/mgconsole/ttl.bash b/smoke-release-testing/mgconsole/ttl.bash index d685e1c17..749d07323 100755 --- a/smoke-release-testing/mgconsole/ttl.bash +++ b/smoke-release-testing/mgconsole/ttl.bash @@ -3,10 +3,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_ttl() { - __host="$1" - __port="$2" echo "FEATURE: Time-to-live TTL" - - echo "ENABLE TTL EVERY '1d' AT '00:00:00';" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port # TODO(gitbuda): Skip TTL already running error. - echo "CREATE GLOBAL EDGE INDEX ON :(ttl);" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "ENABLE TTL EVERY '1d' AT '00:00:00';" # TODO(gitbuda): Skip TTL already running error. + run_next "CREATE GLOBAL EDGE INDEX ON :(ttl);" } diff --git a/smoke-release-testing/mgconsole/type_constraints.bash b/smoke-release-testing/mgconsole/type_constraints.bash index 6d98033a2..702b5ff68 100755 --- a/smoke-release-testing/mgconsole/type_constraints.bash +++ b/smoke-release-testing/mgconsole/type_constraints.bash @@ -3,14 +3,12 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_type_constraints() { - __host="$1" - __port="$2" echo "FEATURE: Constraints: Data type" - echo "MATCH (n) DETACH DELETE n;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CREATE CONSTRAINT ON (n:Node) ASSERT n.prop IS TYPED STRING;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "MATCH (n) DETACH DELETE n;" + run_next "CREATE CONSTRAINT ON (n:Node) ASSERT n.prop IS TYPED STRING;" set +e - echo "CREATE (n:Node {prop:23});" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + run_next "CREATE (n:Node {prop:23});" if [ $? -eq 0 ]; then echo "ERROR: Constraint violation not detected." exit 1 diff --git a/smoke-release-testing/mgconsole/user_profiles.bash b/smoke-release-testing/mgconsole/user_profiles.bash new file mode 100644 index 000000000..94690a578 --- /dev/null +++ b/smoke-release-testing/mgconsole/user_profiles.bash @@ -0,0 +1,35 @@ +#!/bin/bash +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "$SCRIPT_DIR/../utils.bash" + +test_user_profiles() { + echo "FEATURE: User Profiles and Resource Limit Constraints" + + echo "SUBFEATURE: Setup test user and profile" + run_next_admin "CREATE PROFILE user_profile LIMIT SESSIONS 2, TRANSACTIONS_MEMORY 100KB;" + run_next_admin "SET PROFILE FOR tester TO user_profile;" + run_next_admin "SHOW PROFILE FOR tester;" + + echo "SUBFEATURE: Test memory limit enforcement" + # Test query that should work within 100KB limit + run_next_tester "CREATE (n:TestNode {id: 1, data: 'small'});" + # This one should fail. Check for failure and continue only if it fails. + if ! run_next_tester "UNWIND range(1, 10000) AS i CREATE (n:MemoryTest {id: i, data: 'Data string ' + i}) RETURN count(n);"; then + echo "Memory limit enforcement by profile test failed as expected." + fi + + echo "SUBFEATURE: Cleanup profile" + run_next_admin "DROP PROFILE user_profile;" + run_next_admin "SHOW PROFILES;" + run_next_admin "MATCH (n:TestNode) DETACH DELETE n;" + run_next_admin "MATCH (n:MemoryTest) DETACH DELETE n;" + + echo "User profiles and resource limit constraints testing completed successfully" +} + +if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then + # NOTE: Take a look at session_trace.bash for the v1 implementation of binary-docker picker. + trap cleanup_memgraph_binary_processes EXIT # To make sure cleanup is done. + set -e # To make sure the script will return non-0 in case of a failure. + run_memgraph_binary_and_test "--log-level=TRACE --log-file=mg_test_user_profiles.logs" test_user_profiles +fi diff --git a/smoke-release-testing/mgconsole/vector_search.bash b/smoke-release-testing/mgconsole/vector_search.bash index 8cf8ec7ec..ec573fd29 100755 --- a/smoke-release-testing/mgconsole/vector_search.bash +++ b/smoke-release-testing/mgconsole/vector_search.bash @@ -3,13 +3,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/../utils.bash" test_vector_search() { - __host="$1" - __port="$2" - echo "FEATURE: Vector Search" - - echo "CREATE VECTOR INDEX vsi ON :Label(embedding) WITH CONFIG {\"dimension\":2, \"capacity\": 10};" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "CREATE VECTOR EDGE INDEX etvsi ON :EdgeType(embedding) WITH CONFIG {\"dimension\": 256, \"capacity\": 1000};" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - - echo "CALL vector_search.show_index_info() YIELD * RETURN *;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port - echo "SHOW VECTOR INDEX INFO;" | $MEMGRAPH_CONSOLE_BINARY --host $__host --port $__port + echo "FEATURE: Indexing: Vector Search" + run_next "CREATE VECTOR INDEX vsi ON :Label(embedding) WITH CONFIG {\"dimension\":2, \"capacity\": 10};" + run_next "CREATE VECTOR EDGE INDEX etvsi ON :EdgeType(embedding) WITH CONFIG {\"dimension\": 256, \"capacity\": 1000};" + run_next "CALL vector_search.show_index_info() YIELD * RETURN *;" + run_next "SHOW VECTOR INDEX INFO;" } diff --git a/smoke-release-testing/test_ha_memgraph.bash b/smoke-release-testing/test_ha_memgraph.bash index 50df4a3c2..dd5a13959 100755 --- a/smoke-release-testing/test_ha_memgraph.bash +++ b/smoke-release-testing/test_ha_memgraph.bash @@ -2,6 +2,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/utils.bash" +pull_docker_images none none + source $SCRIPT_DIR/k8s/run.bash cleanup_k8s_all diff --git a/smoke-release-testing/test_single_mage.bash b/smoke-release-testing/test_single_mage.bash index 457befa61..61ab91ded 100755 --- a/smoke-release-testing/test_single_mage.bash +++ b/smoke-release-testing/test_single_mage.bash @@ -2,6 +2,11 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SCRIPT_DIR/utils.bash" +# Start timing the script execution +START_TIME=$(date +%s) +START_TIME_READABLE=$(date) +echo "Script execution started at: $START_TIME_READABLE" + # NOTE: 1st arg is how to pull LAST image, 2nd arg is how to pull NEXT image. spinup_and_cleanup_memgraph_dockers Dockerhub RC echo "Waiting for memgraph to initialize..." @@ -18,31 +23,55 @@ for test_file_path in "$SCRIPT_DIR/mgconsole/"*; do echo "Loaded $test_file_path..." done -test_auth_roles $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_basic_auth $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_query $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_query_modules $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -set +e # NOTE: At the time of writing this failed becuase of a bug but the test/config is legit. - # Remove set +e after fix. -test_session_trace $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -set -e -test_show_schema_info $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_spatial $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_storage $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_streams $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_ttl $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_type_constraints $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_vector_search $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_dynamic_algos $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_functions $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_label_operations $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_regex $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_edge_type_operations $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_composite_indices $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_monitoring $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_multi_tenancy $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_nested_indices $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -test_or_expression_for_labels $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT -# NOTE: If the testing container is NOT restarted, all the auth test have to -# come after all tests that assume there are no users. -test_impersonate_user $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_NEXT_DATA_BOLT_PORT +test_auth_roles +test_basic_auth +test_query +test_query_modules +test_session_trace +test_show_schema_info +test_spatial +test_storage +test_streams +test_ttl +test_type_constraints +test_vector_search +test_dynamic_algos +test_functions +test_label_operations +test_regex +test_edge_type_operations +test_composite_indices +test_monitoring +test_multi_tenancy +test_nested_indices +test_or_expression_for_labels +test_shortest_paths +test_text_search +test_durability + +# NOTE: If the testing container is NOT restarted (each test having their own +# container), all the auth test have to come after all tests that assume there +# are no users. +# Add all the users to be able to perform the tests. +echo "CREATE USER admin IDENTIFIED BY 'admin1234'; GRANT ALL PRIVILEGES TO admin;" | $MGCONSOLE_NEXT_DEFAULT +echo "CREATE USER tester IDENTIFIED BY 'tester1234'; GRANT CREATE TO tester; GRANT CREATE_DELETE ON LABELS * TO tester; GRANT DATABASE memgraph TO tester;" | $MGCONSOLE_NEXT_ADMIN +echo "SHOW USERS;" | $MGCONSOLE_NEXT_ADMIN +echo "SHOW ACTIVE USERS;" | $MGCONSOLE_NEXT_ADMIN +echo "NOTE: admin and tester users are created for testing purposes." + +test_show_database_settings +test_auth_roles +test_impersonate_user +test_user_profiles + +# End timing and calculate execution time +END_TIME=$(date +%s) +END_TIME_READABLE=$(date) +EXECUTION_TIME=$((END_TIME - START_TIME)) +EXECUTION_TIME_MINUTES=$((EXECUTION_TIME / 60)) +EXECUTION_TIME_SECONDS=$((EXECUTION_TIME % 60)) + +echo "" +echo "Script execution completed at: $END_TIME_READABLE" +echo "Total execution time: ${EXECUTION_TIME_MINUTES}m ${EXECUTION_TIME_SECONDS}s (${EXECUTION_TIME} seconds)" +echo "" diff --git a/smoke-release-testing/utils.bash b/smoke-release-testing/utils.bash index ee1bafd20..572b3f698 100755 --- a/smoke-release-testing/utils.bash +++ b/smoke-release-testing/utils.bash @@ -44,12 +44,12 @@ check_dockerhub_images() { } check_dockerhub_images -MEMGRAPH_GENERAL_FLAGS="--telemetry-enabled=false --log-level=TRACE --also-log-to-stderr" +MEMGRAPH_GENERAL_FLAGS="--telemetry-enabled=false --log-level=TRACE --also-log-to-stderr --experimental-enabled=text-search" MEMGRAPH_ENTERPRISE_DOCKER_ENVS="-e MEMGRAPH_ENTERPRISE_LICENSE=$MEMGRAPH_ENTERPRISE_LICENSE -e MEMGRAPH_ORGANIZATION_NAME=$MEMGRAPH_ORGANIZATION_NAME" MEMGRAPH_DOCKER_MOUNT_VOLUME_FLAGS="-v mg_lib:/var/lib/memgraph" MEMGRAPH_FULL_PROPERTIES_SET="{id:0, name:\"tester\", age:37, height:175.0, merried:true}" -MEMGRAPH_PROPERTY_COMPRESSION_FALGS="--storage-property-store-compression-enabled=true --storage-property-store-compression-level=mid" -MEMGRAPH_HA_COORDINATOR_FALGS="--coordinator-port=10001 --bolt-port=7687 --coordinator-id=1 --experimental-enabled=high-availability --coordinator-hostname=localhost --management-port=11001" +MEMGRAPH_PROPERTY_COMPRESSION_FLAGS="--storage-property-store-compression-enabled=true --storage-property-store-compression-level=mid" +MEMGRAPH_HA_COORDINATOR_FLAGS="--coordinator-port=10001 --bolt-port=7687 --coordinator-id=1 --experimental-enabled=high-availability --coordinator-hostname=localhost --management-port=11001" MEMGRAPH_SHOW_SCHEMA_INFO_FLAG="--schema-info-enabled=true" MEMGRAPH_SESSION_TRACE_FLAG="--query-log-directory=/var/log/memgraph/session_traces" MEMGRAPH_DEFAULT_HOST="localhost" @@ -61,6 +61,26 @@ MEMGRAPH_NEXT_COORDINATOR_BOLT_PORT="8003" MEMGRAPH_LAST_MONITORING_PORT="9001" MEMGRAPH_NEXT_MONITORING_PORT="9002" +MGCONSOLE_NEXT_DEFAULT="$MEMGRAPH_CONSOLE_BINARY --host $MEMGRAPH_DEFAULT_HOST --port $MEMGRAPH_NEXT_DATA_BOLT_PORT" +MGCONSOLE_NEXT_ADMIN="$MEMGRAPH_CONSOLE_BINARY --host $MEMGRAPH_DEFAULT_HOST --port $MEMGRAPH_NEXT_DATA_BOLT_PORT --username admin --password admin1234" +MGCONSOLE_NEXT_TESTER="$MEMGRAPH_CONSOLE_BINARY --host $MEMGRAPH_DEFAULT_HOST --port $MEMGRAPH_NEXT_DATA_BOLT_PORT --username tester --password tester1234" +run_next() { + __query="$1" + echo "$__query" | $MGCONSOLE_NEXT_DEFAULT +} +run_next_admin() { + __query="$1" + echo "$__query" | $MGCONSOLE_NEXT_ADMIN +} +run_next_tester() { + __query="$1" + echo "$__query" | $MGCONSOLE_NEXT_TESTER +} +run_next_csv() { + __query="$1" + echo "$__query" | $MGCONSOLE_NEXT_DEFAULT --output-format=csv +} + wait_port() { __port="$1" while ! nc -z localhost $__port; do @@ -126,11 +146,13 @@ run_memgraph_binary() { } run_memgraph_binary_and_test() { + # NOTE: This function runs memgraph on the NEXT_DATA_BOLT_PORT because all + # tests are mostly executed against that (a convention to shorten the code). __args="$1" __test_func_name=$2 - __mg_pid=$(run_memgraph_binary "$__args") - wait_port $MEMGRAPH_DEFAULT_PORT - $__test_func_name $MEMGRAPH_DEFAULT_HOST $MEMGRAPH_DEFAULT_PORT + __mg_pid=$(run_memgraph_binary "--bolt-port $MEMGRAPH_NEXT_DATA_BOLT_PORT $__args") + # wait_port $MEMGRAPH_NEXT_DATA_BOLT_PORT + $__test_func_name kill -15 $__mg_pid } @@ -207,7 +229,7 @@ run_memgraph_next_dockerhub_container() { docker run -d --rm -p $MEMGRAPH_NEXT_DATA_BOLT_PORT:7687 -p $MEMGRAPH_NEXT_MONITORING_PORT:9091 \ --name memgraph_next_data \ $MEMGRAPH_ENTERPRISE_DOCKER_ENVS $MEMGRAPH_NEXT_DOCKERHUB_IMAGE $MEMGRAPH_GENERAL_FLAGS \ - $MEMGRAPH_PROPERTY_COMPRESSION_FALGS $MEMGRAPH_SHOW_SCHEMA_INFO_FLAG + $MEMGRAPH_PROPERTY_COMPRESSION_FLAGS $MEMGRAPH_SHOW_SCHEMA_INFO_FLAG fi } @@ -218,13 +240,13 @@ run_memgraph_last_dockerhub_container_with_volume() { run_memgraph_next_dockerhub_container_with_volume() { docker run -d --rm -p $MEMGRAPH_NEXT_DATA_BOLT_PORT:7687 $MEMGRAPH_DOCKER_MOUNT_VOLUME_FLAGS \ - --name memgraph_next_data $ENTERPRISE_DOCKER_ENVS_UNLIMITED $MEMGRAPH_NEXT_DOCKERHUB_IMAGE $MEMGRAPH_GENERAL_FLAGS $MEMGRAPH_PROPERTY_COMPRESSION_FALGS + --name memgraph_next_data $ENTERPRISE_DOCKER_ENVS_UNLIMITED $MEMGRAPH_NEXT_DOCKERHUB_IMAGE $MEMGRAPH_GENERAL_FLAGS $MEMGRAPH_PROPERTY_COMPRESSION_FLAGS } run_memgraph_coordinator_next_dockerhub_container() { docker run -d --rm -p $MEMGRAPH_NEXT_COORDINATOR_BOLT_PORT:7687 --name memgraph_next_coordinator \ $MEMGRAPH_ENTERPRISE_DOCKER_ENVS $MEMGRAPH_NEXT_DOCKERHUB_IMAGE $MEMGRAPH_GENERAL_FLAGS \ - $MEMGRAPH_PROPERTY_COMPRESSION_FALGS $MEMGRAPH_HA_COORDINATOR_FALGS + $MEMGRAPH_PROPERTY_COMPRESSION_FLAGS $MEMGRAPH_HA_COORDINATOR_FLAGS } run_memgraph_docker_containers() {