Skip to content

Add common empty-world coverage for entity management behaviors#904

Open
XINJIANGMO wants to merge 9 commits into
gazebosim:mainfrom
XINJIANGMO:test_migration_1
Open

Add common empty-world coverage for entity management behaviors#904
XINJIANGMO wants to merge 9 commits into
gazebosim:mainfrom
XINJIANGMO:test_migration_1

Conversation

@XINJIANGMO

@XINJIANGMO XINJIANGMO commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

🎉 New feature

toward comment #299

Summary

Stage 1 for test migration :

  • Extend the common empty-world test to cover entity removal behavior:
    • removing models by handle, index, and name
    • removing nested models
    • verifying removed proxies remain safe to inspect
    • covering the nested-model removal crash regression
  • Add common construction coverage for entities that were previously only
    tested in DART:
    • revolute joint attachment
    • prismatic joint attachment
    • box and sphere shape attachment
    • basic frame-semantics checks after manual construction
  • Add common coverage for mesh and heightmap construction paths:
    • mesh attachment and scaled mesh attachment
    • image heightmap attachment
    • DEM heightmap attachment
    • casting generic shapes back to heightmap shapes
  • Update build files only as needed for this test migration:

Test it

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the feature
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Generated-by: gpt-5.4-codex.

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

Backports: If this is a backport, please use Rebase and Merge instead.

Generated by : gpt-5.4-codex
Signed-off-by: momo <2438833481@qq.com>
Signed-off-by: momo <2438833481@qq.com>
@XINJIANGMO XINJIANGMO changed the title Add tests for uncovered case in EntityManagement Add common empty-world coverage for entity management behaviors Mar 19, 2026
Signed-off-by: momo <2438833481@qq.com>
Signed-off-by: momo <2438833481@qq.com>
@XINJIANGMO

Copy link
Copy Markdown
Contributor Author

Bazel support in gz-common currently does not stably expose the Dem.hh loader path
https://github.com/gazebosim/gz-common/blob/4d0894e47d4a03986c079c1bcf3081b25dac068b/geospatial/BUILD.bazel#L16

so I removed the releated case in original DART test case

Signed-off-by: momo <2438833481@qq.com>
@XINJIANGMO XINJIANGMO marked this pull request as ready for review March 19, 2026 11:28
Copilot AI review requested due to automatic review settings March 19, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the existing construct_empty_world common test coverage to validate additional entity construction and removal behaviors across physics engine plugins, as part of the broader test migration effort.

Changes:

  • Add common empty-world tests for manual construction of joints (revolute/prismatic) and primitive shapes (box/sphere), including basic frame-semantics checks.
  • Add common tests for mesh attachment (including scaled meshes) and image heightmap attachment, including casting back to a heightmap shape.
  • Add a regression guard test to prevent crashes when removing a parent model that owns nested models, and update build dependencies for the new heightmap/geospatial usage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/common_test/construct_empty_world.cc Adds new common tests for joints/shapes, mesh/heightmap construction, and a nested-model removal crash regression guard.
test/common_test/CMakeLists.txt Links the common tests against the project’s heightmap component to support new heightmap usage.
test/BUILD.bazel Adds Bazel deps for //:heightmap and @gz-common//geospatial:geospatial needed by the new test code.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread test/common_test/construct_empty_world.cc
Comment thread test/common_test/construct_empty_world.cc Outdated
Comment thread test/common_test/construct_empty_world.cc Outdated
XINJIANGMO and others added 3 commits March 26, 2026 10:38
Signed-off-by: momo <2438833481@qq.com>
Signed-off-by: momo <2438833481@qq.com>
@XINJIANGMO XINJIANGMO requested a review from iche033 March 27, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

4 participants