Skip to content

Commit 63bf357

Browse files
Coverage measurement update (#137)
- move to CodeCov with coverage measurement - get rid of Coveralls - get rid of Travis CI - update badges on main page - measure coverage for both integration and integration tests (more are also possible, but we do not have them at the moment) - GitHub workflows adjusted
1 parent 5a94e6d commit 63bf357

File tree

6 files changed

+76
-60
lines changed

6 files changed

+76
-60
lines changed

.codecov.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
codecov:
2+
archive:
3+
uploads: false
4+
5+
coverage:
6+
range: 80...100
7+
round: down
8+
precision: 2
9+
status:
10+
project:
11+
default:
12+
target: 100%
13+
unit-tests:
14+
target: 100%
15+
flags:
16+
- unit-tests
17+
integration-tests:
18+
target: 80%
19+
flags:
20+
- integration-tests
21+
22+
comment:
23+
layout: "reach, diff, flags, files"
24+
behavior: default
25+
require_changes: false

.github/workflows/ci.yml

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,60 @@ jobs:
3232
3333
- name: Execute unit tests with coverage report [pytest]
3434
run: |
35-
pytest --cov-report term-missing --cov-fail-under=100 --cov=uds tests/software_tests -m "not integration"
35+
pytest --cov-report=term-missing -cov=uds tests/software_tests -m "not integration"
3636
3737
- name: Execute integration tests with coverage report [pytest]
3838
run: |
39-
pytest --cov-report=xml --cov-fail-under=50 --cov=uds tests/software_tests -m "integration"
39+
pytest --cov-report=term-missing --cov=uds tests/software_tests -m "integration"
4040
41-
- name: Upload integration tests coverage report [CodeCov]
42-
uses: codecov/codecov-action@v1
41+
42+
code_coverage:
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- uses: actions/checkout@v2
47+
48+
- name: Set up Python 3.9
49+
uses: actions/setup-python@v1
50+
with:
51+
python-version: 3.9
52+
53+
- name: Install project dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
python -m pip install --upgrade setuptools
57+
pip install -r requirements.txt
58+
59+
- name: Install external packages used for dynamic tests
60+
run: |
61+
pip install -r tests/requirements_for_software_tests.txt
62+
63+
- name: Prepare coverage uploader [CodeCov]
64+
run: |
65+
curl -Os https://app.codecov.io/gh/mdabrowski1990/uds/uploader/linux/codecov
66+
chmod +x codecov
67+
68+
- name: Execute unit tests [pytest]
69+
run: |
70+
pytest --cov-report=xml --cov=uds tests/software_tests -m "not integration"
71+
72+
- name: Upload unit tests report [CodeCov]
73+
uses: codecov/codecov-action@v2
74+
with:
75+
token: ${{ secrets.CODECOV_TOKEN }}
76+
files: coverage.xml
77+
flags: unit-tests
78+
79+
- name: Execute integration tests [pytest]
80+
run: |
81+
pytest --cov-report=xml --cov=uds tests/software_tests -m "integration"
82+
83+
- name: Upload integration tests report [CodeCov]
84+
uses: codecov/codecov-action@v2
4385
with:
44-
fail_ci_if_error: true
4586
token: ${{ secrets.CODECOV_TOKEN }}
87+
files: coverage.xml
88+
flags: integration-tests
4689

4790

4891
static_code_analysis:

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,5 @@ jobs:
2929
with:
3030
languages: ${{ matrix.language }}
3131

32-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
33-
# If this step fails, then you should remove it and run the build manually (see below)
34-
35-
# mdabrowski: This shall not be needed for Python.
36-
# - name: Autobuild
37-
# uses: github/codeql-action/autobuild@v1
38-
39-
# ℹ️ Command-line programs to run using the OS shell.
40-
# 📚 https://git.io/JvXDl
41-
42-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
43-
# and modify them (or add more) to build your code if your project
44-
# uses a compiled language
45-
46-
#- run: |
47-
# make bootstrap
48-
# make release
49-
5032
- name: Perform CodeQL Analysis
5133
uses: github/codeql-action/analyze@v1

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

README.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ UDS
1010
:target: https://github.com/mdabrowski1990/uds/actions/workflows/codeql-analysis.yml
1111
:alt: Security Scan Status
1212

13-
.. image:: https://travis-ci.com/mdabrowski1990/uds.svg?branch=main
14-
:target: https://travis-ci.com/mdabrowski1990/uds
15-
:alt: Build Status
16-
1713
.. image:: https://readthedocs.org/projects/uds/badge/?version=latest
1814
:target: https://uds.readthedocs.io/
1915
:alt: Documentation
@@ -26,9 +22,9 @@ UDS
2622
:target: https://lgtm.com/projects/g/mdabrowski1990/uds/context:python
2723
:alt: LGTM assessment
2824

29-
.. image:: https://coveralls.io/repos/github/mdabrowski1990/uds/badge.svg?branch=main
30-
:target: https://coveralls.io/github/mdabrowski1990/uds?branch=main
31-
:alt: Unit Tests Coverage
25+
.. image:: https://codecov.io/gh/mdabrowski1990/uds/branch/main/graph/badge.svg?token=IL7RYZ5ERC
26+
:target: https://codecov.io/gh/mdabrowski1990/uds
27+
:alt: Software Tests Coverage
3228

3329
.. image:: https://img.shields.io/pypi/v/py-uds.svg
3430
:target: https://pypi.python.org/pypi/py-uds

codecov.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)