Skip to content

integration tests that hit actual database (#4) #25

integration tests that hit actual database (#4)

integration tests that hit actual database (#4) #25

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Ruff check
run: ruff check .
- name: Ruff format check
run: ruff format --check .
- name: Type check
run: mypy src/paradedb
test:
name: django-paradedb test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
django-version: ["6.0"]
services:
paradedb:
image: paradedb/paradedb:0.21.4-pg18
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 12
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "Django~=${{ matrix.django-version }}.0"
pip install -e ".[dev]"
# Tests SQL generation only - no database required
- name: Run tests
env:
PARADEDB_TEST_DSN: postgresql://postgres@localhost:5432/postgres
PGPASSWORD: postgres
run: pytest --cov=paradedb --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_GLOBAL_UPLOAD_TOKEN }}
integration:
name: django-paradedb integration
runs-on: ubuntu-latest
needs: test
services:
paradedb:
image: paradedb/paradedb:0.21.4-pg18
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 12
env:
PARADEDB_INTEGRATION: "1"
PARADEDB_TEST_DSN: postgresql://postgres@localhost:5432/postgres
PGPASSWORD: postgres
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run integration tests
env:
PARADEDB_INTEGRATION: ${{ env.PARADEDB_INTEGRATION }}
PARADEDB_TEST_DSN: ${{ env.PARADEDB_TEST_DSN }}
PGPASSWORD: ${{ env.PGPASSWORD }}
run: pytest -m integration