bec-ipython-client 4.2.1__tar.gz → 4.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/PKG-INFO +1 -1
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/pyproject.toml +1 -1
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_procedures_e2e.py +59 -2
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/.gitignore +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/__init__.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/beamline_mixin.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/bec_magics.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/bec_startup.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/__init__.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/device_progress.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/ipython_live_updates.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/live_table.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/move_device.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/utils.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/gui_client.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/high_level_interfaces/__init__.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/high_level_interfaces/bec_hli.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/high_level_interfaces/spec_hli.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/main.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/SLS/__init__.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/SLS/sls_info.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/XTreme/__init__.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/XTreme/x-treme.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/__init__.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/flomni/flomni_config.yaml +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/prettytable.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/progressbar.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/signals.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/demo.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/conftest.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_beamline_mixins.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_bec_client.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_device_progress.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_gui_client.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_ipython_live_updates.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_live_table.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_move_callback.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_pretty_table.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_signals.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/conftest.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/_ensure_requirements_container.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_acl_e2e.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_actors_e2e.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_scan_workflows_lib_e2e.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_scans_e2e.py +0 -0
- {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_scans_lib_e2e.py +0 -0
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_procedures_e2e.py
RENAMED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import os
|
|
3
4
|
import time
|
|
4
5
|
from dataclasses import dataclass
|
|
5
6
|
from importlib.metadata import version
|
|
6
7
|
from typing import TYPE_CHECKING, Callable, Generator
|
|
7
8
|
from unittest.mock import patch
|
|
9
|
+
from uuid import uuid4
|
|
8
10
|
|
|
9
11
|
import pytest
|
|
12
|
+
from pytest_redis import factories as redis_factories
|
|
10
13
|
|
|
11
14
|
from bec_ipython_client.main import BECIPythonClient
|
|
12
15
|
from bec_lib import messages
|
|
13
16
|
from bec_lib.endpoints import MessageEndpoints
|
|
14
17
|
from bec_lib.logger import bec_logger
|
|
15
|
-
from
|
|
16
|
-
from bec_server.procedures.
|
|
18
|
+
from bec_lib.procedures.helper import ProcedureState
|
|
19
|
+
from bec_server.procedures.constants import _CONTAINER, _WORKER, PROCEDURE
|
|
20
|
+
from bec_server.procedures.container_utils import (
|
|
21
|
+
_run_and_capture_error,
|
|
22
|
+
get_backend,
|
|
23
|
+
podman_available,
|
|
24
|
+
)
|
|
25
|
+
from bec_server.procedures.container_worker import ContainerProcedureWorker
|
|
17
26
|
from bec_server.procedures.manager import ProcedureManager
|
|
18
27
|
from bec_server.procedures.subprocess_worker import SubProcessWorker
|
|
19
28
|
|
|
@@ -133,3 +142,51 @@ def test_happy_path_container_procedure_runner(
|
|
|
133
142
|
assert logtool.is_present_in_any_message(
|
|
134
143
|
f"Builtin procedure log_message_args_kwargs called with args: {test_args} and kwargs: {test_kwargs}"
|
|
135
144
|
)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
# A separate Redis prevents the scan server's manager from also consuming this request.
|
|
148
|
+
proc_redis = redis_factories.redis_proc()
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
@pytest.mark.timeout(120)
|
|
152
|
+
@pytest.mark.parametrize(
|
|
153
|
+
"worker_type", [ContainerProcedureWorker, SubProcessWorker], ids=["podman", "subprocess"]
|
|
154
|
+
)
|
|
155
|
+
def test_procedure_execution(proc_redis, monkeypatch, worker_type):
|
|
156
|
+
"""Execute a real procedure with either worker backend against isolated Redis.
|
|
157
|
+
|
|
158
|
+
Podman requires the worker image and a host-networked ``local_bec`` pod. For a remote
|
|
159
|
+
Podman VM, BEC_TEST_CONTAINER_REDIS_HOST can supply a container-reachable host.
|
|
160
|
+
"""
|
|
161
|
+
uses_container = worker_type is ContainerProcedureWorker
|
|
162
|
+
if uses_container and not podman_available():
|
|
163
|
+
pytest.skip("Podman is not available")
|
|
164
|
+
host, port = proc_redis.host, proc_redis.port
|
|
165
|
+
queue = f"procedure_test_{uuid4().hex}"
|
|
166
|
+
if uses_container and (container_host := os.environ.get("BEC_TEST_CONTAINER_REDIS_HOST")):
|
|
167
|
+
worker_environment = ContainerProcedureWorker._worker_environment
|
|
168
|
+
monkeypatch.setattr(
|
|
169
|
+
ContainerProcedureWorker,
|
|
170
|
+
"_worker_environment",
|
|
171
|
+
lambda worker: worker_environment(worker)
|
|
172
|
+
| {"redis_server": f"{container_host}:{port}"},
|
|
173
|
+
)
|
|
174
|
+
manager = ProcedureManager(f"{host}:{port}", worker_type)
|
|
175
|
+
try:
|
|
176
|
+
status = manager._helper.request.procedure(
|
|
177
|
+
"_log_msg_args", args_kwargs=(("procedure regression",), {}), queue=queue
|
|
178
|
+
)
|
|
179
|
+
status.wait(timeout_s=90, raise_on_failure=True)
|
|
180
|
+
assert status.done, "Procedure remained scheduled"
|
|
181
|
+
assert status.state == ProcedureState.SUCCESS
|
|
182
|
+
_wait_while(lambda: bool(manager.active_workers()), 20)
|
|
183
|
+
logs = manager._conn.xrange(MessageEndpoints.procedure_logs(queue), "-", "+") or []
|
|
184
|
+
assert any("procedure regression" in entry["data"].data for entry in logs)
|
|
185
|
+
assert any("procedure regression" in line for line in manager._logs)
|
|
186
|
+
finally:
|
|
187
|
+
try:
|
|
188
|
+
manager.shutdown()
|
|
189
|
+
finally:
|
|
190
|
+
if uses_container:
|
|
191
|
+
container_name = f"bec_procedure_{PROCEDURE.BEC_VERSION}_{queue}"
|
|
192
|
+
_run_and_capture_error("podman", "rm", "--force", "--ignore", container_name)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/live_table.py
RENAMED
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/move_device.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/SLS/__init__.py
RENAMED
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/SLS/sls_info.py
RENAMED
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/XTreme/__init__.py
RENAMED
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/XTreme/x-treme.py
RENAMED
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_beamline_mixins.py
RENAMED
|
File without changes
|
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_device_progress.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_move_callback.py
RENAMED
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_pretty_table.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_scan_workflows_lib_e2e.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|