Skip to content

Add hardware testing scaffold#28

Open
ceej640 wants to merge 2 commits into
gently-project:developmentfrom
ceej640:ceej/issue-18-hardware-tests
Open

Add hardware testing scaffold#28
ceej640 wants to merge 2 commits into
gently-project:developmentfrom
ceej640:ceej/issue-18-hardware-tests

Conversation

@ceej640

@ceej640 ceej640 commented May 31, 2026

Copy link
Copy Markdown
Collaborator

Closes #18.

Summary:

  • Add pytest markers and flags for offline hardware tests and opt-in live hardware checks.
  • Add a dependency-free MockQueueServerClient and HardwareCondition helpers for hardware-dependent code.
  • Add offline contract tests plus a skipped-by-default live device-layer state check.
  • Document how to run hardware and live_hardware tests.

Verification:

  • .\.venv\Scripts\python.exe -m pytest tests/hardware -q -p no:cacheprovider
  • git diff --check

@pskeshu

pskeshu commented Jun 1, 2026 via email

Copy link
Copy Markdown
Collaborator

@ceej640

ceej640 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

Agreed. The important distinction is what level of the system the simulator is meant to cover.

This PR is only a first-layer scaffold for device-layer/offline contract tests. It is useful for checking command semantics and safety gates without live hardware, but it is not a simulated microscope.

Before adding richer simulation, I would define a testing coverage matrix with separate layers:

  • device command contract tests: fast mocks for API behavior and safety validation
  • hardware digital twins: stateful simulations for devices such as stages, cameras, lasers, temperature control, and queue timing
  • optical/perception simulation: synthetic sample, image formation, noise, drift, focus, and segmentation/perception outputs
  • sample dynamics: biological state over time, development, movement, perturbation, and damage/exposure effects
  • end-to-end experiment rehearsal: whether Gently can plan, acquire, react, and recover across those layers

The meta-question should come first: what risk is each test meant to catch, what fidelity is needed, and what is deliberately out of scope. I would keep this PR as the lowest layer and use a follow-up design/test-plan PR for the broader simulation strategy.

@ceej640

ceej640 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up implemented from this thread in commit af216c2.

I added a simulation coverage matrix to docs/testing-hardware.md. It distinguishes:

  • device command contract tests
  • hardware digital twins
  • optical/perception simulators
  • sample dynamics simulators
  • end-to-end experiment rehearsal

The current mock client is now explicitly scoped as the lowest device-command layer, not a full simulated microscope. That keeps this PR useful while making the broader testing strategy clear.

Verification:

  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants