Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 76 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,79 @@ jobs:
- name: Test Docker Build
run: docker build -t multai-back-test .

# - name: Run tests
# run: uv run pytest --maxfail=1 --disable-warnings

test:
name: Run Tests
runs-on: ubuntu-latest
needs: lint-and-typecheck
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test_db
POSTGRES_PORT: 5432
POSTGRES_HOST: localhost
REDIS_HOST: localhost
REDIS_PORT: 6379
NATS_PORT: 4222
NATS_HOST: localhost
NATS_PASSWORD: dummy
NATS_USER: dummy
MINIO_API_PORT: 9000
MINIO_ROOT_USER: dummy
MINIO_ROOT_PASSWORD: dummy
MINIO_HOST: localhost
jwt_secret: test_secret
encryption_key: test_encryption_key
FACE_ENCRYPTION_KEY: test_face_encryption_key
FIREBASE_CREDENTIALS_PATH: dummy.json
services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
nats:
image: nats:2.10-alpine
command: --user dummy --pass dummy
ports:
- 4222:4222
minio:
image: minio/minio:latest
env:
MINIO_ROOT_USER: dummy
MINIO_ROOT_PASSWORD: dummy
command: server /data
ports:
- 9000:9000

steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: Run Migrations
run: uv run alembic upgrade head
- name: Run Tests
run: uv run pytest tests/
4 changes: 4 additions & 0 deletions tests/e2e/test_stats_endpoint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import pytest
import os
if os.getenv("MULTAI_RUN_E2E") != "1":
pytest.skip("set MULTAI_RUN_E2E=1 to run live e2e tests", allow_module_level=True)

import uuid
from fastapi.testclient import TestClient
from datetime import datetime, timezone
Expand Down