Set up code coverage reports in CI for tracetools and tracetools_test

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
Christophe Bedard 2020-04-25 17:18:30 +00:00
parent 14776ec7e5
commit 9255c0d723
6 changed files with 40 additions and 0 deletions

View file

@ -4,6 +4,10 @@ variables:
BASE_IMAGE_ID: registry.gitlab.com/micro-ros/ros_tracing/ci_base
DISTRO: foxy
stages:
- build_test
- report
.global_artifacts: &global_artifacts
artifacts:
paths:
@ -20,6 +24,7 @@ before_script:
- . /root/ws/install/local_setup.sh
tracing_enabled:
stage: build_test
image: $BASE_IMAGE_ID:$DISTRO
script:
- lttng --version && apt list lttng-tools liblttng-ust-dev python3-lttng python3-babeltrace
@ -31,6 +36,7 @@ tracing_enabled:
<<: *global_artifacts
tracing_disabled:
stage: build_test
image: $BASE_IMAGE_ID:$DISTRO
script:
- colcon build --symlink-install --event-handlers console_cohesion+ --cmake-args " -DTRACETOOLS_DISABLED=ON" --packages-up-to $PACKAGES_LIST
@ -40,6 +46,7 @@ tracing_disabled:
<<: *global_artifacts
no_lttng:
stage: build_test
image: $BASE_IMAGE_ID:$DISTRO-base
script:
- colcon build --symlink-install --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST
@ -47,3 +54,16 @@ no_lttng:
- colcon test --event-handlers console_cohesion+ --packages-select $PACKAGES_LIST
- colcon test-result --all
<<: *global_artifacts
coverage:
stage: report
image: $BASE_IMAGE_ID:$DISTRO
script:
- colcon build --symlink-install --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST --mixin coverage-gcc coverage-pytest --cmake-args -DBUILD_TESTING=ON --no-warn-unused-cli -DCMAKE_BUILD_TYPE=Debug
- colcon test --event-handlers console_cohesion+ --packages-select $PACKAGES_LIST --mixin coverage-pytest
- colcon test-result --all
- colcon lcov-result --packages-select tracetools tracetools_test --verbose
- coverage combine build/tracetools_test/pytest_cov/*/.coverage
- coverage report -m
allow_failure: true
<<: *global_artifacts

4
ros2trace/.coveragerc Normal file
View file

@ -0,0 +1,4 @@
[run]
omit =
setup.py
test/*

View file

@ -0,0 +1,4 @@
[run]
omit =
setup.py
test/*

View file

@ -0,0 +1,4 @@
[run]
omit =
setup.py
test/*

View file

@ -0,0 +1,4 @@
[run]
omit =
setup.py
test/*

View file

@ -0,0 +1,4 @@
[run]
omit =
setup.py
test/*