Skip to content

Commit a758f8c

Browse files
committed
fix(console): skip type description tests on ROS 2 Humble
Type description service is not supported in ROS 2 Humble. Tests were timing out after 60s in CI on Humble distro. Changes: - Add humble feature to ros-z-console Cargo.toml - Add build.rs to set ros_humble cfg when humble feature enabled - Add #![cfg(not(ros_humble))] to dynamic_subscriber_test.rs - Update CI workflow to pass humble feature when testing on Humble Tests now properly excluded on Humble: - test_dynamic_subscriber_std_msgs_string - test_dynamic_subscriber_sensor_msgs_laser_scan - test_dynamic_subscriber_multiple_topics Fixes timeout failures in Interop Tests (Humble) workflow.
1 parent 8b437c5 commit a758f8c

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
7272
if [ "${{ matrix.distro }}" = "humble" ]; then
7373
cargo nextest run -p ros-z-tests --no-default-features --features ros-interop,humble --release
74-
cargo nextest run -p ros-z-console --features ros-interop --release
74+
cargo nextest run -p ros-z-console --no-default-features --features ros-interop,humble --release
7575
else
7676
cargo nextest run -p ros-z-tests --features ros-interop,${{ matrix.distro }} --release
7777
cargo nextest run -p ros-z-console --features ros-interop --release

crates/ros-z-console/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ serial_test = "3.0"
3333
default = []
3434
# ROS interop tests require ros2 CLI with rmw_zenoh_cpp
3535
ros-interop = []
36+
# ROS 2 distro features (for conditional test compilation)
37+
humble = []

crates/ros-z-console/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fn main() {
2+
// Declare custom cfg for ROS version detection
3+
println!("cargo::rustc-check-cfg=cfg(ros_humble)");
4+
5+
// Set ros_humble cfg when humble feature is enabled
6+
if cfg!(feature = "humble") {
7+
println!("cargo:rustc-cfg=ros_humble");
8+
println!("cargo:warning=ROS Humble detected - skipping type_description tests");
9+
}
10+
}

crates/ros-z-console/tests/dynamic_subscriber_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![cfg(feature = "ros-interop")]
2+
#![cfg(not(ros_humble))]
23

34
mod common;
45

0 commit comments

Comments
 (0)