Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ocr-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: OCR integration

on:
workflow_dispatch:

permissions:
contents: read

jobs:
ocr-integration:
name: Real PaddleOCR integration
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: services/ocr-service
env:
DEBUG: 'false'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: services/ocr-service/requirements.txt

- name: Install dependencies
run: python -m pip install --upgrade pip && python -m pip install -r requirements.txt

- name: Run real OCR integration tests
run: python -m pytest -m integration --runintegration --runslow -v

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail the workflow when real OCR returns an error

When model download, initialization, or the actual OCR call fails, this workflow still reports success: the selected integration test calls process_image, which converts every exception into an OCRResult(status="error"), and then explicitly accepts "error" as a valid status in tests/test_engine.py:614-618. Consequently, the new manual workflow cannot provide the advertised real-engine integration proof; the test should require successful OCR output or otherwise propagate the failure.

Useful? React with 👍 / 👎.

13 changes: 13 additions & 0 deletions services/ocr-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,19 @@ pytest --cov=app --cov-report=html
pytest tests/test_engine.py -v
```

### Real OCR Integration

The deterministic suite intentionally does not download PaddleOCR models. The
real engine test is isolated in the `OCR integration` workflow and can be
started manually from GitHub Actions. Locally, run:

```bash
pytest -m integration --runintegration --runslow -v
```

This test is slower and requires model downloads; it is not a required pull
request check.

### Manual Testing

```bash
Expand Down
Loading