Skip to content

Fix test_task_announcements flake with immediate heartbeat #566

Fix test_task_announcements flake with immediate heartbeat

Fix test_task_announcements flake with immediate heartbeat #566

Workflow file for this run

name: Docket CI
on:
push:
branches: [main]
pull_request:
workflow_call:
jobs:
test:
name: Test Python ${{ matrix.python-version }}, ${{ matrix.backend.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
backend:
- name: "Redis 6.2, redis-py <5"
redis-version: "6.2"
redis-py-version: ">=5,<6"
- name: "Redis 7.4, redis-py >=5"
redis-version: "7.4"
redis-py-version: ">=5"
- name: "Redis 8.0, redis-py >=5"
redis-version: "8.0"
redis-py-version: ">=5"
- name: "Valkey 8.0, redis-py >=5"
redis-version: "valkey-8.0"
redis-py-version: ">=5"
- name: "Memory (in-memory backend)"
redis-version: "memory"
redis-py-version: ">=5"
include:
- python-version: "3.10"
cov-threshold: 100
pytest-args: ""
# Python 3.11 coverage reporting is unstable, so use 98% threshold
- python-version: "3.11"
cov-threshold: 98
pytest-args: ""
- python-version: "3.12"
cov-threshold: 100
pytest-args: ""
- python-version: "3.13"
cov-threshold: 100
pytest-args: ""
- python-version: "3.14"
cov-threshold: 100
pytest-args: ""
# Memory backend: CLI tests are skipped via pytest skip markers because
# CLI rejects memory:// URLs. Use separate coverage config to exclude CLI.
- backend:
name: "Memory (in-memory backend)"
redis-version: "memory"
redis-py-version: ">=5"
cov-threshold: 98 # CLI tests are excluded from coverage and some lines are only covered by CLI tests
pytest-args: "--cov-config=.coveragerc-memory"
steps:
- uses: actions/checkout@v4
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install dependencies
run: uv sync --upgrade-package 'redis${{ matrix.backend.redis-py-version }}'
- name: Run tests
env:
REDIS_VERSION: ${{ matrix.backend.redis-version }}
run: uv run pytest --cov-branch --cov-fail-under=${{ matrix.cov-threshold }} --cov-report=xml --cov-report=term-missing:skip-covered ${{ matrix.pytest-args }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: python-${{ matrix.python-version }}
prek:
name: Prek checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: "3.10"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install dependencies
run: uv sync
- name: Run prek
uses: j178/prek-action@v1