Skip to content

Commit 9c6c261

Browse files
committed
feat(ci): add test coverage for reporter (Python/pytest)
- Enable pytest-cov for reporter tests with term + XML reports - Add coverage regex and artifacts to reporter:tests job - Add Reporter Coverage badge to README Both CLI (Bun) and Reporter (Python) now have coverage badges. Closes #74
1 parent 66a0af4 commit 9c6c261

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.gitlab-ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,15 @@ reporter:tests:
8181
- pip install -r reporter/requirements-dev.txt
8282
script:
8383
- chown -R postgres:postgres "$CI_PROJECT_DIR"
84-
- su - postgres -c "cd \"$CI_PROJECT_DIR\" && python -m pytest --run-integration tests/reporter"
84+
- su - postgres -c "cd \"$CI_PROJECT_DIR\" && python -m pytest --run-integration --cov=reporter --cov-report=term --cov-report=xml:coverage/reporter-coverage.xml tests/reporter"
85+
# Fix ownership for artifact collection
86+
- chown -R root:root "$CI_PROJECT_DIR/coverage" || true
87+
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+)%/'
88+
artifacts:
89+
when: always
90+
paths:
91+
- coverage/
92+
expire_in: 7 days
8593
rules:
8694
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
8795

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![GitLab](https://img.shields.io/badge/GitLab-postgres--ai%2Fpostgres__ai-orange?logo=gitlab)](https://gitlab.com/postgres-ai/postgres_ai)
55
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-14%2B-blue?logo=postgresql)](https://www.postgresql.org/)
66
[![CLI Coverage](https://gitlab.com/postgres-ai/postgres_ai/badges/main/coverage.svg?job=cli:node:tests)](https://gitlab.com/postgres-ai/postgres_ai/-/jobs)
7+
[![Reporter Coverage](https://gitlab.com/postgres-ai/postgres_ai/badges/main/coverage.svg?job=reporter:tests)](https://gitlab.com/postgres-ai/postgres_ai/-/jobs)
78

89
**Expert-level Postgres monitoring tool designed for humans and AI systems**
910

0 commit comments

Comments
 (0)