Repository navigation
arisrvx: ServerHarness for a service's tests, and the end-to-end ctest (S7) - #1177
Merged
Merged
Conversation
…t (S7) pycvc.ariadne.testing.ServerHarness (ARIADNE_SCRIPTING_HOSTS.md 6.5.8) plays arisrvx for a service's tests under plain python, with no relay and no network. It drives arisrvx's own dispatch, _Program, on host.loop with an in-process link in place of the relay, so the authenticate hook, the read_scope hook, the role gates, ctx, the timeouts, CallError and the per-principal limits are the same code a relay runs. - connect(bearer) asks the authenticate hook (Refused when the relay would refuse), or client(principal). A client's call, call_with (room-call-opts), acall and acall_with return the value or raise CallError with the client's code; progress[name] holds the latest call's steps. Values cross through pycvc's capsules, as the wire carries them. - get, get_tree and reads show what the relay would send the client: publish= namespaces, bounded by its principal's read scope, which host.refresh_scope updates. host.disconnect closes the principal's clients. - pycvc.ariadne.testing is registered by the module itself (one file). - The end-to-end ctest arisrvx_echo_service: tests/echo_service.py (an HTTP route and an export over one function, a fixed-token authenticate hook, the published echo subtree, a read scope of echo.public) against tests/echo_client.ari, which joins, calls the export, checks its reply and progress, reads what it wrote, is not sent echo.private, and fetches the route. relay_pair.py --client-net-asgi allows the origin the program serves on. - Roadmap: S6 is done (#1147), S7 built; ARIADNE.md 9.8.6. Tests: pycvc_ariadne_harness, arisrvx_echo_service.
#1159 (O7c) kept the last source sea_surface found in a thread_local, so the velocity a fluid field reads after a cell's height at the same point and time did not invert the sideways move again. A thread_local that keeps state between calls is a static cache, which libcvc's no-singletons rule forbids (VOLROVER-LIBRARY-PORTS-ROADMAP.md 1.3, tools/singleton_scan). #1159's release-grpc job, where the scan runs, was cancelled, so the scan never judged it; the next PR that merges master would fail that lane on it. The memo now belongs to the caller: - sea_surface::source_memo, and height() / velocity() overloads that take one. The plain reads share nothing. - fluid_surface::height_with / velocity_with and a surface_memo the caller owns; the defaults ignore it. ocean_surface passes it to the sea. - field_set::apply keeps one memo per cell, for the cell's height and its velocity at the same clipped centre. The memo is keyed on the point, the time and the digest as before, so every value is unchanged.
…lient cannot load CI's Python has fastapi but not the HTTP client starlette.testclient wants, and starlette says so with a RuntimeError, not an ImportError: pycvc-linux / cp312 failed on it. The HTTP half now skips on either.
pycvc-linux failed pycvc_ariadne_harness: CI's Python has FastAPI but no httpx, and starlette.testclient raises RuntimeError (not ImportError) when it finds neither httpx2 nor httpx, so the test's skip guard never caught it. The guard now catches both, and CI installs httpx-cp312 (noarch on cvcpkg.org) so the HTTP half runs there too. Tests: pycvc_ariadne_harness on Windows, 38 checks with httpx and 37 with httpx and httpx2 hidden (the HTTP half skipped).
…ata scan passes
transfix
enabled auto-merge (squash)
November 13, 2026 03:54
transfix
added a commit
that referenced
this pull request
Nov 14, 2026
Conflicts, all master's #1216 and #1177 against this branch's embedded Python: - python_engine.cpp: _arihost stays made at boot by install_arihost (no inittab entry); its docstring takes #1216's name for the host, pycvc.ari.Host(). - ARIADNE_SCRIPTING_HOSTS.md: the same, in the roadmap's words. - arigl/main.cpp: the conference camera keeps this branch's kWalkKeys comment and gains master's setMouseLookOrbits(true). Nothing master added calls what this branch removed (g_python, g_wasm, lent(), script_engine(), the inittab module, the CUDA manager's instance(), the load bench's globals). Checked on Windows (MSVC Release): full build; ratchet ok against #1217's allowlist (22 lines) and master's (59), 13 here; the scan's own tests; format clean; the host, Python and multi-app ctests, 24 pass and 18 skip (FTXUI and matplotlib, absent here), pycvc_ari and pycvc_ariadne_harness among the passes.
transfix
added a commit
that referenced
this pull request
Nov 15, 2026
#1216 moved the Python Host to `pycvc.ari` and left `pycvc_gl.ariadne` as an alias. To stay off lines that open PRs edited, it kept the old name in a few places. With #1169 in, they can change. Comments, docstrings and Markdown only. ## Now `pycvc.ari` - `ariadne_server.py`: the module docstring ("as `pycvc.ari.Host`'s do") and the values section's comment. - ARIADNE.md: - where `display(obj)` is predefined; - what arisrvx's `host.set` / `set_tree` / `set_series` / `set_plot` match. - Docstrings: `ariadne_display`'s (which host it shows in) and `ariadne_mpl.attach`'s. - Comments: the `pycvc_gl_ariadne_host` test's in `bindings/pycvc/CMakeLists.txt`, and the ariglx smoke's in `publish-cvcpkg.yml`. ## The roadmap (ARIADNE_SCRIPTING_HOSTS.md) - The plan's matplotlib bullet named `pycvc_gl.ariadne.mpl`. It now names the backend that shipped, `pycvc_gl.ariadne_mpl`. - The "as built" note says why: the Host's module is a module, not a package. It said `pycvc_gl.ariadne`; it now says `pycvc.ari`. - S7 is done: - the status says it shipped in #1177; - §10's row is **Done** (it said **Built**). ## Left as they are - Lines that say `pycvc_gl.ariadne` is the same module: - `ari.py` and the alias itself; - `pycvc.i`, and two CMake comments; - `link-host.sh`, the arix recipe, and ARIADNE.md §9.3. - Code that imports through the alias: - `cars.py`; - the `pycvc_gl_*` tests; - the matplotlib test documents. These keep the old name tested. ## Checks - `git grep 'pycvc_gl\.ariadne\b'` finds only the lines above. - The three edited Python files parse. - No changed line passes 100 columns, except the §10 table row, which was already longer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
S7 of the scripting-hosts roadmap (docs/roadmap/ARIADNE_SCRIPTING_HOSTS.md §6.5.8), the last phase of the application-services cut: testing a service without a server, and one end-to-end test in CI.
What it adds
pycvc.ariadne.testing.ServerHarness, for a service's tests under plainpython(pytest, with FastAPI'sTestClientfor the HTTP half). No relay, no network._Program) onhost.loop, with an in-process link in place of the relay. So these are the same code a relay runs, not a copy:ctx;CallError;TypeError).connect(bearer)raisesRefusedwhen the relay would refuse the connection.client(principal)makes a client as though the hook had admitted it.call,call_with(room-call-opts),acallandacall_withreturn the value, or raiseCallErrorwith the code the client would get.progress[name]holds the latest call's steps.get,get_treeandreadsshow what the relay would send the client: thepublish=namespaces, bounded by its principal's read scope (S6).host.refresh_scopeupdates that scope, andhost.disconnectcloses the principal's clients.pycvc.ariadne.testingis registered by the module itself, since it is a single file.conftree.arisrvx_echo_service.tests/echo_service.pyhas an HTTP route and an export over one function, an authenticate hook with a fixed test token, theechosubtree its document publishes, and a read scope ofecho.public.tests/echo_client.ari(run byarixwhen it is built, elseari) joins with the token and calls the export (its reply, its typedint, its progress). Then it reads what the export wrote, checks it is not sentecho.private, and fetches the route.relay_pair.py --client-net-asgipasses--net-allowfor the origin in the program's "serving ASGI on" line.Tests
pycvc_ariadne_harness(bindings/pycvc/test_pycvc_ariadne_harness.py) runs a small service under plain python. It checks:auth_timeout, a failing read_scope, and no hook;ctxand progress, typed values, role gates,CallErrorwhole,internal,deadline_exceeded,not_found, and the idempotency key;call_concurrency'srate_limited;refresh_scope, andhost.disconnect;TestClient.arisrvx_echo_service, as above.Run locally on Windows (static Release, gRPC + WS, pycvc core, FastAPI and uvicorn in the arisrvx Python):
-j 3, both new ones included.arisrvx_echo_serviceran its five client tests througharix, with the read_scope hook on and the route fetched on its ephemeral port.pycvc_ariadne_harness: 38 checks, with the FastAPI half run.src/arisrvandbindings/pycvc, which the browser build doesn't include. So for the browser I ran a configure with CI's arigl-web flags (clean) rather than a compile identical to master's.Not in this PR
arisrvxwith S1-S7 is unpublished until a v* release, on Joe's go-ahead.