Skip to content
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

ROS2 support #32

Open
martiniil opened this issue Sep 11, 2021 · 4 comments
Open

ROS2 support #32

martiniil opened this issue Sep 11, 2021 · 4 comments
Labels
question Further information is requested

Comments

@martiniil
Copy link
Contributor

I just wanted to ask if you already had any thoughts or even progress in providing code-coverage for ros2 packages?

@mikeferguson
Copy link
Owner

My understanding is that is unnecessary (for at least C++) in ROS2 - since colcon natively supports code coverage: https://answers.ros.org/question/355388/generating-a-c-code-coverage-report-with-colcon/ - however I haven't actually tried this out yet.

@mikeferguson mikeferguson added the question Further information is requested label Sep 11, 2021
@martiniil
Copy link
Contributor Author

I tried it. I still need to create a baseline, add necessary flags, extract the right information from the report, generate html and so on. Is this not what makes your package necessary, or did I miss s.th. important?

@tylerjw
Copy link

tylerjw commented Oct 11, 2021

If anyone is looking for an example on how to do this for their repos in CI for ROS2 you can look at the moveit2 repo's github action workflow and our .ci.prepare_codecov script:

If you wanted to do the same thing locally you could follow these steps:

  • Build with colcon build --mixin coverage
  • Use lcov to organize and create the coverage report file
  • Use genhtml to generate the report locally

I've used this workflow when writing tests and searching for the last few lines I don't have coverage of.

@martiniil
Copy link
Contributor Author

Concerning CI coverage jobs, this might also be interesting: ros-industrial/industrial_ci#504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants