Skip to content

Commit cb8df1b

Browse files
committedJul 18, 2024
feat: add test coverage
1 parent d3b532c commit cb8df1b

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed
 

‎.github/workflows/test.yml

+18-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,24 @@ jobs:
1414
python-version: ${{ matrix.python-version }}
1515
- name: Install dependencies
1616
run: |
17-
python -m pip install --upgrade pip pytest
17+
python -m pip install --upgrade pip pytest pytest-cov
1818
pip install .
1919
- name: Test with pytest
2020
run: |
21-
pytest tests
21+
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=git_hg_sync tests/ | tee pytest-coverage.txt
22+
- name: Pytest coverage comment
23+
uses: MishaKav/pytest-coverage-comment@main
24+
with:
25+
pytest-coverage-path: ./pytest-coverage.txt
26+
pytest-xml-coverage-path: ./coverage.xml
27+
title: overage
28+
badge-title: Coverage
29+
hide-badge: false
30+
hide-report: false
31+
create-new-comment: false
32+
hide-comment: false
33+
report-only-changed-files: false
34+
remove-link-from-badge: false
35+
unique-id-for-comment: python3.10
36+
junitxml-path: ./pytest.xml
37+
junitxml-title: JUnit Xml Summary

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
clones
22
.tox
33
**/__pycache__/
4-
config.ini
4+
config.ini
5+
.coverage

‎tox.ini

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ setenv = PYTHONPATH = ""
88
[testenv:pytest]
99
changedir = tests
1010
passenv = PULSE_PASSWORD
11-
deps = pytest
12-
commands = pytest
11+
deps =
12+
pytest
13+
pytest-cov
14+
commands = pytest --cov=git_hg_sync --cov-report=html
1315

1416
[testenv:lint]
1517
description = lint source code

0 commit comments

Comments
 (0)
Failed to load comments.