From 72f570042dff56f2d837292d65c1e7113ba27d1a Mon Sep 17 00:00:00 2001 From: nilsmechtel Date: Sun, 27 Sep 2026 02:26:22 +0200 Subject: [PATCH 1/2] test(cli): pin the forwarded worker option against argv, not merged output The assertion was result.output.strip().endswith("--workspace-dir /data/ws"). The worker image ships click 8.5, where CliRunner has no mix_stderr and result.output is stdout and stderr merged in write order, so any line the process writes to stderr inside the invoke window lands after the echoed command and breaks the suffix check. Verified in-image: a single stderr write during invoke turns the endswith False while the command itself is unchanged. The command is now run for real with subprocess.call faked by the existing _fake_runtime helper, and the recorded argv is compared element by element. That pins strictly more than the old suffix did and cannot be perturbed by anything else the process prints. Co-Authored-By: Claude Opus 5 (1M context) --- tests/cli/test_worker_cli.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/cli/test_worker_cli.py b/tests/cli/test_worker_cli.py index a27501ed..3a16e081 100644 --- a/tests/cli/test_worker_cli.py +++ b/tests/cli/test_worker_cli.py @@ -207,13 +207,24 @@ def test_worker_arguments_are_forwarded_verbatim(): assert _build("native", worker_args=args)[3:] == list(args) -def test_an_option_the_cli_also_defines_still_reaches_the_worker(): - """``--workspace-dir`` after ``--`` configures the worker, not the container.""" - result = _run( - ["start", "--runtime", "native", "--dry-run", "--", "--workspace-dir", "/data/ws"] - ) +def test_an_option_the_cli_also_defines_still_reaches_the_worker(monkeypatch): + """``--workspace-dir`` after ``--`` configures the worker, not the container. + + Asserted against the argv the runtime was called with rather than against + ``result.output``: click 8.2 dropped ``mix_stderr``, so ``output`` is stdout + and stderr merged, and anything else the process writes to stderr inside the + invoke window would land in it. + """ + started = _fake_runtime(monkeypatch, "") + result = _run(["start", "--runtime", "native", "--", "--workspace-dir", "/data/ws"]) assert result.exit_code == 0, result.output - assert result.output.strip().endswith("--workspace-dir /data/ws") + assert started[0][0] == [ + "python", + "-m", + "bioengine.worker", + "--workspace-dir", + "/data/ws", + ] def test_no_worker_arguments_still_starts_the_worker_module(): From a15977fb9dc08b69b2b67bed74e20fbaff526db8 Mon Sep 17 00:00:00 2001 From: Nils Mechtel <49943582+nilsmechtel@users.noreply.github.com> Date: Sun, 27 Sep 2026 03:13:20 +0200 Subject: [PATCH 2/2] chore(release): bump version to 0.16.28 --- bioengine/_version.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bioengine/_version.py b/bioengine/_version.py index a64a172f..60b31ee6 100644 --- a/bioengine/_version.py +++ b/bioengine/_version.py @@ -13,4 +13,4 @@ Must stay in lock-step with ``pyproject.toml``'s ``version`` field. The ``version-check.yml`` CI workflow enforces the match. """ -__version__ = "0.16.27" +__version__ = "0.16.28" diff --git a/pyproject.toml b/pyproject.toml index 43b101b5..0af8d6c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "bioengine" -version = "0.16.27" +version = "0.16.28" description = "BioEngine — CLI and SDK for deploying and calling AI model services on BioEngine workers" requires-python = ">=3.11" authors = [