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:
+10
-5
@@ -1,6 +1,11 @@
|
||||
# The repository's own example, and its end-to-end test: a synthetic source
|
||||
# feeding the viewer. Everything it needs is in this checkout -- no camera, no
|
||||
# detector, no network -- so it is also what CI runs.
|
||||
# The end-to-end test: a synthetic source feeding the viewer. Everything it
|
||||
# needs is in this checkout -- no camera, no detector, no network -- which is
|
||||
# what lets CI run it rather than only validate it.
|
||||
#
|
||||
# It lives at the repository root rather than beside tests/source.py because 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.
|
||||
#
|
||||
# Both nodes are built from the checkout with `path:` + `build:`, which is what
|
||||
# lets `dora validate` pick up the typed contract in dora-node.yml. A consumer
|
||||
@@ -11,7 +16,7 @@ strict_types: true
|
||||
|
||||
nodes:
|
||||
- id: source
|
||||
# Run through the interpreter rather than as `path: examples/source.py`.
|
||||
# Run through the interpreter rather than as `path: tests/source.py`.
|
||||
#
|
||||
# A dora-node.yml describes exactly one node and is what gets published
|
||||
# (`dora hub publish` expects it beside pyproject.toml), and this
|
||||
@@ -25,7 +30,7 @@ nodes:
|
||||
# interpreter leaves nothing for it to match, and `output_types` below is
|
||||
# the documented way to type an output without one.
|
||||
path: python
|
||||
args: examples/source.py
|
||||
args: tests/source.py
|
||||
# The source needs dora-rs, numpy and pyarrow; installing the project gives
|
||||
# it exactly the versions pinned in uv.lock.
|
||||
build: pip install .
|
||||
|
||||
Reference in New Issue
Block a user