Skip to content

Commit 71eacbd

Browse files
committed
Add local testing instructions to AGENTS.md
1 parent a3aa215 commit 71eacbd

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

AGENTS.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
1+
# Testing Guide for elevation_mapping_cupy
2+
3+
## Running Tests Locally
4+
5+
### Prerequisites
6+
7+
```bash
8+
# Source ROS2
9+
source /opt/ros/jazzy/setup.bash
10+
11+
# Build the package
12+
colcon build --packages-select elevation_mapping_cupy
13+
14+
# Source the workspace
15+
source install/setup.bash
16+
```
17+
18+
### Run All Tests via colcon
19+
20+
```bash
21+
colcon test --packages-select elevation_mapping_cupy --event-handlers console_direct+
22+
```
23+
24+
### Run Unit Tests Only (pytest)
25+
26+
These are the primary regression tests for the axis-swap bug. They don't require ROS nodes to be running.
27+
28+
```bash
29+
# Run all unit tests
30+
cd elevation_mapping_cupy/elevation_mapping_cupy/tests/
31+
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -v
32+
33+
# Run specific test file
34+
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest test_map_shifting.py -v
35+
36+
# Run specific test
37+
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest test_map_shifting.py::TestShiftMapXY::test_shift_x_only_affects_columns -v
38+
```
39+
40+
### Run Integration Tests Only (launch_testing)
41+
42+
These test the full TF → GridMap pipeline with actual ROS nodes.
43+
44+
```bash
45+
# Stop daemon first to avoid DDS issues
46+
ros2 daemon stop
47+
48+
# Run with DDS fixes
49+
FASTDDS_BUILTIN_TRANSPORTS=UDPv4 python3 -m launch_testing.launch_test \
50+
src/elevation_mapping_cupy/elevation_mapping_cupy/test/test_tf_gridmap_integration.py
51+
```
52+
53+
### Test Summary
54+
55+
| Test File | Type | What it tests |
56+
|-----------|------|---------------|
57+
| `test_map_shifting.py` | Unit (pytest) | Axis-swap bug regression - `shift_map_xy()` function |
58+
| `test_map_services.py` | Unit (pytest) | Map service handlers |
59+
| `test_tf_gridmap_integration.py` | Integration (launch_testing) | Full TF → GridMap pipeline |
60+
61+
---
62+
163
# ROS2 Integration Testing: DDS Discovery Fixes
264

365
This document captures lessons learned from fixing DDS discovery issues in `launch_testing` integration tests.

0 commit comments

Comments
 (0)