Skip to content

ci: run recovery-safety unit tests in host contribution workflow - #68

Merged
makers-pet merged 2 commits into
makerspet:mainfrom
smailzhu:ci/recovery-safety-tests
Sep 28, 2026
Merged

makers-pet merged 2 commits into
makerspet:mainfrom
smailzhu:ci/recovery-safety-tests

Conversation

@smailzhu

Copy link
Copy Markdown
Contributor

Proposal

Add the oomwoo_recovery_safety unit tests to the python job in
host-contribution-tests.yml. They run on pushes to main and on pull requests.

This is a proposal. It adds pytest to a job that currently runs only stdlib
unittest with no pip install. That relaxes the job's dependency-free
boundary. Your call whether the trade is worth it.

Why

  • recovery-safety handles bounded recovery escalation and safety-event pauses.
  • 13 unit tests exist and pass. Nothing in CI runs them today.
  • A regression in this logic would not turn CI red.
  • The core ladder is pure Python. The adapter tests stub rclpy via sys.modules.
  • So the suite runs on a bare runner: no ROS 2 graph, no Gazebo, no hardware.

Scope

  • Host-level unit coverage.
  • Complements the package's colcon build/test/test-result path, which builds
    and tests in a ROS 2 environment.
  • Does not replace it. A test against a real ROS graph is future work.

Change

Two steps added to the python job:

  • install pytest
  • run PYTHONPATH="$PWD" python3 -m pytest test -q in the package root (rclpy stubbed)

Verification

Ran the updated workflow on a fork. All steps passed, including the new
recovery-safety step. It reported 13 passed (~0.04s in that run).

Trade-off

  • Pro: cheap regression coverage for recovery logic CI currently ignores.
  • Con: adds pytest + one pip install to a stdlib-only job. Unit coverage
    only, not full ROS integration.

smailzhu and others added 2 commits September 25, 2026 15:41
The oomwoo_recovery_safety package ships unit tests for the recovery
ladder (guaranteed termination + safety-pause behavior), but they were
not exercised by CI. The adapter tests stub rclpy via sys.modules, so
the whole suite runs with just pytest and no ROS graph.

Add a pytest install step and run the suite with PYTHONPATH set to the
package root.
@makers-pet
makers-pet merged commit fc8eb03 into makerspet:main Sep 28, 2026
2 checks passed
@makers-pet

Copy link
Copy Markdown
Collaborator

Thank you!

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