Skip to content

Latest commit

 

History

History

integration

README.md

Integration tests

An integration test checks that components work together correctly. Individual components may work on their own while their connection still fails.

These tests start the real WAutoSim runner inside the WAutoSim Docker container, then use a small ROS node to listen to (and sometimes publish on) its topics. Outside Docker they are skipped.

What is checked

File Scene (fixtures) Checks
test_feedback_topics.py ros_core_scene.yaml /clock advances; ground-truth odometry publishes continuously with frames map/base_link, a parked position near the origin and a north heading; the custom ground-truth topic carries increasing sim time; GPS reports the spawn latitude/longitude; IMU acceleration is finite.
test_camera_lidar_topics.py ros_camera_lidar_scene.yaml Camera images have the configured 320x240 size and a consistent byte length; lidar point clouds are non-empty with x/y/z fields. Skipped if no NVIDIA GPU is visible (Chrono sensors render on the GPU).
test_mock_perception.py mock_perception_scene.yaml mock_perception_sim_node publishes object detections; only the mock cone ahead is detected, at about 20 m forward, 0 m left. The cone behind and the non-mock box are not. Skipped if wauto_perception_msgs is not built (it comes from WAutoDrive).
test_start_gating.py start_gating_scene.yaml The clock runs before the start signal; ground truth is held until a std_msgs/msg/Bool start signal arrives, then publishes.
test_driver_input.py minimal_scene.yaml A chrono_ros_interfaces/msg/DriverInputs command with throttle moves the vehicle more than 3 m.

Topics written as ~/... in a config are published under the Chrono ROS node, for example ~/output/test_gps/gps becomes /chrono_ros_node/output/test_gps/gps. The tests resolve these names the same way the WAutoSim tools do.

How the tests are built

conftest.py holds the shared setup:

  • launch_simulator("scene.yaml") starts the runner, waits until simulation time reaches 1 s (up to 90 s), and stops it after the test file finishes, including after failures. One simulator is shared by all tests in a file.
  • ros listens on a topic until enough messages arrive (collect), counts messages over a time window (count_for), or publishes a command repeatedly until an effect is seen (publish_until). Subscriptions are best-effort so they accept both reliable and best-effort publishers.

A failed check includes the simulator's (or node's) log in the failure message.

Running

From the CICD workspace directory in PowerShell, with Docker Desktop running:

powershell -NoProfile -ExecutionPolicy Bypass -File .\CI-CD-Infrastructure\run-docker-tests.ps1 -Target tests/integration

The launcher copies the tests into a temporary container directory, runs them, and removes the copy afterwards; see the smoke test guide for details of what it does and does not change. It also picks a random ROS_DOMAIN_ID and limits discovery to the local machine, because the container uses host networking and other ROS processes could otherwise see test topics.

Each test file starts its own simulator, so a full integration run takes a few minutes. To run one file, pass its path as the target instead.

See the test guide for placement and documentation guidance.