Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -112,8 +112,8 @@ def test_start_stop(self, caplog: pytest.LogCaptureFixture, tmp_path: Path):
assert "Connected successfully" in caplog.text
assert "Running in background daemon mode." in caplog.text
assert "Daemon background process stopped." in caplog.text
assert "on_prerun" not in caplog.text
assert "on_postrun" not in caplog.text
assert "on_prerun" in caplog.text
assert "on_postrun" in caplog.text

def test_run(self, caplog: pytest.LogCaptureFixture, tmp_path: Path):
# GIVEN
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