ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Using unreleased test dependencies on the ROS build farm

asked 2020-06-02 05:18:13 -0500

jeroendm gravatar image

Is there a recommended way to use unreleased dependencies in tests executed on the ROS build farm?

In my specific case we use MoveIt robot configuration packages to test an inverse kinematics plugin. I had to leave this dependency out of the package.xml to make the release work. Some solutions I consider, but am not happy about, are:

  • Writing new tests that only depend on released packages.
  • Creating a metapackage and adding all the dependencies to the repository.
  • Try to add it to moveit_resources. (see this issue)

@gavanderhoorn mentioned another possible solution in a Github comment:

Devel jobs should however have access to test_depends and I believe that's actually possible by specifying additional repositories as dependencies/prerequisites somehow in the distribution.yaml.

Notice that the CI setup with Travis works fine using a .travis.rosinstall file.

Related questions that do not provide an answer to this one.

edit retag flag offensive close merge delete

Comments

Notice that the CI setup with Travis works fine using a .travis.rosinstall file.

Note: that's an industrial_ci specific bit of functionality.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-02 06:09:51 -0500 )edit

@gavanderhoorn mentioned another possible solution in a Github comment:

Devel jobs should however have access to test_depends and I believe that's actually possible by specifying additional repositories as dependencies/prerequisites somehow in the distribution.yaml.

Seems I was thinking of the depends tag which is a:

list of repository names. Other repositories to perform cross referencing in the documentation. This is only necessary if the packages from the dependent repositories are not released. (default: [])

But that is only supported for doc jobs right now (according to REP-141).

gvdhoorn gravatar image gvdhoorn  ( 2020-06-02 06:23:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-06-02 06:09:22 -0500

tfoote gravatar image

Devel jobs should however have access to test_depends

Before the devel jobs are run their test depends are installed from released packages. If you need another package to run your tests you can add the test_depend and it will be available.

There's only currently support for having test dependencies on released packages. Adding support for arbitrary source checkouts significantly increases the complexity and burden on the buildfarm and also makes it much harder to reproduce for a new developer/contributor who then has to checkout arbitrary other content to run the tests. Extending the buildfarm to support this is something that could be contributed, but at the same time extending the build/test tools to detect and give good warnings/errors if the developer fails to checkout the appropriate source trees would also want to be done in parallel.

The other workaround is that the test build actually fetches the resources that it needs while it builds the tests. This is not generally preferred as it no longer leaves your builds self contained and may not work if your offline but it will work for CI and most developers.

edit flag offensive delete link more

Comments

@tfoote: REP-141 seems to imply that doc jobs do support expressing dependency on unreleased packages.

Could that support not be reused for devel jobs?

gvdhoorn gravatar image gvdhoorn  ( 2020-06-02 06:38:39 -0500 )edit

The other workaround is that the test build actually fetches the resources

Aah, I never though of that, it seems CMake can download a git repo and add it to the project.

jeroendm gravatar image jeroendm  ( 2020-06-02 07:43:15 -0500 )edit

On the topic of should this be possible @v4nh notes (on discord) that:

From my perspective test dependencies should also work from released packages, otherwise this is still a bug. I (as a user) would expect to have tests succeed if I download a release and all released dependencies

jeroendm gravatar image jeroendm  ( 2020-06-02 07:51:11 -0500 )edit

How would a user run tests with a released package?

The build script -- which contains/sets up the test driver -- is not included in a binary package.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-02 10:47:48 -0500 )edit

REP-141 seems to imply that doc jobs do support expressing dependency on unreleased packages.

Could that support not be reused for devel jobs?

I'm not saying it could be added but see my points about reproducibility and ease of use. Of course we can make it happen on the buildfarm, magically populating content into a magic overlay with all the declared extra content. But if you're building locally and want to run a test, where should all these extra checkouts go? Into you workspace? Tests shouldn't be modifying your workspace. Into a magic temp directory? How would you debug? Does it overlay any content in your workspace does it detect an implementation in your workdpace or underlay? And similarly when should those special packages be built? They need to be available at build time for the tests whereas a released package or another package in the workspace ...(more)

tfoote gravatar image tfoote  ( 2020-06-02 12:37:47 -0500 )edit

How would a user run tests with a released package?

You are always running tests on a package from source. But they can rely on the installed artifacts of any other package. For example if you need to play a rosbag for your tests you can add a test_depend on rosbag and then you can know you can invoke it.

tfoote gravatar image tfoote  ( 2020-06-02 12:37:59 -0500 )edit

We added the extra capability to the doc jobs for two reasons. First is that they don't have a special doc_depend tag. And secondly because the doc jobs are not actually building it's much simpler to just make sure to check out the contents before running the documentation rather than requiring extra overlay logic. This is not something that users typically do and will work if they just have the packages in their workspace when they run the documentation for a package, if they don't it won't cross link but that's not a blocker.

tfoote gravatar image tfoote  ( 2020-06-02 12:38:53 -0500 )edit

[..] magic [..] magic [..] magic [..]

Aren't you being a bit dramatic?

I agree that things need to be reproducable, but really, being able to specify additional source dependencies for devel jobs specifically, configured to run on the ROS buildfarm is essentially similar to how people use Travis CI.

And additional source dependencies could very easily be managed using a .rosinstall or .repos file. That would again be following standard usage patterns of those files and I would assume would not be surprising or invisible/magic to users.

Users who are interested in running tests locally are probably also quite capable of following some instructions, and if those instructions include an additional vcstool import < my_unreleased_test_depends.rosinstall I doubt it will scare or confuse them.

In the end we are talking about a CI config. Not a generic "how to seed your workspace with my packages" workflow.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-02 13:02:15 -0500 )edit

So if I have a workspace with 100 packages do I run that command 100 times? What if the cited rosinstall file conflicts with an existing package in my workspace or by one in a parallel package? And what if there are two different branches called out for parallel packages' .rosinstall? That may not scare you but we need to be able to tell users how to run unit tests in closed form. Supporting arbitrary source checkouts makes the complexity quickly spiral.

Similarly if your code and coverage relies on unreleased content what's the lifecycle of that unreleased content? When something changes in the unreleased test code should we be rerunning the builds? Why is that unreleased code not in the same package/repo that's being tested? Why shouldn't it be released and versioned like any thing else. And if the buildfarm puts it's stamp on ...(more)

tfoote gravatar image tfoote  ( 2020-06-02 13:29:13 -0500 )edit

This is hyperbole.

The OP asked how to deal with unreleased test depends on the ROS buildfarm.

Not how to manage everyone's workspace.

Why is that unreleased code not in the same package/repo that's being tested?

you're assuming it's code. In the case of the OP, I happen to know we're talking about packages containing robot descriptions and similar resources.

That's not in the same repository as it doesn't belong there.

Why shouldn't it be released and versioned like any thing else

It is versioned, but in a git repository. It's not released because it doesn't make sense: it's not a "real" robot support package, but something crafted for tests specifically. Why "pollute" the ROS package namespace with a package which contains purely test artefacts?

gvdhoorn gravatar image gvdhoorn  ( 2020-06-02 13:32:51 -0500 )edit

This is hyperbole.

I'm not being hyperbolic. I am completely serious that things should be reliably reproducible. We regularly interact with workspaces with 100+ packages and run the unit tests. That is a strongly supported use case. If every one of those packages might or might not call out specific source checkouts we would need many more tools to control the workspace or isolate each of the checkouts and run the unit tests.

It is versioned, but in a git repository.

When I said released and versioned I meant semantically versioned so that you can rely upon it. Yes you can checkout down to the hash, but then if A needs foo@123123123 and B needs foo@234234234 to test suddenly A and B cannot be tested in the same workspace. This is why we have the rosdistro where we have semantically versioned packages that are maintained and released ...(more)

tfoote gravatar image tfoote  ( 2020-06-02 14:45:45 -0500 )edit

This would lead to a situation like I have a workspace with A in it and everything is passing. But if I checkout B into the workspace and install it's test dependencies through some mechanism, then A's unit tests will start failing unless we

The OP asked how to deal with unreleased test depends on the ROS buildfarm. Not how to manage everyone's workspace.

My point is that if we open this code path up on the buildfarm it will significantly degrade the experience of users in workspaces.

Maintaining a .rosinstall is something that's completely reasonable for individual maintainers to do for their workflow for a single package or a handful of packages. But that customization needs to have a pipeline to propogate to the greater community and cover other use cases as well.

tfoote gravatar image tfoote  ( 2020-06-02 14:46:03 -0500 )edit

If you want to setup a custom travis job to test against unreleased code while you're developing something new and tightly coupled that's great and I support that. But the devel job are specifically scoped to show exactly what would happen if you take the code you have in the repository and build it against the targeted rosdistro as would happen if a user checked it out.

tfoote gravatar image tfoote  ( 2020-06-02 14:46:12 -0500 )edit

It's not released because it doesn't make sense: it's not a "real" robot support package, but something crafted for tests specifically. Why "pollute" the ROS package namespace with a package which contains purely test artifacts?

If it's a resource that you need to use to validate your package it's not "polluting", it's managing a resource to support your package and it's tests. Then it's real enough to exist. We have many packages designed to support other packages for testing. We restructure things all the time to support tests. If it's something that you want to be potentially shared by other packages as a generic test framework that sounds like any resource that should be released. If it's a oneoff that's only useful for this package it probably should be inside that package as it's not designed to be reused.

tfoote gravatar image tfoote  ( 2020-06-02 14:46:43 -0500 )edit

Thus if you're saying it something that deserves to be versioned separately then it probably deserves to be released separately so it can be relied upon being available and consistent.

There is the escape valve of checking out the content inside your tests but that still is fragile and requires network connectivity and the availability of git and other tools which would need to be added as test depends

tfoote gravatar image tfoote  ( 2020-06-02 14:46:48 -0500 )edit

To be clear we're well beyond the scope of the original question, but I'm communicating why not adding this "extra" functionality was a design decision, because it's asking the maintainers to do a little extra work (maintain and release your testing resources). However it will then significantly increase the meaningfulness of the test results. Any regressions are traceable to releases into the rosdistro. And testing resources are known not to conflict.

tfoote gravatar image tfoote  ( 2020-06-02 19:49:00 -0500 )edit

I appreciate the additional explanation.

It's likely we're not going to agree here, but that's not really a problem as it's not my question, but the OP's.

Your initial answer has already answered the question, and the answer is: you can't use unreleased test_depends on the buildfarm.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-03 03:01:59 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-06-02 05:18:13 -0500

Seen: 219 times

Last updated: Jun 02 '20