Skip to content

Commit a6f3e8b

Browse files
committed
add debugging
1 parent fc32e4f commit a6f3e8b

22 files changed

Lines changed: 1245 additions & 0 deletions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ros:jazzy-ros-base
2+
3+
# Install system dependencies
4+
RUN apt-get update && apt-get install -y \
5+
curl \
6+
build-essential \
7+
libclang-dev \
8+
libyaml-dev \
9+
ros-jazzy-rcl \
10+
ros-jazzy-test-msgs \
11+
ros-jazzy-mimick-vendor \
12+
ros-jazzy-osrf-testing-tools-cpp \
13+
ros-jazzy-rcpputils \
14+
ros-jazzy-fastcdr \
15+
ros-jazzy-rosidl-typesupport-fastrtps-c \
16+
ros-jazzy-rosidl-typesupport-fastrtps-cpp \
17+
git \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
# Install Rust
21+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
22+
ENV PATH="/root/.cargo/bin:${PATH}"
23+
24+
WORKDIR /workspace
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
services:
2+
rmw-zenoh-rs-test:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
container_name: rmw-zenoh-rs-test
7+
working_dir: /workspace
8+
volumes:
9+
- ../../:/workspace/ros-z:ro
10+
- /home/circle/Workings/ZettaScale/project/nix-ros/ws/src/rclcpp:/workspace/rclcpp:ro
11+
- /home/circle/Workings/ZettaScale/project/nix-ros/ws/src/rcl:/workspace/rcl:ro
12+
- /home/circle/Workings/ZettaScale/project/nix-ros/ws/src/system_tests:/workspace/system_tests:ro
13+
- ./test-results:/workspace/test-results
14+
- ./test-rcl-excluded.sh:/workspace/test-rcl-excluded.sh:ro
15+
- ./test-system-tests.sh:/workspace/test-system-tests.sh:ro
16+
- ./test-system-tests-build.sh:/workspace/test-system-tests-build.sh:ro
17+
environment:
18+
- RMW_IMPLEMENTATION=rmw_zenoh_rs
19+
tty: true
20+
stdin_open: true
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "=== rmw_zenoh_rs Executor Tests ==="
5+
echo "Date: $(date)"
6+
echo "ROS Distro: jazzy"
7+
echo ""
8+
9+
# Setup
10+
RESULTS_DIR=/workspace/test-results
11+
mkdir -p $RESULTS_DIR
12+
13+
# Source ROS
14+
source /opt/ros/jazzy/setup.bash
15+
16+
# Install dependencies
17+
echo "=== Installing system dependencies ==="
18+
apt-get update
19+
apt-get install -y \
20+
curl \
21+
build-essential \
22+
libclang-dev \
23+
ros-jazzy-rclcpp \
24+
ros-jazzy-test-msgs \
25+
ros-jazzy-mimick-vendor \
26+
ros-jazzy-osrf-testing-tools-cpp \
27+
ros-jazzy-ament-cmake-google-benchmark \
28+
ros-jazzy-performance-test-fixture \
29+
ros-jazzy-rcpputils \
30+
ros-jazzy-fastcdr \
31+
ros-jazzy-rosidl-typesupport-fastrtps-c \
32+
ros-jazzy-rosidl-typesupport-fastrtps-cpp \
33+
git
34+
35+
# Install Rust
36+
echo "=== Installing Rust ==="
37+
if ! command -v cargo &> /dev/null; then
38+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
39+
source "$HOME/.cargo/env"
40+
fi
41+
export PATH="$HOME/.cargo/bin:$PATH"
42+
rustc --version
43+
cargo --version
44+
45+
# Create build workspace
46+
echo "=== Creating workspace ==="
47+
rm -rf /workspace/ws
48+
mkdir -p /workspace/ws/src
49+
cd /workspace/ws/src
50+
51+
# Copy ros-z sources (excluding _tmp and other non-essential directories)
52+
echo "=== Copying ros-z sources ==="
53+
cp -r /workspace/ros-z /workspace/ws/src/ros-z
54+
55+
# Add COLCON_IGNORE to directories that shouldn't be scanned
56+
for dir in _tmp book .github scripts ros-z-tests ros-z-console ros-z-py assets nix .config .claude; do
57+
if [ -d "/workspace/ws/src/ros-z/$dir" ]; then
58+
touch "/workspace/ws/src/ros-z/$dir/COLCON_IGNORE"
59+
fi
60+
done
61+
62+
# Copy local rclcpp fork (with patches)
63+
echo "=== Copying local rclcpp fork ==="
64+
cp -r /workspace/rclcpp /workspace/ws/src/rclcpp
65+
66+
# Copy local rcl fork (with patches)
67+
echo "=== Copying local rcl fork ==="
68+
cp -r /workspace/rcl /workspace/ws/src/rcl
69+
70+
# Build rmw_zenoh_rs
71+
echo "=== Building rmw_zenoh_rs ==="
72+
cd /workspace/ws
73+
source /opt/ros/jazzy/setup.bash
74+
colcon build --packages-select rmw_zenoh_rs --cmake-args -DCMAKE_BUILD_TYPE=Release
75+
76+
# Source the built workspace
77+
source /workspace/ws/install/setup.bash
78+
79+
# Build rcl and rclcpp with tests (colcon resolves dependencies)
80+
echo "=== Building rcl and rclcpp with tests ==="
81+
colcon build --packages-up-to rclcpp --cmake-args -DBUILD_TESTING=ON
82+
83+
# Source again after building
84+
source /workspace/ws/install/setup.bash
85+
86+
# Set RMW implementation
87+
export RMW_IMPLEMENTATION=rmw_zenoh_rs
88+
89+
echo ""
90+
echo "=== Verifying RMW implementation ==="
91+
echo "RMW_IMPLEMENTATION=$RMW_IMPLEMENTATION"
92+
93+
# Check if rmw_zenoh_rs library exists
94+
if [ -f "/workspace/ws/install/rmw_zenoh_rs/lib/librmw_zenoh_rs.so" ]; then
95+
echo "rmw_zenoh_rs library found!"
96+
else
97+
echo "ERROR: rmw_zenoh_rs library not found!"
98+
ls -la /workspace/ws/install/rmw_zenoh_rs/lib/ 2>/dev/null || echo "Directory not found"
99+
exit 1
100+
fi
101+
102+
echo ""
103+
echo "=== Running Executor Tests with rmw_zenoh_rs ==="
104+
echo ""
105+
106+
# Navigate to build directory for tests
107+
cd /workspace/ws/build/rclcpp
108+
109+
# Run executor tests and capture results
110+
TESTS=(
111+
"test_executors"
112+
"test_executors_intraprocess"
113+
"test_executors_busy_waiting"
114+
"test_executors_warmup"
115+
"test_executors_timer_cancel_behavior"
116+
"test_executors_callback_group_behavior"
117+
)
118+
119+
for test in "${TESTS[@]}"; do
120+
echo ""
121+
echo "=== Running $test ==="
122+
123+
# Run test with timeout and capture output
124+
if timeout 180 ctest -R "^${test}$" -V 2>&1 | tee "$RESULTS_DIR/${test}.log"; then
125+
echo "RESULT: $test PASSED"
126+
echo "PASSED" >> "$RESULTS_DIR/${test}.result"
127+
else
128+
EXIT_CODE=$?
129+
echo "RESULT: $test FAILED (exit code: $EXIT_CODE)"
130+
echo "FAILED (exit code: $EXIT_CODE)" >> "$RESULTS_DIR/${test}.result"
131+
fi
132+
done
133+
134+
# Summary
135+
echo ""
136+
echo "=== Test Summary ==="
137+
echo ""
138+
for test in "${TESTS[@]}"; do
139+
if [ -f "$RESULTS_DIR/${test}.result" ]; then
140+
echo "$test: $(cat $RESULTS_DIR/${test}.result)"
141+
else
142+
echo "$test: NOT RUN"
143+
fi
144+
done
145+
146+
echo ""
147+
echo "=== Detailed logs saved to $RESULTS_DIR ==="
148+
ls -la $RESULTS_DIR/
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "=== Testing test_count_matched and test_events ==="
5+
echo "Date: $(date)"
6+
echo ""
7+
8+
source /opt/ros/jazzy/setup.bash
9+
10+
# Install rmw_zenoh_cpp if not present
11+
apt-get update > /dev/null 2>&1
12+
apt-get install -y ros-jazzy-rmw-zenoh-cpp > /dev/null 2>&1
13+
14+
# Create workspace
15+
echo "=== Setting up workspace ==="
16+
rm -rf /workspace/ws
17+
mkdir -p /workspace/ws/src
18+
cd /workspace/ws/src
19+
20+
# Copy ros-z sources
21+
cp -r /workspace/ros-z /workspace/ws/src/ros-z
22+
23+
# Add COLCON_IGNORE to non-essential directories
24+
for dir in _tmp book .github scripts ros-z-tests ros-z-console ros-z-py assets nix .config .claude; do
25+
if [ -d "/workspace/ws/src/ros-z/$dir" ]; then
26+
touch "/workspace/ws/src/ros-z/$dir/COLCON_IGNORE"
27+
fi
28+
done
29+
30+
# Copy rcl fork for testing
31+
cp -r /workspace/rcl /workspace/ws/src/rcl
32+
33+
# Build rmw_zenoh_rs
34+
echo "=== Building rmw_zenoh_rs ==="
35+
cd /workspace/ws
36+
colcon build --packages-select rmw_zenoh_rs --cmake-args -DCMAKE_BUILD_TYPE=Release 2>&1 | tail -5
37+
38+
# Source workspace
39+
source /workspace/ws/install/setup.bash
40+
41+
# Build rcl tests only
42+
echo "=== Building rcl tests ==="
43+
colcon build --packages-select rcl --cmake-args -DBUILD_TESTING=ON 2>&1 | tail -5
44+
45+
source /workspace/ws/install/setup.bash
46+
47+
cd /workspace/ws/build/rcl/test
48+
49+
echo ""
50+
echo "=============================================="
51+
echo "=== Testing with rmw_zenoh_cpp ==="
52+
echo "=============================================="
53+
54+
echo ""
55+
echo "### test_count_matched (rmw_zenoh_cpp) ###"
56+
RMW_IMPLEMENTATION=rmw_zenoh_cpp timeout 60 ./test_count_matched 2>&1 || echo "Exit code: $?"
57+
58+
echo ""
59+
echo "### test_events (rmw_zenoh_cpp) ###"
60+
RMW_IMPLEMENTATION=rmw_zenoh_cpp timeout 60 ./test_events 2>&1 || echo "Exit code: $?"
61+
62+
echo ""
63+
echo "=============================================="
64+
echo "=== Testing with rmw_zenoh_rs ==="
65+
echo "=============================================="
66+
67+
echo ""
68+
echo "### test_count_matched (rmw_zenoh_rs) ###"
69+
RMW_IMPLEMENTATION=rmw_zenoh_rs timeout 60 ./test_count_matched 2>&1 || echo "Exit code: $?"
70+
71+
echo ""
72+
echo "### test_events (rmw_zenoh_rs) ###"
73+
RMW_IMPLEMENTATION=rmw_zenoh_rs timeout 60 ./test_events 2>&1 || echo "Exit code: $?"
74+
75+
echo ""
76+
echo "=== Done ==="

0 commit comments

Comments
 (0)