eellak / eellak/glossAPI

Windows smoke tests fail on Greek text when DejaVu font path is unavailable

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

Description

### Environment

- Windows 10
- Python 3.11.9
- PyTorch 2.5.1+cu121
- CUDA available with NVIDIA GeForce GTX 960M
- `glossapi_rs_cleaner` built and installed successfully

### Reproduction

From the `development` branch:

```powershell
python -m pytest tests/test_pipeline_smoke.py -rs
```

The test suite starts correctly and CUDA is detected, but two smoke tests fail while generating PDFs containing Greek text.

### Observed behaviour

The failures originate in `fpdf` with errors such as:

```text
FPDFUnicodeEncodingException: Character "Κ" ... is outside the range of characters supported by the font used: "helvetica"
```

The test helper currently uses:

```python
_FONT_PATH = Path("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf")
```

On Windows that Linux-specific path does not exist, so `_write_pdf()` falls back to Helvetica. Helvetica cannot encode the Greek strings used by the smoke tests, which causes the failures before the actual pipeline assertions are reached.

### Expected behaviour

The smoke tests should be able to generate their Unicode test PDFs on supported development platforms without depending on a Linux-only font path.

### Possible direction

A platform-independent Unicode font lookup for the tests, or a small bundled test font, would avoid the fallback to Helvetica and make the smoke tests portable across Windows and Linux.

I found this while setting up GlossAPI on Windows as a new contributor. I am happy to work on a small fix if this approach makes sense to the maintainers.

Contributor guide

Open the contributing guide

Research direction

Start with tests/test_pipeline_smoke.py and its _write_pdf() helper, then run `python -m pytest tests/test_pipeline_smoke.py -rs` on Windows. Check how the DejaVuSans path is selected and how the helper falls back to Helvetica. Done means the Greek-text smoke tests generate their PDFs and reach their pipeline assertions on supported Windows and Linux environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.