Skip to content

Commit

Permalink
chore: increase log level for daemon _serve args to info
Browse files Browse the repository at this point in the history
Signed-off-by: Joel Wong <[email protected]>
  • Loading branch information
joel-wong-aws committed Dec 18, 2024
1 parent 509a868 commit fbed152
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/openjd/adaptor_runtime/_background/frontend_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
Expand Down

0 comments on commit fbed152

Please sign in to comment.