Performance Tests #56
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: Performance Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| schedule: | |
| - cron: '0 2 * * 0' # Weekly on Sunday at 2 AM | |
| jobs: | |
| benchmark: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_DB: taskiq_benchmark | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies with asyncpg | |
| run: uv sync --dev --group asyncpg | |
| - name: Run performance tests | |
| env: | |
| TEST_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/taskiq_benchmark | |
| run: | | |
| uv run pytest tests/ -v -m "performance" --tb=short --durations=10 | |
| - name: Performance benchmark with asyncpg | |
| env: | |
| TEST_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/taskiq_benchmark | |
| TEST_DRIVER: asyncpg | |
| run: | | |
| # Run a simple benchmark script if available | |
| if [ -f "benchmarks/run_benchmark.py" ]; then | |
| uv run python benchmarks/run_benchmark.py | |
| fi |