From fbed15212eaea3f67cc312806f83b54720b76be6 Mon Sep 17 00:00:00 2001 From: Joel Wong <127782171+joel-wong-aws@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:27:16 -0600 Subject: [PATCH] chore: increase log level for daemon _serve args to info Signed-off-by: Joel Wong <127782171+joel-wong-aws@users.noreply.github.com> --- .../_background/frontend_runner.py | 2 +- .../unit/background/test_frontend_runner.py | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/openjd/adaptor_runtime/_background/frontend_runner.py b/src/openjd/adaptor_runtime/_background/frontend_runner.py index c83b4ba..fc228c4 100644 --- a/src/openjd/adaptor_runtime/_background/frontend_runner.py +++ b/src/openjd/adaptor_runtime/_background/frontend_runner.py @@ -149,7 +149,7 @@ def init( ) args.extend(["--bootstrap-log-file", bootstrap_log_path]) - _logger.debug(f"Running process with args: {args}") + _logger.info(f"Running process with args: {args}") bootstrap_output_path = os.path.join( bootstrap_log_dir, f"adaptor-runtime-background-bootstrap-output-{bootstrap_id}.log" ) diff --git a/test/openjd/adaptor_runtime/unit/background/test_frontend_runner.py b/test/openjd/adaptor_runtime/unit/background/test_frontend_runner.py index 9545ea5..92b2433 100644 --- a/test/openjd/adaptor_runtime/unit/background/test_frontend_runner.py +++ b/test/openjd/adaptor_runtime/unit/background/test_frontend_runner.py @@ -219,6 +219,34 @@ def test_initializes_backend_process( ) mock_heartbeat.assert_called_once() + def test_arguments_to_daemon_serve_are_logged_at_info_level( + self, + mock_path_exists: MagicMock, + mock_Popen: MagicMock, + caplog: pytest.LogCaptureFixture, + ): + # GIVEN + caplog.set_level("INFO") + mock_path_exists.return_value = False + adaptor_module = ModuleType("") + adaptor_module.__package__ = "package" + conn_file_path = Path("/path") + runner = FrontendRunner() + + # WHEN + runner.init( + adaptor_module=adaptor_module, + connection_file_path=conn_file_path, + ) + + # THEN + assert any( + "Running process with args" in captured_message + for captured_message in caplog.messages + ) + mock_path_exists.assert_called_once_with() + mock_Popen.assert_called_once() + def test_raises_when_adaptor_module_not_package(self): # GIVEN adaptor_module = ModuleType("")