catkin / catkin_tools

Command line tools for working with catkin
Apache License 2.0
163 stars 146 forks source link

catkin test not correctly chosing make target (version 0.6.1 only) #731

Closed rhaschke closed 2 years ago

rhaschke commented 2 years ago

According to the doc, catkin test should chose the make target run_tests (for catkin packages) or test (for pure cmake packages). However, this doesn't seem to work (anymore?). catkin test is always expanded to make target test:

catkin test
==> Expanding alias 'test' from 'catkin test --no-status' to 'catkin build --verbose --make-args test -- --no-status'

System Info

Fails on Kinetic + Melodic, both running catkin-tools 0.6.1 Works on Noetic, running catkin-tools 0.9.0

Do you mind releasing 0.9 to Kinetic and Melodic too? Or do you heavily rely on python 3.x nowadays? Otherwise, the fix should be backported.

This issue poses problems for https://github.com/ros-industrial/industrial_ci/pull/785, which attempts to run the correct test target on any ROS version.

timonegk commented 2 years ago

It looks like you have python-catkin-tools installed in kinetic and melodic which is the version implemented in python2. You should be able to uninstall it and install python3-catkin-tools instead which is the version in python3 that is still updated.

rhaschke commented 2 years ago

You have python-catkin-tools installed. You should be able to uninstall it and install python3-catkin-tools instead.

This works for Melodic, but unfortunately not for Kinetic (and older ROS versions) as catkin tools 0.9 is not released there:

# apt-get install --no-install-recommends python3-catkin-tools ros-kinetic-catkin                   
Package: python3-catkin-tools
Version: 0.6.1-1
...
The following packages have unmet dependencies:
 python3-catkin-tools : Depends: python3-catkin-pkg (>= 0.2.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
timonegk commented 2 years ago

Ah, I only tested for melodic. It would probably be possible to release the version for kinetic as well. I tested to simply install the .deb file from here and it seemed to work except for this issue that does not result in any problems, though. So you could probably install this package manually. Alternatively, @wjwwood might have an opinion on releasing the version for xenial.

In the previous version of catkin_tools, there were two aliases, test and run_tests, for each of the test targets. You could also continue to use them, but then you would probably have to specify the list of packages for each build type manually.

As for backporting, kinetic has been EOL for over a year, and I am not really willing to put a lot of effort into supporting it. But if you wanted to do it, I would happily review a pull request backporting the catkin test functionality to the 0.6.x branch.

wjwwood commented 2 years ago

Alternatively, @wjwwood might have an opinion on releasing the version for xenial.

My default answer is no, especially since pip and virtualenv can get you where you need to go. I think we don't release for Xenial any longer due to us now using Python3 exclusively. I'd prefer not to cross back that direction.

rhaschke commented 2 years ago

Fully understand. I proposed a working compromise solution for industrial_ci: https://github.com/ros-industrial/industrial_ci/pull/785#issuecomment-1171197301