Skip to content

Commit 003828b

Browse files
committed
ci: enhance tests workflow with proper coverage reporting
- Remove duplicate lint job from tests.yml (already exists in lint.yml) - Add coverage reporting with pytest-cov and term-missing output - Add codecov integration for coverage tracking - Test matrix runs on Python 3.11 and 3.12 - All 14 unit tests now properly run in GitHub Actions - Coverage XML report generated for external tools Fixes missing unit tests in CI/CD pipeline
1 parent d348f1a commit 003828b

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,14 @@ jobs:
3434
source .venv/bin/activate
3535
uv pip install -e ".[test]"
3636
37-
- name: Run tests
37+
- name: Run tests with coverage
3838
run: |
3939
source .venv/bin/activate
40-
python -m pytest
40+
python -m pytest --cov=pia_mcp_server --cov-report=term-missing --cov-report=xml
4141
42-
lint:
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@v4
46-
47-
- name: Set up Python
48-
uses: actions/setup-python@v4
42+
- name: Upload coverage to codecov
43+
if: matrix.python-version == '3.11'
44+
uses: codecov/codecov-action@v3
4945
with:
50-
python-version: "3.11"
51-
52-
- name: Install uv
53-
uses: astral-sh/setup-uv@v3
54-
with:
55-
version: "latest"
56-
57-
- name: Create virtual environment
58-
run: uv venv
59-
60-
- name: Install dependencies
61-
run: |
62-
source .venv/bin/activate
63-
uv pip install -e ".[dev]"
64-
65-
- name: Run Black
66-
run: |
67-
source .venv/bin/activate
68-
black --check .
46+
file: ./coverage.xml
47+
fail_ci_if_error: false

0 commit comments

Comments
 (0)