Skip to content

Improve accuracy of colcon-test-result#172

Open
scpeters wants to merge 4 commits into
mainfrom
scpeters/colcon-test-result
Open

Improve accuracy of colcon-test-result#172
scpeters wants to merge 4 commits into
mainfrom
scpeters/colcon-test-result

Conversation

@scpeters

Copy link
Copy Markdown
Member

🦟 Bug fix

Helps with gazebosim/sdformat#1648

Summary

While experimenting with action-ros-ci in gazebosim/sdformat#1648, I noticed that colcon test-result incorrectly identifies a failed test in a gz-tools build folder even when tests haven't been run due to the .xml suffix of the intermediate ${TEST_NAME}_fail.xml file (also known as UNIT_gz_TEST_fail.xml).

Adding a suffix to the intermediate junit xml files prevents colcon test-result from reading them as real test results.

To test:

  1. create a colcon workspace containing gz-tools
  2. colcon build
  3. colcon test-result should not show a failure
  4. colcon test && colcon test-result still should not show the spurious failure

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the fix (as needed)
  • Added tests
  • 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: Remove this if GenAI was not used.

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.

Add suffix to intermediate junit xml files to prevent
colcon test-result from reading them as real test
results.

Signed-off-by: Steve Peters <scpeters@intrinsic.ai>
@scpeters scpeters marked this pull request as ready for review March 25, 2026 07:43
@scpeters scpeters requested a review from caguero as a code owner March 25, 2026 07:43
@scpeters scpeters requested review from azeey, iche033 and j-rivero March 26, 2026 01:01
@scpeters

scpeters commented Apr 1, 2026

Copy link
Copy Markdown
Member Author

to verify this fix, I cherry-picked on top of gz-tools2 in 1cf2e36 (gz-tools2...scpeters/backport-colcon-test-result) and rebuild sdformat16 from source against this branch:

build/gz-tools2/src/UNIT_gz_TEST_fail.xml: 1 test, 0 errors, 1 failure, 0 skipped
  - UNIT_gz_TEST GZ_SCRIPT
    <<< failure message
      UNIT_gz_TEST failed.
    >>>

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.

2 participants