Re-read the job from DB before mark_completed so that progress_current/progress_total written during batched conversion are not overwritten by the stale in-memory object. Add regression unit test and e2e assertion on final progress values. |
||
|---|---|---|
| .. | ||
| src/test | ||
| pom.xml | ||
| README.md | ||
E2E API Tests — Karate
End-to-end API tests for Docling Studio using Karate.
Prerequisites
- JDK 17+ (e.g.
brew install openjdk@17) - Maven 3.9+ (e.g.
brew install maven) - Python 3.12+ (for test data generation)
- Docker (for running the full stack)
Quick start
# 1. Generate test PDFs (from repo root)
python e2e/generate-test-data.py
# 2. Start the stack
docker compose up -d --wait
# 3. Run all API tests
mvn test -f e2e/api/pom.xml
# 4. Tear down
docker compose down
Run by tag
# Smoke only (~30s)
mvn test -f e2e/api/pom.xml -Dkarate.options="--tags @smoke"
# Regression (~2min)
mvn test -f e2e/api/pom.xml -Dkarate.options="--tags @regression"
# Full E2E workflows (~5min)
mvn test -f e2e/api/pom.xml -Dkarate.options="--tags @e2e"
Custom base URL
mvn test -f e2e/api/pom.xml -DbaseUrl=http://your-host:8000
Structure
e2e/api/
├── pom.xml # Maven + Karate dependency
├── src/test/java/
│ └── E2ERunner.java # JUnit5 Karate runner
└── src/test/resources/
├── karate-config.js # Base URL, timeouts, retry config
├── common/
│ ├── helpers/ # Callable features (upload, analyze, cleanup)
│ └── data/
│ ├── schemas/ # JSON match schemas
│ ├── test-cases/ # Data-driven JSON files
│ └── generated/ # Generated PDFs (gitignored)
├── health/ # @smoke
├── documents/ # @regression
├── analyses/ # @regression
└── workflows/ # @e2e (cross-domain)
Reports
After a run, Karate HTML reports are in e2e/api/target/karate-reports/.