chore: add summarizer bootstrap test script

This commit is contained in:
2026-04-01 13:13:16 +02:00
parent 0d65835857
commit cc55fc0cf8
3 changed files with 84 additions and 0 deletions
+20
View File
@@ -30,9 +30,29 @@ pip install -r requirements.txt
python -m uvicorn app:app --host 127.0.0.1 --port 8001 --workers 1
```
If the host is missing `python3-venv` or `pip`, use the bootstrap script instead:
```bash
./scripts/bootstrap-and-test.sh bootstrap
```
## Docker
The Dockerfile installs Tesseract OCR so scanned PDFs and supported images can be processed inside the container.
## Tests
Run the summarizer unit tests with:
```bash
./scripts/bootstrap-and-test.sh test
```
The script:
- creates `.venv` with stdlib `venv` when available
- falls back to user-space `virtualenv` when host `venv` support is missing
- installs `requirements-dev.txt`
- writes pytest cache under `tmp/pytest-cache` to avoid stale root-owned `.pytest_cache` directories
## API
- `GET /health` — health check and runtime capabilities, including Ollama version/model metadata when configured
- `POST /summarize` — JSON body `{ "text": "...", "max_length": 150, "min_length": 30 }`