Skip to content

Commit

Permalink
Add coverage and fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Nov 14, 2024
1 parent f3f550d commit d3d7d68
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/actions/build-and-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ runs:
"build": {
"cmake-args": [
"-DINTEGRATION_TESTING=${{ inputs.integration-testing }}"
]
],
"mixin": ["coverage-pytest"]
},
"test": {
"mixin": ["coverage-pytest"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
16 changes: 16 additions & 0 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,19 @@ jobs:
- name: Stop test fixture containers
if: always()
run: docker-compose -f ".github/docker/integration-tests/docker-compose.yaml" down

- name: Upload failed test results
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-results
path: ros_ws/build/*/test_results/*/*.catch2.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ros_ws/coveragepy/.coverage
flags: tests
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,19 @@ jobs:
ros-distribution: ${{ matrix.ros_distribution }}
zenoh-version: 1.0.1
integration-testing: OFF

- name: Upload failed test results
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-results
path: ros_ws/build/*/test_results/*/*.catch2.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ros_ws/coveragepy/.coverage
flags: tests
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
16 changes: 16 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# coverage:
# precision: 2
# round: down
# range: "35...100"
# status:
# project:
# default:
# informational: true
# patch: off
fixes:
- "ros_ws/src/*/free_fleet/free_fleet/::"
- "ros_ws/src/*/free_fleet/free_fleet_adapter/::"
- "ros_ws/src/*/free_fleet/free_fleet_examples/::"
# comment:
# layout: "diff, flags, files"
# behavior: default
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import time

from free_fleet_adapter.nav2_robot_adapter import Nav2RobotAdapter
from tf2_ros import Buffer
import rclpy
from tf2_ros import Buffer
from rclpy.node import Node

import zenoh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import time

from free_fleet_adapter.nav2_robot_adapter import Nav2TfHandler
from tf2_ros import Buffer
import rclpy
from tf2_ros import Buffer
from rclpy.node import Node

import zenoh
Expand Down

0 comments on commit d3d7d68

Please sign in to comment.