Skip ROS-dependent integration tests when ROS backend unavailable
Integration tests requiring ROS backend were failing in regular CI builds due to attempting connections to non-existent ROS servers, causing timeouts with roslibpy.core.RosTimeoutError.
Changes
-
.github/workflows/integration.yml: SetCOMPAS_FAB_INTEGRATION_TESTS=1environment variable -
docs/examples/conftest.py: Skip 10 ROS-dependent example files (e.g.,03_forward_kinematics.py,04_plan_motion.py,05_collision_objects.py) unless environment variable present -
CHANGELOG.md: Document fix
Behavior
Regular builds (no ROS):
# These files now skip automatically:
# - files/03_forward_kinematics.py
# - files/04_plan_cartesian_motion.py
# - files/05_add_collision_mesh.py
# ... and 7 others
Integration builds (ROS via Docker):
COMPAS_FAB_INTEGRATION_TESTS=1 pytest docs # All tests run
Files requiring ROS consistently use with RosClient() as client: pattern which fails immediately without backend availability.
Original prompt
This section details on the original issue you should resolve
<issue_title>Investigate why integration tests fail on CI (but work locally)</issue_title>
<issue_description>The integration tests are failing when running on CI, but it's unclear why because they work locally.
The branch in which this occurs is the LTS one: LTS-main-1.x.
The log output is the following:
============================= test session starts ==============================
platform linux -- Python 3.11.14, pytest-8.4.2, pluggy-1.6.0
rootdir: /home/runner/work/compas_fab/compas_fab
configfile: pyproject.toml
testpaths: src, tests
plugins: cov-7.0.0, mock-3.15.1
collected 151 items
src/compas_fab/backends/pybullet/client.py . [ 0%]
src/compas_fab/backends/pybullet/utils.py s [ 1%]
src/compas_fab/backends/ros/client.py ... [ 3%]
src/compas_fab/backends/ros/messages/geometry_msgs.py .. [ 4%]
src/compas_fab/robots/constraints.py ......... [ 10%]
src/compas_fab/robots/inertia.py . [ 11%]
src/compas_fab/robots/planning_scene.py ........ [ 16%]
src/compas_fab/robots/reachability_map/vector_generators.py .. [ 17%]
src/compas_fab/robots/robot.py .......................s.... [ 36%]
src/compas_fab/robots/tool.py ... [ 38%]
src/compas_fab/robots/ur5.py . [ 39%]
src/compas_fab/robots/wrench.py ...... [ 43%]
src/compas_fab/sensors/base.py s [ 43%]
src/compas_fab/sensors/baumer.py ss [ 45%]
tests/api/test_api_completeness.py . [ 45%]
tests/api/test_api_stability.py . [ 46%]
tests/backends/kinematics/test_inverse_kinematics.py ...... [ 50%]
tests/backends/kinematics/test_kinematics.py . [ 50%]
tests/backends/ros/messages/test_std_msgs.py ............ [ 58%]
tests/backends/ros/test_local_cache_info.py .. [ 60%]
tests/backends/test_tasks.py .. [ 61%]
tests/robots/test_duration.py ........ [ 66%]
tests/robots/test_reachability.py .. [ 68%]
tests/robots/test_robot.py ...................................... [ 93%]
tests/robots/test_semantics.py ..... [ 96%]
tests/robots/test_trajectory.py .... [ 99%]
tests/robots/test_wrench.py . [100%]
=========================== short test summary info ============================
SKIPPED [5] ../../../../../opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/_pytest/doctest.py:458: all tests skipped by +SKIP option
======================= 146 passed, 5 skipped in 12.44s ========================
============================= test session starts ==============================
platform linux -- Python 3.11.14, pytest-8.4.2, pluggy-1.6.0
rootdir: /home/runner/work/compas_fab/compas_fab
configfile: pyproject.toml
plugins: cov-7.0.0, mock-3.15.1
collected 66 items
docs/examples/01_fundamentals/01_frame_and_transformation.rst ... [ 4%]
docs/examples/01_fundamentals/02_coordinate_frames.rst . [ 6%]
docs/examples/02_description_models/01_kinematic_model.rst . [ 7%]
docs/examples/02_description_models/02_robot.rst .... [ 13%]
docs/examples/03_backends_ros/01_ros_examples.rst .. [ 16%]
docs/examples/03_backends_ros/02_robot_models.rst .. [ 19%]
docs/examples/03_backends_ros/03_forward_and_inverse_kinematics.rst .FFF [ 25%]
[ 25%]
docs/examples/03_backends_ros/04_plan_motion.rst FF [ 28%]
docs/examples/03_backends_ros/05_collision_objects.rst FFF [ 33%]
docs/examples/03_backends_ros/09_ros_create_urdf_ur10_on_tower.rst . [ 34%]
docs/examples/05_backends_pybullet/01_pybullet_examples.rst ... [ 39%]
docs/examples/05_backends_pybullet/02_forward_and_inverse_kinematics.rst . [ 40%]
.. [ 43%]
docs/examples/06_backends_kinematics/01_ik_and_cartesian.rst ... [ 48%]
docs/examples/07_reachability_map/01_reachability_map.rst ........s [ 62%]
docs/examples/07_reachability_map/02_vector_generators.rst ............. [ 81%]
. [ 83%]
docs/examples/07_reachability_map/03_rp_2D.rst ..........s [100%]
=================================== FAILURES ====...
</details>
- Fixes compas-dev/compas_fab#454
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.