Skip to content

Commit

Permalink
[FIX] coverage report generation
Browse files Browse the repository at this point in the history
  • Loading branch information
mhorn11 committed Jan 2, 2024
1 parent 590103a commit 2921055
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 15 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ jobs:
run: |
python -m pip install .
- name: Test with pytest
if: matrix.python-version != '3.8'
run: |
pytest
- name: Test with pytest and create coverage report
if: matrix.python-version == '3.8'
run: |
pytest --cov=excalibur --cov-report term --cov-report xml:coverage.xml
pytest --cov=excalibur --cov-report term --cov-report xml:coverage.xml --no-cov-on-fail
- name: Upload coverage reports to Codecov
if: matrix.python-version == '3.10'
if: matrix.python-version == '3.8'
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Excalibur

[![Documentation Status](https://readthedocs.org/projects/excalibur-mrm/badge/?version=latest)](https://excalibur-mrm.readthedocs.io/en/latest/?badge=latest)
[![Tests](https://github.com/uulm-mrm/excalibur/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/uulm-mrm/excalibur/actions/workflows/tests.yml)
[![Codecov](https://codecov.io/gh/uulm-mrm/excalibur/graph/badge.svg?token=MPQQ1SFVNP)](https://codecov.io/gh/uulm-mrm/excalibur)

An open-source Python library for **ex**trinsic sensor **calib**ration.
We provide various solving and optimization methods for different calibration formulations:

Expand Down
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,26 @@ minversion = "6.0"
testpaths = [
"test"
]

[tool.coverage.run]
branch = false

[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_also = [
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",

# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",

# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",

# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]
ignore_errors = true
Empty file added test/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions test/test_calibration_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from excalibur.io.calibration import CalibrationManager
from excalibur.io.transforms import store_transform_container

import data
import utils
from . import data
from . import utils


SCRIPTS_PATH = Path(__file__).resolve().parent.parent / 'scripts' / 'calibration'
Expand Down
4 changes: 2 additions & 2 deletions test/test_detection_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import motion3d as m3d
import unittest

import utils

from excalibur.fitting.plane import Plane

from . import utils


SCRIPTS_PATH = Path(__file__).resolve().parent.parent / 'scripts' / 'detection'
DATA_PATH = Path(__file__).resolve().parent / 'detection'
Expand Down
2 changes: 1 addition & 1 deletion test/test_frame2frame_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import excalibur.calibration as ec

import data
from . import data


class TestFrame2FrameCalibration(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_hand_eye_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import excalibur.calibration as ec
from excalibur.fitting.plane import Plane

import data
from . import data


class TestHandEyeCalibration(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_herw_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import excalibur.calibration as ec

import data
from . import data


RANSAC_KWARGS = {
Expand Down
2 changes: 1 addition & 1 deletion test/test_point2line_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import excalibur.calibration as ec

import data
from . import data


class TestPoint2LineCalibration(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_point2plane_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import excalibur.calibration as ec

import data
from . import data


class TestPoint2PlaneCalibration(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_point2point_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import excalibur.calibration as ec

import data
from . import data


class TestPoint2PointCalibration(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_publications.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import unittest

import utils
from . import utils


PUBLICATIONS_PATH = Path(__file__).resolve().parent.parent / 'publications'
Expand Down
4 changes: 2 additions & 2 deletions test/test_util_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from excalibur.io.calibration import CalibrationManager
from excalibur.io.transforms import store_transform_container

import data
import utils
from . import data
from . import utils


SCRIPTS_PATH = Path(__file__).resolve().parent.parent / 'scripts' / 'utils'
Expand Down

0 comments on commit 2921055

Please sign in to comment.