Submitting results from non-pytest sources #
When the test isn't a pytest function — LabVIEW, TestStand, a custom script, a legacy framework — use the Python LitmusClient to write results into the same store every Litmus runner writes to. The same litmus runs, litmus serve, and DuckDB queries see them.
Submit a result #
from litmus import LitmusClient
client = LitmusClient()
run = client.start_run(uut_serial="SN12345", station_id="bench_1", test_phase="production")
with run.step("voltage_check") as step:
step.measure("vcc", 3.31, unit="V", low=3.0, high=3.6)
run.finish()Wrap this in a one-file CLI to call it from a toolchain that can't run Python inline (LabVIEW Python Node, TestStand Python adapter, or subprocess).
Canonical reference #
The full API surface — LitmusClient, RunBuilder, StepBuilder, VectorBuilder, and the LabVIEW / TestStand / CLI integration patterns — lives on the Python client reference. This page is the integration-level entry point; that page is the API.
When to use which path #
| You have | Use |
|---|---|
| Python code with the results in hand | LitmusClient — chained builder, writes directly to the store |
| pytest tests | The pytest plugin, NOT this — see Litmus fixtures |
| Shell script or non-Python toolchain | Wrap the Python client in a one-file CLI; call it via subprocess |
| LabVIEW | LabVIEW pattern in client.md — Python Node call |
| TestStand | TestStand pattern in client.md — Python adapter |
HTTP API caveat #
POST /api/runs does NOT accept submitted results — it launches a pytest subprocess against a test_path. To submit results from a non-Python source, wrap the LitmusClient snippet above in a one-file CLI and call it from your toolchain. A direct HTTP results-submission endpoint is not currently available.
Querying results #
Once results are in the store, query through any of:
client.list_runs()/client.get_run()/client.get_measurements()— see client.md- CLI:
litmus runs,litmus show <run_id>— see cli.md - HTTP:
GET /api/runs,GET /api/runs/{run_id},GET /api/runs/{run_id}/measurements— see api.md - Raw parquet via DuckDB / pandas / Polars — see parquet-schema.md for columns and data-stores.md for the on-disk layout
See also #
- Python client reference — full API, integration patterns, examples
- Logging integration — sending results onward to external systems (S3, databases, Python logging)
- Parquet schema — column-by-column reference for the stored data
- Data stores — where the data lives, data_dir resolution, schema-evolution contract