From 798903e2365108b820f21e637236e9fc78730b4e Mon Sep 17 00:00:00 2001 From: Andreja Tonev Date: Mon, 26 Feb 2024 18:10:37 +0100 Subject: [PATCH] Added more log directories and explicitly specified in tests --- .github/workflows/diff.yaml | 5 +- tests/integration/audit/runner.py | 2 +- tests/integration/auth/runner.py | 7 ++- tests/integration/durability/runner.py | 1 + .../integration/env_variable_check/runner.py | 7 ++- .../integration/fine_grained_access/runner.py | 7 ++- tests/integration/flag_check/runner.py | 7 ++- tests/integration/init_file/runner.py | 22 +++++++- tests/integration/ldap/runner.py | 1 + tests/integration/mg_import_csv/runner.py | 8 ++- tests/integration/run_time_settings/runner.py | 7 ++- tests/integration/storage_mode/runner.py | 51 ++++++++++++++++--- 12 files changed, 109 insertions(+), 16 deletions(-) diff --git a/.github/workflows/diff.yaml b/.github/workflows/diff.yaml index 7260a2bd7..a79202b15 100644 --- a/.github/workflows/diff.yaml +++ b/.github/workflows/diff.yaml @@ -218,7 +218,10 @@ jobs: if: always() with: name: "Test logs (Debug build)" - path: build/logs + path: | + build/logs + /tmp/memgraph_drivers/logs + /tmp/memgraph_integration/logs release_build: name: "Release build" diff --git a/tests/integration/audit/runner.py b/tests/integration/audit/runner.py index 01f9f53ec..f3ecfc583 100755 --- a/tests/integration/audit/runner.py +++ b/tests/integration/audit/runner.py @@ -80,7 +80,7 @@ def execute_test(memgraph_binary, tester_binary): "--data-directory", storage_directory.name, "--audit-enabled", - "--log-file=memgraph.log", + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", "--log-level=TRACE", ] diff --git a/tests/integration/auth/runner.py b/tests/integration/auth/runner.py index a74b19a4e..32de67613 100755 --- a/tests/integration/auth/runner.py +++ b/tests/integration/auth/runner.py @@ -131,7 +131,12 @@ def check_permissions(query_perms, user_perms): def execute_test(memgraph_binary, tester_binary, checker_binary): storage_directory = tempfile.TemporaryDirectory() - memgraph_args = [memgraph_binary, "--data-directory", storage_directory.name] + memgraph_args = [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] def execute_admin_queries(queries): return execute_tester( diff --git a/tests/integration/durability/runner.py b/tests/integration/durability/runner.py index 8a62f7e3b..fe077a87c 100755 --- a/tests/integration/durability/runner.py +++ b/tests/integration/durability/runner.py @@ -73,6 +73,7 @@ def execute_test(memgraph_binary, dump_binary, test_directory, test_type, write_ "--storage-properties-on-edges", "--data-directory", working_data_directory.name, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", ] # Start the memgraph binary diff --git a/tests/integration/env_variable_check/runner.py b/tests/integration/env_variable_check/runner.py index acd26709e..6d901c381 100644 --- a/tests/integration/env_variable_check/runner.py +++ b/tests/integration/env_variable_check/runner.py @@ -112,7 +112,12 @@ def test_with_passfile_env_variable(storage_directory: tempfile.TemporaryDirecto def execute_test(memgraph_binary: str, tester_binary: str) -> None: storage_directory = tempfile.TemporaryDirectory() - memgraph_args = [memgraph_binary, "--data-directory", storage_directory.name] + memgraph_args = [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] return_to_prev_state = {} if "MEMGRAPH_USER" in os.environ: diff --git a/tests/integration/fine_grained_access/runner.py b/tests/integration/fine_grained_access/runner.py index 590cf1409..eaeb74fdc 100644 --- a/tests/integration/fine_grained_access/runner.py +++ b/tests/integration/fine_grained_access/runner.py @@ -61,7 +61,12 @@ def execute_filtering( def execute_test(memgraph_binary: str, tester_binary: str, filtering_binary: str) -> None: storage_directory = tempfile.TemporaryDirectory() - memgraph_args = [memgraph_binary, "--data-directory", storage_directory.name] + memgraph_args = [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] def execute_admin_queries(queries): return execute_tester( diff --git a/tests/integration/flag_check/runner.py b/tests/integration/flag_check/runner.py index 1a3999871..dd2734a9b 100644 --- a/tests/integration/flag_check/runner.py +++ b/tests/integration/flag_check/runner.py @@ -124,7 +124,12 @@ def test_init_and_init_data_file(flag_checker_binary: str, tester_binary: str, m def execute_test(memgraph_binary: str, tester_binary: str, flag_checker_binary: str) -> None: storage_directory = tempfile.TemporaryDirectory() - memgraph_args = [memgraph_binary, "--data-directory", storage_directory.name] + memgraph_args = [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] # Start the memgraph binary with open(os.path.join(os.getcwd(), "dummy_init_file.cypherl"), "w") as temp_file: diff --git a/tests/integration/init_file/runner.py b/tests/integration/init_file/runner.py index fcaa10f95..85d56f227 100644 --- a/tests/integration/init_file/runner.py +++ b/tests/integration/init_file/runner.py @@ -39,10 +39,28 @@ def terminate_memgraph(memgraph): def execute_test_restart_memgraph_with_init_file(memgraph_binary: str, tester_binary: str) -> None: storage_directory = tempfile.TemporaryDirectory() tester_args = [tester_binary, "--username", "memgraph1", "--password", "1234"] - memgraph = prepare_memgraph([memgraph_binary, "--data-directory", storage_directory.name, "--init-file", INIT_FILE]) + memgraph = prepare_memgraph( + [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--init-file", + INIT_FILE, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] + ) subprocess.run(tester_args, stdout=subprocess.PIPE, check=True).check_returncode() terminate_memgraph(memgraph) - memgraph = prepare_memgraph([memgraph_binary, "--data-directory", storage_directory.name, "--init-file", INIT_FILE]) + memgraph = prepare_memgraph( + [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--init-file", + INIT_FILE, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] + ) subprocess.run(tester_args, stdout=subprocess.PIPE, check=True).check_returncode() terminate_memgraph(memgraph) diff --git a/tests/integration/ldap/runner.py b/tests/integration/ldap/runner.py index 8fc3af913..a02a465a1 100755 --- a/tests/integration/ldap/runner.py +++ b/tests/integration/ldap/runner.py @@ -109,6 +109,7 @@ class Memgraph: self._storage_directory.name, "--auth-module-executable", kwargs.pop("module_executable", self._auth_module), + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", ] for key, value in kwargs.items(): ldap_key = "--auth-module-" + key.replace("_", "-") diff --git a/tests/integration/mg_import_csv/runner.py b/tests/integration/mg_import_csv/runner.py index fa08008a6..83ff71def 100755 --- a/tests/integration/mg_import_csv/runner.py +++ b/tests/integration/mg_import_csv/runner.py @@ -51,7 +51,12 @@ def verify_lifetime(memgraph_binary, mg_import_csv_binary): storage_directory = tempfile.TemporaryDirectory() # Generate common args - common_args = ["--data-directory", storage_directory.name, "--storage-properties-on-edges=false"] + common_args = [ + "--data-directory", + storage_directory.name, + "--storage-properties-on-edges=false", + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] # Start the memgraph binary memgraph_args = [memgraph_binary, "--storage-recover-on-startup"] + common_args @@ -109,6 +114,7 @@ def execute_test(name, test_path, test_config, memgraph_binary, mg_import_csv_bi "--data-directory", storage_directory.name, "--storage-properties-on-edges=" + str(properties_on_edges).lower(), + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", ] # Generate mg_import_csv args using flags specified in the test diff --git a/tests/integration/run_time_settings/runner.py b/tests/integration/run_time_settings/runner.py index 3d03077af..613cd4683 100755 --- a/tests/integration/run_time_settings/runner.py +++ b/tests/integration/run_time_settings/runner.py @@ -183,7 +183,12 @@ def execute_test( memgraph_binary: str, tester_binary: str, flag_tester_binary: str, executor_binary: str, test_config_binary: str ) -> None: storage_directory = tempfile.TemporaryDirectory() - memgraph_args = [memgraph_binary, "--data-directory", storage_directory.name] + memgraph_args = [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] print("\033[1;36m~~ Starting run-time settings check test ~~\033[0m") diff --git a/tests/integration/storage_mode/runner.py b/tests/integration/storage_mode/runner.py index 995d6d834..c8331de2b 100644 --- a/tests/integration/storage_mode/runner.py +++ b/tests/integration/storage_mode/runner.py @@ -69,7 +69,14 @@ def execute_test_analytical_mode(memgraph_binary: str, tester_binary: str) -> No return execute_tester(tester_binary, queries, should_fail=False, check_failure=True, username="", password="") storage_directory = tempfile.TemporaryDirectory() - memgraph = prepare_memgraph([memgraph_binary, "--data-directory", storage_directory.name]) + memgraph = prepare_memgraph( + [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] + ) print("\033[1;36m~~ Starting creating & loading snapshot test ~~\033[0m") @@ -90,7 +97,13 @@ def execute_test_analytical_mode(memgraph_binary: str, tester_binary: str) -> No # Start the memgraph binary memgraph = prepare_memgraph( - [memgraph_binary, "--data-directory", storage_directory.name, "--storage-recover-on-startup=true"] + [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--storage-recover-on-startup=true", + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] ) execute_queries(assertion_queries) @@ -110,7 +123,14 @@ def execute_test_switch_analytical_transactional(memgraph_binary: str, tester_bi storage_directory = tempfile.TemporaryDirectory() # Start the memgraph binary - memgraph = prepare_memgraph([memgraph_binary, "--data-directory", storage_directory.name]) + memgraph = prepare_memgraph( + [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] + ) print("\033[1;36m~~ Starting switch storage modes test ~~\033[0m") @@ -138,7 +158,13 @@ def execute_test_switch_analytical_transactional(memgraph_binary: str, tester_bi print("\033[1;36m~~ Starting memgraph with snapshot recovery ~~\033[0m\n") memgraph = prepare_memgraph( - [memgraph_binary, "--data-directory", storage_directory.name, "--storage-recover-on-startup=true"] + [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--storage-recover-on-startup=true", + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] ) execute_queries(assertion_queries) @@ -159,7 +185,14 @@ def execute_test_switch_transactional_analytical(memgraph_binary: str, tester_bi storage_directory = tempfile.TemporaryDirectory() # Start the memgraph binary - memgraph = prepare_memgraph([memgraph_binary, "--data-directory", storage_directory.name]) + memgraph = prepare_memgraph( + [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] + ) print("\033[1;36m~~ Starting switch storage modes test ~~\033[0m") @@ -184,7 +217,13 @@ def execute_test_switch_transactional_analytical(memgraph_binary: str, tester_bi print("\033[1;36m~~ Starting memgraph with snapshot recovery ~~\033[0m\n") memgraph = prepare_memgraph( - [memgraph_binary, "--data-directory", storage_directory.name, "--storage-recover-on-startup=true"] + [ + memgraph_binary, + "--data-directory", + storage_directory.name, + "--storage-recover-on-startup=true", + "--log-file=/tmp/memgraph_integration/logs/memgraph.log", + ] ) execute_queries(assertion_queries)