ivrit-ai / ivrit-ai/explore

Feature: Add Comprehensive Test Suite

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

The project currently lacks a structured automated test suite. Adding tests will improve reliability, enable safer refactoring, and ensure new features (search, filters, diarization, CSV export, etc.) behave as expected.

**Proposal:**
Introduce a pytest-based testing framework covering core components of the system.

**Scope:**
1. Core Search Logic

- Tests for keyword, partial-word, and regex queries.
- Tests for ranking, offsets, and snippet extraction.
- Edge cases: empty queries, Unicode/RTL Hebrew, corrupted inputs.

**2. Database Layer**
- Temporary SQLite test DB.
- Fixtures for documents, transcripts, diarization segments.
- Validate indexing, lookups, pagination, date filters.

**3. Features / Filters**
- Log-prob filtering.
- Date filtering & ordering.
- Speaker diarization filtering once added.

**4. CSV / Export**
- Validate export schema.
- Confirm audio URLs appear in output.
- Verify correct escaping for RTL text.

**5. API / Flask Endpoints**
- Test search endpoints, JSON output shapes, error handling.
- Ensure Hebrew RTL safety in templates.

**Implementation notes:**

- Use pytest fixtures with small dummy JSON and tiny WAV files.
- Avoid heavy deps; prefer stdlib + minimal test helpers.
- Add tests/ folder with clear structure (test_search.py, test_db.py, etc.).
- Consider GitHub Actions CI to run tests on every PR.

**Why this matters:**
A robust test suite is essential as the codebase grows—especially with upcoming features like diarization support, timeline stats, audio links, and confidence filtering.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by mapping the core search logic, database layer, filters, CSV export, and Flask endpoints described in the issue. Create the proposed tests/ structure around test_search.py and test_db.py, using the listed fixtures and edge cases as the initial test plan. Done means the core behaviors, exports, endpoints, and error handling have automated coverage, with CI considered for every pull request.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python, sqlite
Domain
api, backend, databases, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.