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

Fix code coverage #2419

Merged
merged 10 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
fixes:
- "src/navigation2/::"
- "install/::"

ignore:
- "*/**/test/*" # ignore package test directories, e.g. nav2_dwb_controller/costmap_queue/tests
Expand Down
21 changes: 15 additions & 6 deletions tools/code_coverage_report.bash
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,30 @@ mkdir -p ${LCOVDIR}
# - messages, which are auto generated files
# - system tests, which are themselves all test artifacts
# - rviz plugins, which are not used for real navigation
INCLUDE_PACKAGES=$(
EXCLUDE_PACKAGES=$(
colcon list \
--paths-only \
--packages-ignore-regex \
--names-only \
--packages-select-regex \
".*_msgs" \
".*_tests" \
".*_rviz.*" \
| xargs)
INCLUDE_PACKAGES=$(
colcon list \
--names-only \
--packages-ignore \
$EXCLUDE_PACKAGES \
| xargs)

# Capture executed code data.
fastcov \
fastcov --lcov \
-d build \
--exclude test/ \
--exclude test/ $EXCLUDE_PACKAGES \
--include $INCLUDE_PACKAGES \
--output ${LCOVDIR}/total_coverage.info --lcov
--process-gcno \
--validate-sources \
--dump-statistic \
--output ${LCOVDIR}/total_coverage.info

if [ $COVERAGE_REPORT_VIEW = codecovio ]; then
curl -s https://codecov.io/bash > codecov
Expand Down