Skip to content

How to properly handle test packages #27359

@kyrofa

Description

@kyrofa

This is a bit of a meta-bug that can be solved in a number of ways across a few different repositories (including this one), so I'm proceeding with logging it here knowing that it may end up actually being solved elsewhere.

A given source repository in ROS can (and often does) contain multiple ROS packages. Each ROS package in that repo must explicitly be a part of the ROS distro by being contained in a release entry in the distribution.yaml, as well as being individually bloomed and ending up in the release repo.

However, not all packages within a given source repo MUST be part of the ROS distro. For example, take ros_comm, that has an entire directory of test packages. These test packages are not contained in the distribution.yaml, nor are they bloomed, and thus they can't be resolved by rosdep into anything.

This makes sense, but it's also where problems can occur. These test packages, since they aren't in the ROS distro, seemingly are only useful for tests on the source repository itself. If they leak into the tests of packages that actually ARE part of the ROS distro, things become a little messy.

For example, take rosmsg, which is also part of ros_comm. It's a package that is actually part of the ROS distro, and is bloomed. However, it uses test_rosmaster in its tests. test_rosmaster is one of ros_comm's test packages that is NOT part of the ROS distro. As a result, rosmsg doesn't (and indeed cannot) declare a dependency on it, but it uses it anyway. When rosmsg is fetched from the release repo (e.g. as part of rosinstall_generate, or the pre-release test in the build farm), its tests require a ROS package to be present that cannot possibly be present unless the entire ros_comm source repository is cloned.

That example can be fixed pretty easily by updating rosmsg to not have any implicit dependencies, and ensure it only requires things that can be satisfied by the ROS distro, but there might be better ways to solve this by exporting such test packages in the ROS distro in a way that they can be resolved and fetched properly without having to actually get binary test packages built. I wanted to start the discussion here. If it seems that fixing rosmsg is the way to go instead of a larger fix, I'm happy to make that PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions