Skip to content

Commit 810673c

Browse files
authored
fix: rmw_zenoh not installed in test.yml (#15)
* fix: rmw_zenoh not installed in test.yml * fix: add the missing demo-nodes-cpp
1 parent 267d433 commit 810673c

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@ jobs:
1313
container:
1414
image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
1515
steps:
16-
- name: Install Node.js
16+
- name: Install system dependencies
1717
run: apt-get update && apt-get install -y nodejs
1818

1919
- name: Install ROS dependencies
20-
run: apt-get install -y ros-jazzy-example-interfaces
20+
run: |
21+
apt-get install -y \
22+
ros-jazzy-example-interfaces \
23+
ros-jazzy-rmw-zenoh-cpp \
24+
ros-jazzy-demo-nodes-cpp
2125
2226
- uses: actions/checkout@v4
2327

2428
- uses: actions-rust-lang/setup-rust-toolchain@v1
2529

26-
# FIXME: This fails on Github runner
27-
# - name: Run interop tests
28-
# shell: bash
29-
# run: |
30-
# source /opt/ros/jazzy/setup.bash
31-
# cargo test -p ros-z-tests --features interop-tests --release
30+
- name: Run interop tests
31+
shell: bash
32+
run: |
33+
source /opt/ros/jazzy/setup.bash
34+
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
35+
cargo test -p ros-z-tests --features interop-tests --release

ros-z-tests/tests/common/mod.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ impl Drop for ProcessGuard {
3232
pub static ZENOHD: once_cell::sync::Lazy<ProcessGuard> = once_cell::sync::Lazy::new(|| {
3333
println!("🚀 Starting shared rmw_zenohd daemon...");
3434

35+
// Check if rmw_zenoh_cpp is available
36+
if !check_rmw_zenoh_available() {
37+
panic!(
38+
"rmw_zenoh_cpp package not found!\n\
39+
Please install it with: apt install ros-$ROS_DISTRO-rmw-zenoh-cpp\n\
40+
Or ensure ROS environment is sourced: source /opt/ros/$ROS_DISTRO/setup.bash"
41+
);
42+
}
43+
3544
let child = Command::new("ros2")
3645
.args(["run", "rmw_zenoh_cpp", "rmw_zenohd"])
3746
.env("RMW_IMPLEMENTATION", "rmw_zenoh_cpp")
@@ -72,3 +81,14 @@ pub fn wait_for_ready(duration: Duration) {
7281
pub fn check_ros2_available() -> bool {
7382
Command::new("ros2").arg("--version").output().is_ok()
7483
}
84+
85+
/// Check if rmw_zenoh_cpp package is available
86+
pub fn check_rmw_zenoh_available() -> bool {
87+
Command::new("ros2")
88+
.args(["pkg", "prefix", "rmw_zenoh_cpp"])
89+
.stdout(Stdio::null())
90+
.stderr(Stdio::null())
91+
.status()
92+
.map(|status| status.success())
93+
.unwrap_or(false)
94+
}

0 commit comments

Comments
 (0)