-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to automatically run catkin_lint with other tests? #108
Comments
I think there is also a cmake version. See this example for implementation: https://github.com/tue-robotics/ed/blob/master/CMakeLists.txt |
Thanks for finding it. However, that package doesn't solve the ROS buildfarm problem - the package itself has devel jobs enabled, but they fail earlier than this problem could manifest. Wouldn't you be interested in integrating a cmake helper directly in catkin_lint? I might find some time for a PR. It doesn't necessarily have to be as complicated as catkin_lint_cmake with the XSL transform of the output... And it could handle the ROS buildfarm problems out of the box. I also wanted to look if it wouldn't be possible to move the rosdep cache to the build directory (probably via some parameters) and autoupdate it - or at least add an option to do so. |
Relaying this to @MatthijsBurgh as he made the initial attempt on cmake I believe Matthijs: do you have an interest or opinion on this? |
So I have no clue why But as explained in #109,
We also need to ask ourselves, why does the ROS buildfarm not have a rosdep cache available? Whether @fkie wants to integrate a simple CMake macro, integrate my project |
I think the rationale for not running init and update on the buildfarm before tests is described here:
I don't, however, really understand it very well. Some of the preceding steps of the build call rosdep to install the dependencies, so it's still not clear to me why the run_tests step could not do the same... |
With |
Taking a step back: what is it you actually want to test @peci1? "checking of rosdep keys" sounds like what a pre-release test is supposed to be used for, not a devel task running on the buildfarm. |
Simply said: I'd like the automated tests to run
Agree. But how to distinguish between these two in CMakeLists? And it should definitely work in pull-request-testing tasks, which I haven't investigated yet - but I guess they would work very similar to devel tasks. |
that's not what I meant. The build script is not the place to detect what is being run, it should just build the package. The build environment setup by the pre-release test script(s) is what makes the build a pre-release test. Not the fact a special path is taken/executed in your build script. |
Actually, this problem manifests in pre-release tests, devel tasks and release tasks. In all three of them, the environment is set up so that the package checks in catkin_lint cannot run the package checks. With 9acaa0e it should at least not result in total build failure, but it would instead "silently" skip the package tests. By "silently" I mean the build would succeed, a warning will be written to the build log, but really, who does read build logs until something fails? I would still prefer having an option to run the package checks in all cases, including local development (where it normally works). |
I think this is something that should be addressed in the ROS build farm.
|
Ok, now I got convinced that the solution I proposed here is probably not really a good way. You're right that downloading and updating rosdep cache is definitely not a task for catkin_lint. However, as a "consumer of rosdep", it should contain a way to configure path to the rosdep cache. That is currently not supported. But that might change if ros-infrastructure/rosdep#908 would get merged - that would add an environment variable through which the cache location can be specified, requiring no code changes from catkin_lint. Alternatively, I could squeeze #109 to just the |
I guess that would be feasible, as long as the PR is not too intrusive and does not change the default behavior when the option is omitted. |
Okay, I'll update #109 accordingly. Thank you all for the insightful discussion. |
I'm closing this issue, now that the discussed changes have been implemented and released in version 1.6.22 |
I'd like to automatically run catkin_lint with other tests, e.g. with roslint. First, I thought about writing something as simple as
However, this approach fails horribly on the ROS buildfarm, which (for a reason I can't understand) runs tests in an environment without rosdep cache (i.e.
rosdep update
has not been called), and sometimes does not even containROS_ROOT
orROS_DISTRO
environment variables. See e.g. ros-infrastructure/ros_buildfarm#923 . It either results in exceptions, or in packages likepython-tqdm
reported as unknown packages.So, after a lot of tinkering, I've come with this ugly piece of CMake code that disables the catkin_lint test on ROS buildfarm, but keeps it enabled elsewhere (e.g. IndustrialCI or local testing).
I don't consider this particularly nice. This snippet would need to go to all packages which I want to lint during testing.
Does anybody have a better idea how to run this linter during tests?
The text was updated successfully, but these errors were encountered: