move the synthetic source into tests

It is a test fixture, so it lives in tests/. It was only ever an example by
placement: CI runs it as the end-to-end gate, SOURCE_FRAMES exists so CI can
bound it, and it publishes depth and camera_info because those inputs are typed
and strict validation fails on a typed input the dataflow does not wire -- none
of which is pedagogy. The worked example of wiring this node is the README's
usage block, against a real camera.

It stays a dora node rather than a pytest case because what it exercises is the
wiring and the event loop, which only a running dataflow covers. pytest does
not collect it: the filename does not start with `test_`.

dataflow.yml stays at the repository root rather than moving beside it. A
node's working directory is the directory of the dataflow file, and both nodes
build with `pip install .`, which needs pyproject.toml in that directory.
This commit is contained in:
2026-09-15 05:31:47 -03:00
parent 2b70d07868
commit 7d9ebe8b38
4 changed files with 30 additions and 22 deletions
+7 -9
View File
@@ -35,13 +35,14 @@ wiring several shows them side by side, scaled to a common height. `bbox`, `text
are overlays rather than panels — boxes are drawn on the `image` panel, in its own
pixels, and the caption on the composite.
### Runnable example
### End-to-end test
[`dataflow.yml`](dataflow.yml) is self-contained. [`examples/source.py`](examples/source.py)
[`dataflow.yml`](dataflow.yml) is self-contained. [`tests/source.py`](tests/source.py)
is a synthetic source node that emits an animated frame, a depth map of the same scene,
the camera intrinsics, the box around the square moving in the frame, and a caption —
every input this node draws — so the example needs no camera, no detector and no
network:
every input this node draws — so it needs no camera, no detector and no network. It is
a test fixture rather than a worked example; the realistic wiring is the block at the
top of this file. Run it to watch the node work:
```bash
dora run dataflow.yml --uv
@@ -53,11 +54,8 @@ to quit.
It builds the viewer from this checkout (`path:` + `build:`) rather than from a tag,
which is what lets `dora validate` pick up the manifest described below.
This example is also the end-to-end gate: CI runs the same dataflow headless on every
push, which is what keeps it from rotting. It earns its place twice over — it is the
only worked example of the *producing* side of these contracts, which is the fiddly
half of wiring this node. The realistic wiring, against a real camera, is the block at
the top of this file.
CI runs the same dataflow headless on every push, which is what makes it a gate rather
than a demo that rots.
Set `SOURCE_FRAMES` to stop the source after a fixed number of frames instead of running
until you quit; that plus `CI=true` is how the same dataflow runs headless as a test: