Skip to content

Commit eadbb06

Browse files
InfantLabclaude
andcommitted
test+ci: add 192 tests across 9 modules, fix dep hygiene, add codecov badge
Add comprehensive unit tests for 9 previously-uncovered modules: - auth/token_manager.py (56% -> 95.76%, 30 tests) - database/crud.py (44% -> 98.50%, 53 tests) - schemas/industry_standards.py + storage.py (0% -> 100%, 12 tests) - utils/automatic_labeling.py (6% -> 96.22%, 30 tests) - utils/person_identity.py (18% -> 94.67%, 43 tests) - pipelines/face_analysis/openface_compatibility.py (0% -> 94.37%, 24 tests) Also: move pytest/pytest-asyncio from runtime to dev-only deps, add Codecov badge to README, update JOSS checklist. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8045170 commit eadbb06

12 files changed

Lines changed: 1958 additions & 13 deletions

File tree

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[![uv](https://img.shields.io/badge/uv-package%20manager-FF4B4B?logo=uv&logoColor=white)](https://github.com/astral-sh/uv)
77
[![Docker](https://img.shields.io/badge/Docker-GPU%20Ready-2496ED?logo=docker&logoColor=white)](https://docs.docker.com/)
88
[![CI](https://github.com/InfantLab/VideoAnnotator/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/InfantLab/VideoAnnotator/actions/workflows/ci-cd.yml)
9+
[![codecov](https://codecov.io/gh/InfantLab/VideoAnnotator/branch/master/graph/badge.svg)](https://codecov.io/gh/InfantLab/VideoAnnotator)
910
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/InfantLab/VideoAnnotator)
1011

1112
**Automated video analysis toolkit for human interaction research** - Extract comprehensive behavioral annotations from videos using AI pipelines, with an intuitive web interface for visualization and analysis.
@@ -343,7 +344,13 @@ MIT License - Full terms in [LICENSE](LICENSE)
343344

344345
### **Research Team**
345346

346-
- **Caspar Addyman** (infantologist@gmail.com) - Lead Developer & Research Director
347+
- **Caspar Addyman** - Stellenbosch University, South Africa [![ORCID](https://img.shields.io/badge/ORCID-0000--0003--0001--9548-green)](https://orcid.org/0000-0003-0001-9548) — Lead Developer & Corresponding Author
348+
- **Jeremiah Ishaya** - Stellenbosch University, South Africa [![ORCID](https://img.shields.io/badge/ORCID-0000--0002--9014--9372-green)](https://orcid.org/0000-0002-9014-9372)
349+
- **Irene Uwerikowe** - Stellenbosch University, South Africa [![ORCID](https://img.shields.io/badge/ORCID-0000--0002--1293--7349-green)](https://orcid.org/0000-0002-1293-7349)
350+
- **Daniel Stamate** - Department of Computing, Goldsmiths, University of London, UK [![ORCID](https://img.shields.io/badge/ORCID-0000--0001--8565--6890-green)](https://orcid.org/0000-0001-8565-6890)
351+
- **Jamie Lachman** - Department of Social Policy and Intervention, University of Oxford, UK [![ORCID](https://img.shields.io/badge/ORCID-0000--0001--9475--9218-green)](https://orcid.org/0000-0001-9475-9218)
352+
- **Mark Tomlinson** - Stellenbosch University, South Africa [![ORCID](https://img.shields.io/badge/ORCID-0000--0001--5846--3444-green)](https://orcid.org/0000-0001-5846-3444)
353+
347354

348355
### **Open Source Dependencies**
349356

docs/development/joss_testing_ci_polish.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Created 2026-02-27 based on coverage analysis of v1.4.1.
2121

2222
### 1.3 Auth and data layer gaps (44–56% coverage)
2323

24-
- [ ] **`auth/token_manager.py`** — 141 lines, 56% coverage. JWT create/verify/refresh logic. Estimated +40–60 lines covered.
25-
- [ ] **`database/crud.py`** — 166 lines, 44% coverage. CRUD operations, testable with in-memory SQLite. Estimated +50–80 lines covered.
24+
- [x] **`auth/token_manager.py`** — 141 lines, 56% -> 95.76%. Tests in `tests/unit/auth/test_token_manager.py` (30 tests). JWT generation/validation tested directly; API key paths tested with mocks.
25+
- [x] **`database/crud.py`** — 166 lines, 44% -> 98.50%. Tests in `tests/unit/database/test_crud.py` (53 tests). Full CRUD coverage using in-memory SQLite (UserCRUD, APIKeyCRUD, JobCRUD).
2626

2727
### 1.4 Other notable gaps
2828

29-
- [ ] **`utils/automatic_labeling.py`** — 156 lines, 6% coverage.
30-
- [ ] **`utils/person_identity.py`** — 163 lines, 18% coverage.
31-
- [ ] **`pipelines/face_analysis/openface_compatibility.py`** — 69 lines, 0% coverage.
32-
- [ ] **`schemas/industry_standards.py`** + **`schemas/storage.py`** — 21 lines total, 0% coverage.
29+
- [x] **`utils/automatic_labeling.py`** — 156 lines, 6% -> 96.22%. Tests in `tests/unit/utils/test_automatic_labeling.py` (30 tests). Size-based, position-based, temporal consistency, and spatial analysis all covered.
30+
- [x] **`utils/person_identity.py`** — 163 lines, 18% -> 94.67%. Tests in `tests/unit/utils/test_person_identity.py` (35 tests). Full lifecycle: registration, labeling, IoU, face linking, save/load round-trip, label normalization.
31+
- [x] **`pipelines/face_analysis/openface_compatibility.py`** — 69 lines, 0% -> 94.37%. Tests in `tests/unit/pipelines/test_openface_compatibility.py` (24 tests). All 7 compatibility classes, scipy patching, model paths.
32+
- [x] **`schemas/industry_standards.py`** + **`schemas/storage.py`** — 21 lines total, 0% -> 100%. Tests in `tests/unit/schemas/test_schemas.py` (12 tests).
3333

3434
### 1.5 Lower priority (large modules, harder to unit-test)
3535

@@ -73,14 +73,14 @@ All actions bumped in ci-cd.yml:
7373

7474
### 2.5 Dependency hygiene
7575

76-
- [ ] **Move `pytest` and `pytest-asyncio` from `[project.dependencies]` to dev-only**they are runtime test deps shipped to end users today.
76+
- [x] **Move `pytest` and `pytest-asyncio` from `[project.dependencies]` to dev-only**removed from runtime deps, added `pytest>=8.3.2` to `[dependency-groups] dev`.
7777

7878
---
7979

8080
## 3. Metadata Fixes
8181

8282
- [x] **Fix `project.urls`** in pyproject.toml — updated to `InfantLab/VideoAnnotator`.
83-
- [ ] **Add Codecov badge** to README.md.
83+
- [x] **Add Codecov badge** to README.md.
8484

8585
---
8686

@@ -102,3 +102,7 @@ All actions bumped in ci-cd.yml:
102102
| 2026-02-27 | Fixed all 82 ruff lint errors (31 autofix + 51 manual) ||
103103
| 2026-02-27 | CI: broadened ruff rules, un-gated mypy, un-gated integration tests, added coverage threshold, bumped all action versions ||
104104
| 2026-02-27 | Fixed project.urls to point to InfantLab/VideoAnnotator ||
105+
| 2026-02-27 | Added tests for token_manager, crud, schemas (3 new test files, 95 new tests) | 51.97% -> ~55% (est.) |
106+
| 2026-02-27 | Moved pytest/pytest-asyncio from runtime to dev-only deps ||
107+
| 2026-02-27 | Added Codecov badge to README.md ||
108+
| 2026-02-27 | Added tests for automatic_labeling, person_identity, openface_compatibility (3 new test files, 97 new tests) | ~55% -> ~58% (est.) |

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies = [
3737
"openpyxl",
3838
"pandas>=2.2.2",
3939
"Pillow>=10.4.0",
40-
"pytest>=8.3.2",
40+
# Note: pytest moved to [dependency-groups] dev — not needed at runtime
4141
"python-dotenv>=1.0.1",
4242
# Pin NumPy below 2.0 until all binary deps (scipy, matplotlib, pyannote, etc.) ship compatible wheels
4343
"numpy>=1.24.0,<2.0",
@@ -98,8 +98,7 @@ dependencies = [
9898
"uvicorn[standard]>=0.30.0",
9999
"python-multipart>=0.0.9",
100100
"psutil>=5.9.0",
101-
# Async test support (pytest 8 compatible)
102-
"pytest-asyncio>=0.23.6",
101+
# Note: pytest-asyncio moved to [dependency-groups] dev — not needed at runtime
103102
# Configuration and utilities
104103
"pyyaml>=6.0.0",
105104
"rich>=13.0.0",
@@ -305,8 +304,9 @@ dev = [
305304
"mypy>=1.5.0",
306305
"pre-commit>=4.3.0",
307306
"pydocstyle>=6.3.0",
308-
"pytest-cov>=4.0.0",
307+
"pytest>=8.3.2",
309308
"pytest-asyncio>=1.1.0",
309+
"pytest-cov>=4.0.0",
310310
"ruff>=0.14.0",
311311
]
312312

tests/unit/auth/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)