Skip to content

Commit 712e570

Browse files
chore: increase log level for daemon _serve args to info (#169)
Signed-off-by: Joel Wong <[email protected]>
1 parent 5d7eea9 commit 712e570

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

src/openjd/adaptor_runtime/_background/frontend_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def init(
149149
)
150150
args.extend(["--bootstrap-log-file", bootstrap_log_path])
151151

152-
_logger.debug(f"Running process with args: {args}")
152+
_logger.info(f"Running process with args: {args}")
153153
bootstrap_output_path = os.path.join(
154154
bootstrap_log_dir, f"adaptor-runtime-background-bootstrap-output-{bootstrap_id}.log"
155155
)

test/openjd/adaptor_runtime/integ/test_integration_entrypoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def test_start_stop(self, caplog: pytest.LogCaptureFixture, tmp_path: Path):
112112
assert "Connected successfully" in caplog.text
113113
assert "Running in background daemon mode." in caplog.text
114114
assert "Daemon background process stopped." in caplog.text
115-
assert "on_prerun" not in caplog.text
116-
assert "on_postrun" not in caplog.text
115+
assert "on_prerun" in caplog.text
116+
assert "on_postrun" in caplog.text
117117

118118
def test_run(self, caplog: pytest.LogCaptureFixture, tmp_path: Path):
119119
# GIVEN

test/openjd/adaptor_runtime/unit/background/test_frontend_runner.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,34 @@ def test_initializes_backend_process(
219219
)
220220
mock_heartbeat.assert_called_once()
221221

222+
def test_arguments_to_daemon_serve_are_logged_at_info_level(
223+
self,
224+
mock_path_exists: MagicMock,
225+
mock_Popen: MagicMock,
226+
caplog: pytest.LogCaptureFixture,
227+
):
228+
# GIVEN
229+
caplog.set_level("INFO")
230+
mock_path_exists.return_value = False
231+
adaptor_module = ModuleType("")
232+
adaptor_module.__package__ = "package"
233+
conn_file_path = Path("/path")
234+
runner = FrontendRunner()
235+
236+
# WHEN
237+
runner.init(
238+
adaptor_module=adaptor_module,
239+
connection_file_path=conn_file_path,
240+
)
241+
242+
# THEN
243+
assert any(
244+
"Running process with args" in captured_message
245+
for captured_message in caplog.messages
246+
)
247+
mock_path_exists.assert_called_once_with()
248+
mock_Popen.assert_called_once()
249+
222250
def test_raises_when_adaptor_module_not_package(self):
223251
# GIVEN
224252
adaptor_module = ModuleType("")

0 commit comments

Comments
 (0)