Skip to content

Commit a8d0f51

Browse files
chore: add coverage reporting to pytest (#17)
* chore: add coverage reporting to pytest Add `pytest-cov` to `requirements-dev.txt` and enable coverage reporting in `run_tests.py` by including `--cov` and `--cov- report=xml` options. This provides insight into code coverage, helping to identify areas lacking test coverage. * chore: update changelog for version 1.2.2 Add details for version 1.2.2 including new GitHub Actions labeler config and coverage reporting to pytest.
1 parent 847d33d commit a8d0f51

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ jobs:
3737
python run_tests.py
3838
3939
- name: Upload coverage to Codecov
40-
if: matrix.python-version == '3.11'
40+
if: matrix.python-version == '3.12'
4141
uses: codecov/codecov-action@v5
4242
with:
4343
files: ./coverage.xml
44+
token: ${{ secrets.CODECOV_TOKEN }}
4445
fail_ci_if_error: false
4546

4647
validate:

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to the Rooms integration will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.2.2] - 2025-09-22
9+
10+
### Added
11+
- GitHub Actions labeler configuration for automatic PR labeling based on modified paths
12+
- Coverage reporting to pytest with XML output for CI integration
13+
14+
### Fixed
15+
- Updated CI workflow to upload coverage reports for Python 3.12
16+
- Added Codecov token for secure coverage uploads
17+
818
## [1.2.1] - 2025-09-22
919

1020
### Added

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Development dependencies
22
pytest>=7.0.0
33
pytest-asyncio>=0.20.3
4+
pytest-cov>=3.0.0
45
pytest-homeassistant-custom-component>=0.13.0
56

67
# Home Assistant testing

run_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ def run_tests():
2222
sys.executable,
2323
"-m",
2424
"pytest",
25-
"custom_components/custom_areas/tests/",
2625
"-v",
2726
"--tb=short",
27+
"--cov",
28+
"--cov-branch",
29+
"--cov-report=xml",
30+
"custom_components/custom_areas/tests/",
2831
],
2932
capture_output=True,
3033
text=True,

0 commit comments

Comments
 (0)