Skip to main content

lr-lumentest-sdk

Step-authoring SDK for LumenRadio LumenTest test sequences.

This package is for an embedded developer writing or updating test steps and sequences for a LumenTest production station, who wants a .venv and an editor with working imports, type hints and autocomplete for the step API — without checking out or installing the station itself. It ships the exact same lumentest_station source files the station runs, so a step written and tested against this package behaves identically when the station loads it.

Installation

pip install lr-lumentest-sdk

This package and lumentest-station both provide the lumentest_station import name and must never be installed into the same environment. A station developer already has the real package — install lr-lumentest-sdk only in a separate .venv dedicated to authoring steps and sequences.

Public API

from lumentest_station import (
    step_options,      # decorator: attaches step metadata (type, timeout, limits section)
    sequence_options,  # decorator: attaches sequence metadata (name, serial handling)
    run_tool,          # run an external tool as a supervised subprocess
    StepFailed,        # raise to fail the step; optionally carrying the ToolResult that failed
    ToolResult,        # what run_tool() returns: exit_code, stdout, stderr, timed_out
    Measurement,       # a single limits-checked measurement to report
    Unit,              # one unit of a multi-unit sequence (UNITS = [Unit(...), ...])
    step_main,         # run this step standalone from the command line
)

Running a single step

A step module can run itself directly, with no separate harness:

from lumentest_station import step_options, step_main


@step_options("PROGRAMMING", display_name="Flash Firmware")
def flash_firmware(test):
    ...


if __name__ == "__main__":
    raise SystemExit(step_main(flash_firmware))
python my_step.py --limits limits.toml --manifest artifact-manifest.json

For a step file with no __main__ guard, use the lumentest-step console script instead:

lumentest-step validate my_step.py
lumentest-step run my_step.py --limits limits.toml --manifest artifact-manifest.json --env NRF_TOOLS=/opt/nrf --results-dir ./results

validate is a static check only — it never imports the file, so it needs no hardware and no environment. It enforces the two rules the station's loader enforces: exactly one @step_options-decorated top-level function, and no direct subprocess use (steps call run_tool instead). run performs the same check, then imports and executes the step.

Options for run, and for step_main under a __main__ guard:

Option Purpose
--limits PATH TOML file of measurement limits; repeatable, later files win. Needed by any step that returns measurements.
--manifest PATH A package directory, or its artifact-manifest.json, so manifest.resolve(...) works against a real package
--env NAME=VALUE Set an environment variable for the step's run, repeatable. Production steps read station configuration from the environment, so this stands in for the station's [env] config.
--dut, --article, --revision, --station The identity fields the step sees on its test context
--timeout SECONDS Override the step's own @step_options(timeout=...)
--results-dir DIR Where captured stdout.txt, stderr.txt and traceback.txt land

The exit status is 0 when the step passed, 1 when it failed (an explicit StepFailed, or an out-of-limit measurement), and 2 on an error — an unexpected exception, a timeout, or a file the loader rejects.

A station does far more than run one step: it uploads to QRM, validates serial numbers, curates the PATH a tool is resolved against, and runs a whole sequence in order. None of that is reproduced here. A green standalone run says the step's own logic holds, not that the sequence will pass on a station.

Checking a package and running a sequence

lumentest-step check test/production --ci .gitlab-ci.yml
lumentest-step run-sequence test/production/production-test.py \
    --limits test/production/limits.toml --fake-tools test/production/_fakes

check runs the static checks over every file of a package. With --ci, it also checks the CI job's gladiator upload-file lines. They must upload every step a sequence imports to the sequence's Arena item, each under the right category. It exits 2 on an error, which makes it the check to run in a product repository's CI.

run-sequence runs every step of a sequence in order, as the station does. Fake tools stand in for hardware, and ALERTs are answered by --answer.

doc/step-sdk.md §12.5 and §12.6 list every check and option.

Full authoring guide

For the complete authoring reference — sequence structure, limits files, manifests, the step SDK's allowed third-party imports, and the full lumentest-step command reference — see doc/step-sdk.md in the LumenTest repository.

Metadata

Release files for lr-lumentest-sdk 0.11.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lr-lumentest-sdk 0.11.4
File Size Uploaded Provenance Actions
lr_lumentest_sdk-0.11.4.tar.gz 55.3 kB Without provenance Details for lr_lumentest_sdk-0.11.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lr-lumentest-sdk 0.11.4
File Interpreter ABI Platform Actions
lr_lumentest_sdk-0.11.4-py3-none-any.whl Python 3 none any Details for lr_lumentest_sdk-0.11.4-py3-none-any.whl

Total release size: 111.3 kB

Release files / lr_lumentest_sdk-0.11.4.tar.gz

Download URL lr_lumentest_sdk-0.11.4.tar.gz
Size 55.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c34941fac51bc82e5d62aaa0365fa5b95562097e9acd10cd500a1c25b4a7d816
BLAKE2b-256 checksum
How to use checksums
4c8861c4f2373f4685c54e90cfffe0d480299801d5f684b458e44a7601f2c86e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / lr_lumentest_sdk-0.11.4-py3-none-any.whl

Download URL lr_lumentest_sdk-0.11.4-py3-none-any.whl
Size 56.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8eb872ad967394f1b2f491e58c146607adb2f559e4efefcc3b428aacc549f2c8
BLAKE2b-256 checksum
How to use checksums
08422167c158a79ce5054cf4b4cd9c9ca66abc93799f20b759e1d450fd6bfa6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for lr-lumentest-sdk 0.11.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page