Skip to content

test(autoware_traffic_light_visualization): add characterization test for TrafficLightMapVisualizerNode - #12487

Merged
takam5f2 merged 3 commits into
autowarefoundation:mainfrom
takam5f2:feat/add-characterization-test-map-visualizer-v2
Apr 21, 2026
Merged

takam5f2 merged 3 commits into
autowarefoundation:mainfrom
takam5f2:feat/add-characterization-test-map-visualizer-v2

Conversation

@takam5f2

Copy link
Copy Markdown
Contributor

Description

Add characterization tests for TrafficLightMapVisualizerNode to capture the current behavior before refactoring. The node has several refactoring candidates including logic/node separation, dead code removal, and deeply nested loop simplification. These tests serve as a safety net to ensure behavior is preserved during those changes.

5 test cases covering:

  • RED / GREEN / AMBER traffic light → corresponding colored sphere marker
  • All three colors simultaneously → 3 markers with correct colors
  • Non-matching group ID → empty MarkerArray

Related links

Parent Issue:

  • None

How was this PR tested?

colcon build --packages-select autoware_traffic_light_visualization \
  --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
colcon test --packages-select autoware_traffic_light_visualization \
  --event-handlers console_direct+

All 5 tests pass.

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

…s for TrafficLightMapVisualizerNode

Add characterization tests to capture the current behavior of
TrafficLightMapVisualizerNode before refactoring. These tests serve as
a safety net to ensure behavior is preserved during upcoming logic
separation and code cleanup.
@github-actions github-actions Bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Apr 16, 2026
@takam5f2 takam5f2 added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) and removed component:perception Advanced sensor data processing and environment understanding. (auto-assigned) labels Apr 16, 2026
@github-actions

github-actions Bot commented Apr 16, 2026 •

Copy link
Copy Markdown

Thank you for contributing to the Autoware project!

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

Please ensure:

@codecov

codecov Bot commented Apr 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.25%. Comparing base (707e1dd) to head (22b51d6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #12487       +/-   ##
===========================================
+ Coverage   18.53%   19.25%    +0.72%     
===========================================
  Files        1916        6     -1910     
  Lines      131184      270   -130914     
  Branches    44341       39    -44302     
===========================================
- Hits        24314       52    -24262     
+ Misses      86872      187    -86685     
+ Partials    19998       31    -19967     
Flag Coverage Δ
full-suite 19.25% <ø> (+0.72%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@takam5f2 takam5f2 self-assigned this Apr 21, 2026

@a-maumau a-maumau left a comment

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.

LGTM!

only one comment for the typo in the comment.

…m with XZ side view

Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
@github-actions github-actions Bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Apr 21, 2026
@takam5f2
takam5f2 enabled auto-merge (squash) April 21, 2026 13:14
@takam5f2
takam5f2 merged commit a73d1e0 into autowarefoundation:main Apr 21, 2026
31 of 32 checks passed
@github-project-automation github-project-automation Bot moved this from To Triage to Done in Software Working Group Apr 21, 2026
@takam5f2
takam5f2 deleted the feat/add-characterization-test-map-visualizer-v2 branch April 21, 2026 13:32
mkquda pushed a commit to tier4/autoware_universe that referenced this pull request Apr 22, 2026
… for TrafficLightMapVisualizerNode (autowarefoundation#12487)

* test(autoware_traffic_light_visualization): add characterization tests for TrafficLightMapVisualizerNode

Add characterization tests to capture the current behavior of
TrafficLightMapVisualizerNode before refactoring. These tests serve as
a safety net to ensure behavior is preserved during upcoming logic
separation and code cleanup.

* test(autoware_traffic_light_visualization): clarify map layout diagram with XZ side view

Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>

---------

Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
XiaoyuWang0601 pushed a commit to XiaoyuWang0601/autoware_universe that referenced this pull request Apr 23, 2026
… for TrafficLightMapVisualizerNode (autowarefoundation#12487)

* test(autoware_traffic_light_visualization): add characterization tests for TrafficLightMapVisualizerNode

Add characterization tests to capture the current behavior of
TrafficLightMapVisualizerNode before refactoring. These tests serve as
a safety net to ensure behavior is preserved during upcoming logic
separation and code cleanup.

* test(autoware_traffic_light_visualization): clarify map layout diagram with XZ side view

Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>

---------

Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
Signed-off-by: XiaoyuWang0601 <xiaoyu.wang@tier4.jp>
takam5f2 added a commit that referenced this pull request May 15, 2026
… and tidy internal naming (#12553)

Second of a planned series of incremental refactors for
traffic_light_map_visualizer (follow-up to #12511).

- Introduce Bulb { id, position, color } and BulbsByGroupId, and
  extract `extract_bulbs(map_traffic_lights) -> BulbsByGroupId` as a
  free function. TrafficLightVisualizer no longer holds
  lanelet::ConstPoint3d; lanelet API knowledge is confined to the
  conversion seam.
- Extract `parse_bulb_color` helper.
- Tidy helper signatures (pass Time by value, hoist `using` to
  namespace scope) and scope TrafficLightGroupArray / LaneletMapBin
  aliases to the node class private section.
- Internal renames for clarity: viz_lanelet_map -> lanelet_map,
  regulatory_element -> traffic_light, traffic_lights ->
  map_traffic_lights, current_time -> stamp, plus subscription /
  publisher / callback member updates.
- Drop noisy "Map is loaded" debug log.
- Update copyright year to 2020-2026.

Behavior is preserved end-to-end; the characterization test from
#12487 acts as the safety net.
PanConChicharron pushed a commit to PanConChicharron/autoware.universe that referenced this pull request Jun 10, 2026
…est and rename core unit test (autowarefoundation#12612)

* test(autoware_traffic_light_visualization): retire characterization test for TrafficLightMapVisualizerNode

The characterization test introduced in autowarefoundation#12487 has served its purpose
as the safety net during the refactor series (autowarefoundation#12511 / autowarefoundation#12553 / autowarefoundation#12591
/ autowarefoundation#12596). Its scope is now fully covered by the finer-grained layers:

- extract_bulbs unit tests: lanelet -> Bulb conversion
- TrafficLightVisualizer core unit tests: bulb -> marker generation
- Node smoke tests: pub/sub plumbing and map-not-received guard

Remove the characterization test and its CMakeLists.txt entry. The
remaining test executables run an order of magnitude faster, with no
loss of behavioural coverage.

* test(autoware_traffic_light_visualization): rename TrafficLightVisualizer unit test to take the package's main test slot

With the characterization test retired, the unit test file for
TrafficLightVisualizer is the most natural fit for the package's main
test name. Rename it from test_traffic_light_map_visualizer_core.cpp
to test_traffic_light_map_visualizer.cpp and update the matching
ament_add_gtest target name in CMakeLists.txt accordingly.

No content changes; this is a pure rename + CMake target rename.

Signed-off-by: Arjun Jagdish Ram <arjun.ram@tier4.jp>
TetsuKawa pushed a commit to TetsuKawa/autoware_universe that referenced this pull request Sep 7, 2026
… and tidy internal naming (autowarefoundation#12553)

Second of a planned series of incremental refactors for
traffic_light_map_visualizer (follow-up to autowarefoundation#12511).

- Introduce Bulb { id, position, color } and BulbsByGroupId, and
  extract `extract_bulbs(map_traffic_lights) -> BulbsByGroupId` as a
  free function. TrafficLightVisualizer no longer holds
  lanelet::ConstPoint3d; lanelet API knowledge is confined to the
  conversion seam.
- Extract `parse_bulb_color` helper.
- Tidy helper signatures (pass Time by value, hoist `using` to
  namespace scope) and scope TrafficLightGroupArray / LaneletMapBin
  aliases to the node class private section.
- Internal renames for clarity: viz_lanelet_map -> lanelet_map,
  regulatory_element -> traffic_light, traffic_lights ->
  map_traffic_lights, current_time -> stamp, plus subscription /
  publisher / callback member updates.
- Drop noisy "Map is loaded" debug log.
- Update copyright year to 2020-2026.

Behavior is preserved end-to-end; the characterization test from
autowarefoundation#12487 acts as the safety net.

Signed-off-by: TetsuKawa <kawaguchitnon@icloud.com>
TetsuKawa pushed a commit to TetsuKawa/autoware_universe that referenced this pull request Sep 7, 2026
…est and rename core unit test (autowarefoundation#12612)

* test(autoware_traffic_light_visualization): retire characterization test for TrafficLightMapVisualizerNode

The characterization test introduced in autowarefoundation#12487 has served its purpose
as the safety net during the refactor series (autowarefoundation#12511 / autowarefoundation#12553 / autowarefoundation#12591
/ autowarefoundation#12596). Its scope is now fully covered by the finer-grained layers:

- extract_bulbs unit tests: lanelet -> Bulb conversion
- TrafficLightVisualizer core unit tests: bulb -> marker generation
- Node smoke tests: pub/sub plumbing and map-not-received guard

Remove the characterization test and its CMakeLists.txt entry. The
remaining test executables run an order of magnitude faster, with no
loss of behavioural coverage.

* test(autoware_traffic_light_visualization): rename TrafficLightVisualizer unit test to take the package's main test slot

With the characterization test retired, the unit test file for
TrafficLightVisualizer is the most natural fit for the package's main
test name. Rename it from test_traffic_light_map_visualizer_core.cpp
to test_traffic_light_map_visualizer.cpp and update the matching
ament_add_gtest target name in CMakeLists.txt accordingly.

No content changes; this is a pure rename + CMake target rename.

Signed-off-by: TetsuKawa <kawaguchitnon@icloud.com>
TetsuKawa pushed a commit to TetsuKawa/autoware_universe that referenced this pull request Sep 7, 2026
… and tidy internal naming (autowarefoundation#12553)

Second of a planned series of incremental refactors for
traffic_light_map_visualizer (follow-up to autowarefoundation#12511).

- Introduce Bulb { id, position, color } and BulbsByGroupId, and
  extract `extract_bulbs(map_traffic_lights) -> BulbsByGroupId` as a
  free function. TrafficLightVisualizer no longer holds
  lanelet::ConstPoint3d; lanelet API knowledge is confined to the
  conversion seam.
- Extract `parse_bulb_color` helper.
- Tidy helper signatures (pass Time by value, hoist `using` to
  namespace scope) and scope TrafficLightGroupArray / LaneletMapBin
  aliases to the node class private section.
- Internal renames for clarity: viz_lanelet_map -> lanelet_map,
  regulatory_element -> traffic_light, traffic_lights ->
  map_traffic_lights, current_time -> stamp, plus subscription /
  publisher / callback member updates.
- Drop noisy "Map is loaded" debug log.
- Update copyright year to 2020-2026.

Behavior is preserved end-to-end; the characterization test from
autowarefoundation#12487 acts as the safety net.
TetsuKawa pushed a commit to TetsuKawa/autoware_universe that referenced this pull request Sep 7, 2026
…est and rename core unit test (autowarefoundation#12612)

* test(autoware_traffic_light_visualization): retire characterization test for TrafficLightMapVisualizerNode

The characterization test introduced in autowarefoundation#12487 has served its purpose
as the safety net during the refactor series (autowarefoundation#12511 / autowarefoundation#12553 / autowarefoundation#12591
/ autowarefoundation#12596). Its scope is now fully covered by the finer-grained layers:

- extract_bulbs unit tests: lanelet -> Bulb conversion
- TrafficLightVisualizer core unit tests: bulb -> marker generation
- Node smoke tests: pub/sub plumbing and map-not-received guard

Remove the characterization test and its CMakeLists.txt entry. The
remaining test executables run an order of magnitude faster, with no
loss of behavioural coverage.

* test(autoware_traffic_light_visualization): rename TrafficLightVisualizer unit test to take the package's main test slot

With the characterization test retired, the unit test file for
TrafficLightVisualizer is the most natural fit for the package's main
test name. Rename it from test_traffic_light_map_visualizer_core.cpp
to test_traffic_light_map_visualizer.cpp and update the matching
ament_add_gtest target name in CMakeLists.txt accordingly.

No content changes; this is a pure rename + CMake target rename.
This was referenced Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants