Skip to content

refactor(autoware_trajectory_validator): consolidate test targets#12467

Open
yhisaki wants to merge 3 commits intoautowarefoundation:mainfrom
tier4:refactor-trajectory-validator-tests
Open

refactor(autoware_trajectory_validator): consolidate test targets#12467
yhisaki wants to merge 3 commits intoautowarefoundation:mainfrom
tier4:refactor-trajectory-validator-tests

Conversation

@yhisaki
Copy link
Copy Markdown
Contributor

@yhisaki yhisaki commented Apr 10, 2026

Description

Before this PR, autoware_trajectory_validator built its tests as multiple executables and kept redundant setup code in the traffic light filter test.

This PR refactors the trajectory validator test configuration.

  • Consolidates the trajectory validator tests into a single test executable
  • Replaces hard-coded target names in CMakeLists.txt with ${PROJECT_NAME}-based names
  • Simplifies test_traffic_light_filter.cpp by removing unused node setup, redundant main, and an unused helper header

Related links

Parent Issue:

  • None.

Notes for reviewers

The current diff also switches the aggregated test target to ament_auto_add_gtest(...), so reviewers should confirm that the required link dependencies for the node-oriented test remain satisfied in CI.

Interface changes

ROS Parameter Changes

Additions and removals

Change type Parameter Name Type Default Value Description
None None None None None

Modifications

Version Parameter Name Type Default Value Description
None None None None None

Topic changes

Additions and removals

Change type Topic Type Topic Name Message Type Description
None None None None None

Modifications

Version Topic Type Topic Name Message Type Description
None None None None None

Effects on system behavior

None. This change only affects test code and test build configuration.

Signed-off-by: Y.Hisaki <yhisaki31@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@yhisaki yhisaki added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Apr 10, 2026
test/plugins/test_vehicle_constraint_filter.cpp
)

ament_auto_add_gtest(test_${PROJECT_NAME}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the tests use ros2 communication they need to be added with ament_add_ros_isolated_gtest.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxime-clem
Thanks!
I found that the only difference between ament_auto_add_gtest and ament_add_ros_isolated_gtest is just a RUNNER.

https://github.com/ros2/ament_cmake_ros/blob/1ebf5450912a971d70638a0713a2c18b649a4d1d/ament_cmake_ros/cmake/ament_add_ros_isolated_test.cmake

So, I set RUNNER manually ad601ac.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had missed that line. However, I believe it is better to use ament_add_ros_isolated_gtest instead of setting the RUNNER manually.
The main reason is that in the future the way to run isolated tests may change and the macro may be updated, and this code may miss the update.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. At first, I wanted to use the automatic dependency resolution feature in ament_auto_xxx, but it can't be helped😢
If there's no better way, I'll revert it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

3 participants