From e56f890bca0267f80519649b38dc4dd9c40271a6 Mon Sep 17 00:00:00 2001 From: Jonathan Fontanez Date: Tue, 14 Jul 2026 18:53:43 -0400 Subject: [PATCH] fix(tests): make the surviving package tests buildable; park pre-engine-free relics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The snapshot inherited test/example files that no longer build, for two different reasons: 1. Missing dev-deps (fixable): network's msgpack wire-format test uses rmp-serde — declared as a dev-dependency now (version dep only; pkg build rejects path deps). 2. Structural era mismatch (not fixable by deps): five test files + one example register processors IN-PROCESS via PROCESSOR_REGISTRY.register::(), which only worked when these packages compiled against the streamlib engine facade. As engine-free packages their processors implement the plugin SDK's traits, so in-process typed registration is impossible by design. Those files are parked verbatim in legacy-tests/ (with the jpeg fixtures) pending a rewrite against the module-loading flow — see legacy-tests/README.md. Also documents the local dev-registry flow in the README (packages with cross-package schema deps need STREAMLIB_REGISTRY_URL — emit from a streamlib checkout via xtask static-registry, publish this repo's packages into it), and fixes the .gitignore .cargo/config.toml pattern to match nested link artifacts (it was root-anchored). Verified: network cargo test 9+2 green, vadr-vision 22+4 green, mavlink 23 green — each via streamlib link --engine + the file:// dev registry. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_019w7Tw9EYuEvniYzGgFakrB --- .gitignore | 2 +- README.md | 32 +++++++++++++++++ legacy-tests/README.md | 33 ++++++++++++++++++ .../fixtures/test_320x180.jpg | Bin .../fixtures/test_640x360_spec.jpg | Bin .../jpeg_pipeline_demo.example.rs | 0 .../mavlink_over_udp.rs | 0 .../udp_burst_stress.rs | 0 .../tests => legacy-tests}/udp_loopback.rs | 0 .../udp_throughput_bench.rs | 0 .../udp_vadr_jpeg_e2e.rs | 0 packages/network/Cargo.toml | 4 +++ 12 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 legacy-tests/README.md rename {packages/vadr-vision/tests => legacy-tests}/fixtures/test_320x180.jpg (100%) rename {packages/vadr-vision/tests => legacy-tests}/fixtures/test_640x360_spec.jpg (100%) rename packages/vadr-vision/examples/jpeg_pipeline_demo.rs => legacy-tests/jpeg_pipeline_demo.example.rs (100%) rename {packages/mavlink/tests => legacy-tests}/mavlink_over_udp.rs (100%) rename {packages/network/tests => legacy-tests}/udp_burst_stress.rs (100%) rename {packages/network/tests => legacy-tests}/udp_loopback.rs (100%) rename {packages/network/tests => legacy-tests}/udp_throughput_bench.rs (100%) rename {packages/vadr-vision/tests => legacy-tests}/udp_vadr_jpeg_e2e.rs (100%) diff --git a/.gitignore b/.gitignore index 84a91c0..8a99cde 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ streamlib_modules/ *.slpkg # Cargo `[patch]` scratch a `streamlib link` may drop -.cargo/config.toml +**/.cargo/config.toml # Python __pycache__/ diff --git a/README.md b/README.md index da8f615..9ce5e6b 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,35 @@ These packages were extracted from the 2026-07-14 as a source snapshot. **Git history prior to 2026-07-14 lives in tatolab/streamlib** — this repo starts fresh and does not carry the pre-split commit history. + +## Running the package tests + +Each package's self-contained tests (`packages/network/tests/network_packet_serde_bytes_wire_format.rs`, +`packages/vadr-vision/tests/reassembly_integration.rs`) build against a +linked streamlib checkout. Packages whose schemas reference other +packages (`mavlink`, `vadr-vision` → `@tatolab/network`; `vadr-vision` → +`@tatolab/jpeg`) additionally need a registry for schema resolution, +because sibling-directory resolution is not a thing — schemas resolve by +version from the link checkout's `packages/` tree or a registry, and +`@tatolab/network` no longer lives in the streamlib checkout. + +The local dev-registry flow (no hosting required): + +```bash +# 1. Emit a registry tree from a streamlib checkout (core, jpeg, …): +cd +cargo run -p xtask -- static-registry emit --out /tmp/dev-registry + +# 2. Publish this repo's packages into the same tree: +export STREAMLIB_REGISTRY_URL="file:///tmp/dev-registry" +cd /packages/network && streamlib pkg publish + +# 3. Link + test any package: +cd ../mavlink +streamlib link --engine +STREAMLIB_REGISTRY_URL="file:///tmp/dev-registry" cargo test +``` + +`legacy-tests/` holds inherited test files that predate the engine-free +conversion and need a rewrite against the module-loading flow before +they can run again — see `legacy-tests/README.md`. diff --git a/legacy-tests/README.md b/legacy-tests/README.md new file mode 100644 index 0000000..ce61661 --- /dev/null +++ b/legacy-tests/README.md @@ -0,0 +1,33 @@ +# Legacy tests — pre-engine-free relics (not compiled) + +These test files were inherited from the streamlib monorepo snapshot but +predate the packages' conversion to the engine-free plugin SDK. They are +**not wired into any crate** and do not compile as written, for a +structural reason, not a missing-dependency reason: + +Each of them registers the package processors **in-process** via +`PROCESSOR_REGISTRY.register::()` +and then drives a `Runner` in the same process. That model only worked +when these packages compiled against the `streamlib` engine facade. As +engine-free packages, their processor types implement the plugin SDK's +traits — not the engine's — so in-process typed registration is +impossible by design (that is the capability split working as intended). + +The correct rewrite is the **module-loading flow**: build/link the +package into a host's `streamlib_modules/` and let the runtime dlopen it +(`runtime.add_processor(processor_type_ref!(...))` with lazy module +discovery), the same shape as streamlib's `load_project_dylib_*` +integration tests. Until someone does that rewrite, the files are parked +here so the test logic (scenarios, assertions, fixtures) isn't lost: + +| File | Original home | Pipeline exercised | +|---|---|---| +| `udp_loopback.rs` | packages/network | UdpSource → UdpSink loopback | +| `udp_burst_stress.rs` | packages/network | burst/overflow behavior | +| `udp_throughput_bench.rs` | packages/network | throughput measurement | +| `mavlink_over_udp.rs` | packages/mavlink | UdpSource → MavlinkDecoder → MavlinkEncoder → UdpSink round-trip | +| `udp_vadr_jpeg_e2e.rs` (+ `fixtures/`) | packages/vadr-vision | UDP chunks → depayloader → reassembly → JpegDecoder → frame counter (needs a GPU) | + +The self-contained tests that survived the conversion still live in +their packages: `packages/network/tests/network_packet_serde_bytes_wire_format.rs` +and `packages/vadr-vision/tests/reassembly_integration.rs`. diff --git a/packages/vadr-vision/tests/fixtures/test_320x180.jpg b/legacy-tests/fixtures/test_320x180.jpg similarity index 100% rename from packages/vadr-vision/tests/fixtures/test_320x180.jpg rename to legacy-tests/fixtures/test_320x180.jpg diff --git a/packages/vadr-vision/tests/fixtures/test_640x360_spec.jpg b/legacy-tests/fixtures/test_640x360_spec.jpg similarity index 100% rename from packages/vadr-vision/tests/fixtures/test_640x360_spec.jpg rename to legacy-tests/fixtures/test_640x360_spec.jpg diff --git a/packages/vadr-vision/examples/jpeg_pipeline_demo.rs b/legacy-tests/jpeg_pipeline_demo.example.rs similarity index 100% rename from packages/vadr-vision/examples/jpeg_pipeline_demo.rs rename to legacy-tests/jpeg_pipeline_demo.example.rs diff --git a/packages/mavlink/tests/mavlink_over_udp.rs b/legacy-tests/mavlink_over_udp.rs similarity index 100% rename from packages/mavlink/tests/mavlink_over_udp.rs rename to legacy-tests/mavlink_over_udp.rs diff --git a/packages/network/tests/udp_burst_stress.rs b/legacy-tests/udp_burst_stress.rs similarity index 100% rename from packages/network/tests/udp_burst_stress.rs rename to legacy-tests/udp_burst_stress.rs diff --git a/packages/network/tests/udp_loopback.rs b/legacy-tests/udp_loopback.rs similarity index 100% rename from packages/network/tests/udp_loopback.rs rename to legacy-tests/udp_loopback.rs diff --git a/packages/network/tests/udp_throughput_bench.rs b/legacy-tests/udp_throughput_bench.rs similarity index 100% rename from packages/network/tests/udp_throughput_bench.rs rename to legacy-tests/udp_throughput_bench.rs diff --git a/packages/vadr-vision/tests/udp_vadr_jpeg_e2e.rs b/legacy-tests/udp_vadr_jpeg_e2e.rs similarity index 100% rename from packages/vadr-vision/tests/udp_vadr_jpeg_e2e.rs rename to legacy-tests/udp_vadr_jpeg_e2e.rs diff --git a/packages/network/Cargo.toml b/packages/network/Cargo.toml index 8b353f2..cb48d52 100644 --- a/packages/network/Cargo.toml +++ b/packages/network/Cargo.toml @@ -36,4 +36,8 @@ socket2 = "0.5" libc = "0.2.177" tracing = { version = "0.1.41", features = ["release_max_level_debug"] } +[dev-dependencies] +# The wire-format test decodes NetworkPacket from msgpack directly. +rmp-serde = "1.3" + [workspace]