Run file processors integration tests #839
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: File Processors Tests | |
| run-name: Run file processors integration tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'release-[0-9]+.[0-9]+.x' | |
| paths: | |
| - 'src/ogx/providers/inline/file_processor/**' | |
| - 'src/ogx/providers/registry/file_processors.py' | |
| - 'tests/integration/file_processors/**' | |
| - '.github/workflows/file-processors-tests.yml' | |
| pull_request: | |
| branches: | |
| - main | |
| - 'release-[0-9]+.[0-9]+.x' | |
| paths: | |
| - 'src/ogx/providers/inline/file_processor/**' | |
| - 'src/ogx/providers/registry/file_processors.py' | |
| - 'tests/integration/file_processors/**' | |
| - '.github/workflows/file-processors-tests.yml' | |
| merge_group: | |
| branches: | |
| - main | |
| - 'release-[0-9]+.[0-9]+.x' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| docling-tests: | |
| name: Docling provider | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup-runner | |
| with: | |
| python-version: "3.12" | |
| - name: Install docling | |
| run: uv pip install docling | |
| - name: Start OGX server with docling | |
| env: | |
| OGX_DISABLE_VERSION_CHECK: "1" | |
| run: | | |
| uv run --no-sync ogx stack run \ | |
| --providers "file_processors=inline::docling,files=inline::localfs" \ | |
| --port 8321 & | |
| # Wait for server to be ready | |
| for i in $(seq 1 60); do | |
| if curl -sf http://localhost:8321/v1/health > /dev/null 2>&1; then | |
| echo "Server is ready" | |
| break | |
| fi | |
| if [ "$i" -eq 60 ]; then | |
| echo "Server failed to start within 60 seconds" | |
| exit 1 | |
| fi | |
| sleep 2 | |
| done | |
| - name: Warm up docling processor | |
| run: | | |
| uv run --no-sync python - <<'PY' | |
| from pathlib import Path | |
| import requests | |
| pdf_path = Path("tests/integration/responses/fixtures/pdfs/ogx_and_models.pdf") | |
| response = requests.post( | |
| "http://localhost:8321/v1alpha/file-processors/process", | |
| files={"file": (pdf_path.name, pdf_path.read_bytes(), "application/pdf")}, | |
| timeout=300, | |
| ) | |
| response.raise_for_status() | |
| payload = response.json() | |
| print(f"Warmup complete: {len(payload.get('chunks', []))} chunks") | |
| PY | |
| - name: Run file processors integration tests | |
| run: | | |
| uv run --no-sync pytest -s -v \ | |
| tests/integration/file_processors/test_file_processors.py \ | |
| --stack-config="http://localhost:8321" \ | |
| --junitxml=pytest-report-file-processors.xml | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: test-results-file-processors | |
| path: pytest-report-file-processors.xml | |
| retention-days: 7 |