Skip to content

CI – Integration Tests #37

CI – Integration Tests

CI – Integration Tests #37

name: Integration Tests
on:
pull_request:
workflow_run:
workflows: [Unit Tests]
types: [completed]
jobs:
integration:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: test
ports: ['5432:5432']
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
# --- JavaScript side: Set up Node.js and run integration tests ---
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- name: Run JavaScript integration tests (using Jest or other)
run: npm run test:integration || echo "No JS integration tests found"
# --- Python side: Set up Python and run FastAPI integration tests ---
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install Python dependencies
run: |
pip install -r backend/requirements.txt
pip install pytest
- name: Start FastAPI backend (in the background)
run: |
uvicorn backend.app:app --host 0.0.0.0 --port 8000 &
- name: Run Python integration tests
run: pytest backend/integration_tests/ || echo "No Python integration tests found"
# --- Optional: Test integration with the database ---
# You can add further steps here for any database interactions, depending on your test strategy