-
Notifications
You must be signed in to change notification settings - Fork 554
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
Enable ament_lint tests #340
Conversation
321b915
to
1a8c265
Compare
Codecov Report
@@ Coverage Diff @@
## main #340 +/- ##
==========================================
- Coverage 48.05% 47.90% -0.15%
==========================================
Files 156 157 +1
Lines 14941 14874 -67
==========================================
- Hits 7179 7124 -55
+ Misses 7762 7750 -12
Continue to review full report at Codecov.
|
@@ -3,6 +3,16 @@ project(moveit_common NONE) | |||
|
|||
find_package(ament_cmake REQUIRED) | |||
|
|||
if(BUILD_TESTING) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we simply set and enable all tests in moveit_common
only, possibly providing an extra macro? That way we don't have linters enabled all over the place and we can enforce what checks need to pass in all MoveIt packages. Also, what do you think about using a different build flag than BUILD_TESTING
so that we can separate the CI stages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the colcon mixin
system when linters are enabled this way there is an explicit way to run only linters or only non-linters.
Here is the documentation for how to enable colcon mixin: https://github.com/colcon/colcon-mixin-repository
When running tests with colon you can then only linters:
colcon test --mixin linters-only
Skip running linters:
colcon test --mixin linters-skip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we simply set and enable all tests in
moveit_common
only
I tried this and I couldn't figure out how to get them to propagate. I really wish there was a way to specify linters per-repo instead of per-ros-package. I asked about this here: colcon/colcon-core#421 to see if I could instead find some other explicit per-repo way to specify them.
The other issues is that even if we get the cmake stuff handled with a macro there is the issue of the package.xml. The ament_lint system specifically enables linters based on which ones the package <test_depends>
on. This still has to be done per-package sadly.
The other thing is that even if we figured out how to enable them for all packages from moveit_common, until all packages pass these linters we need a way to exclude them per-package.
One thing you'll notice is that I am not enabling clang-tidy or clang-format this way. Eventually, I'd like to use the ament system for those linters as well. However, there are existing issues with the ament scripts for how we would like to use those linters. I have gotten some PRs merged to resolve some of those issues but they are not 100% there. Specifically, these are the issues that remain: clang-tidy
clang-format
Long term I'd like the CI system to lint packages changed by a PR and run tests on those packages, and the dependencies of those packages. This could greatly speed up testing in CI. The testing part could impact how code coverage reporting works and I haven't thought of a fix for that yet. Lastly, it would be really nice if there was an easy way for people to locally run tests and linters on packages they have changed. The colcon_list_packages_changed script I created and linked to is my current thoughts on that. Eventually, I'd like to contribute this to be a first-class feature of colcon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Somehow, I ran into an issue where moveit_ros_planning_interface
fails to find MONGODB
when compiling. Not sure how this could possibly be related to this PR, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed a conflict, will merge this once CI pass
There is something wrong with the dependencies of the latest released ament_lint_auto:
|
Signed-off-by: Tyler Weaver <[email protected]>
Signed-off-by: Tyler Weaver [email protected]
Description
This enables the default set of linters in ament_lint_common. It selectively disables all the tests that do not currently pass. This should make it easy for people to fix the issues found by these linters by removing the one line and running the test to see what they need to fix. This PR enables over 200 lint tests that already pass.
These could create excellent first-timer-only issues or moveit wold day issues.