Skip to content

Fix docket-rs's rediss:// connections, and put TLS behind a default feature #34

Fix docket-rs's rediss:// connections, and put TLS behind a default feature

Fix docket-rs's rediss:// connections, and put TLS behind a default feature #34

Workflow file for this run

name: Python
on:
push:
branches: [main]
pull_request:
workflow_call:
permissions:
contents: read
jobs:
test:
name: Python ${{ matrix.python-version }}, ${{ matrix.backend.name }}
runs-on: ubuntu-26.04
timeout-minutes: 5
defaults:
run:
working-directory: python
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
# A bug that depends on the Python version shows up on any backend,
# and a bug that depends on the server shows up on any Python. So
# every Python runs the in-memory backend (burner-redis is Python
# code) and one real server, and each other server runs on as few
# Pythons as it needs. Every backend runs against the latest
# redis-py; the older majors live in the test-redis-py job below.
backend:
- name: "Memory"
redis-version: "memory"
- name: "Redis 8"
redis-version: "8.10"
include:
# The oldest supported server with the oldest and newest Python
- python-version: "3.10"
backend:
name: "Redis 6"
redis-version: "6.2"
- python-version: "3.14"
backend:
name: "Redis 6"
redis-version: "6.2"
# redis-py's cluster client has its own async code, so cluster mode
# runs on the oldest and newest Python. It emits ResourceWarning
# about unclosed pub/sub sockets during teardown, which we ignore
# until redis-py fixes it.
- python-version: "3.10"
backend:
name: "Redis 8 Cluster"
redis-version: "8.10-cluster"
pytest-args: "-W ignore::ResourceWarning"
- python-version: "3.14"
backend:
name: "Redis 8 Cluster"
redis-version: "8.10-cluster"
pytest-args: "-W ignore::ResourceWarning"
# Valkey and ACL differ only on the server, so one Python covers them
- python-version: "3.14"
backend:
name: "Valkey 8"
redis-version: "valkey-8.0"
- python-version: "3.14"
backend:
name: "Valkey 9"
redis-version: "valkey-9.1"
- python-version: "3.14"
backend:
name: "Redis 8 with ACL"
redis-version: "8.10-acl"
- python-version: "3.14"
backend:
name: "Valkey 9 with ACL"
redis-version: "valkey-9.1-acl"
# The ACL server again, with the credentials from a credential
# provider instead of the URL
- python-version: "3.14"
backend:
name: "Redis 8 with credential provider"
redis-version: "8.10-provider"
steps:
- uses: actions/checkout@v7
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --upgrade-package redis
- name: Run tests
env:
REDIS_VERSION: ${{ matrix.backend.redis-version }}
run: uv run pytest --ignore=tests/cli --cov-branch --cov-config=.coveragerc-core --cov-fail-under=100 --cov-report=xml --cov-report=term-missing:skip-covered --junitxml=junit.xml -o junit_family=legacy ${{ matrix.pytest-args }}
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: python-${{ matrix.python-version }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
test-cli:
name: Python ${{ matrix.python-version }}, CLI
runs-on: ubuntu-26.04
timeout-minutes: 4
defaults:
run:
working-directory: python
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --upgrade-package 'redis>=6'
- name: Run CLI tests
env:
REDIS_VERSION: "8.10"
run: >
uv run pytest tests/cli/
-o 'addopts=--import-mode=importlib'
--numprocesses=logical --maxprocesses=4
--cov=src/docket/cli --cov=tests/cli
--cov-config=.coveragerc-cli
--cov-branch --cov-fail-under=100
--cov-report=xml --cov-report=term-missing:skip-covered
--junitxml=junit.xml -o junit_family=legacy
--timeout=30
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: cli-python-${{ matrix.python-version }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
test-windows:
name: Python ${{ matrix.python-version }}, Windows
runs-on: windows-latest
timeout-minutes: 6
defaults:
run:
working-directory: python
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --upgrade-package 'redis>=6'
- name: Run tests
env:
REDIS_VERSION: memory
run: >
uv run pytest --ignore=tests/cli
--cov-branch --cov-config=.coveragerc-core
--cov-fail-under=100
--cov-report=xml --cov-report=term-missing:skip-covered
--junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: windows-python-${{ matrix.python-version }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
test-redis-py:
name: Python 3.14, Redis 8.10, redis-py ${{ matrix.redis-py.name }}
runs-on: ubuntu-26.04
timeout-minutes: 4
defaults:
run:
working-directory: python
strategy:
fail-fast: false
matrix:
# The client is what varies, so we pin one Python and one real Redis
# and run the full suite against each redis-py major we support. A
# real, standalone Redis is required since the bug this guards (#425)
# is a client socket timeout.
redis-py:
- { name: "6", spec: ">=6,<7" }
- { name: "7", spec: ">=7,<8" }
- { name: "8", spec: ">=8" }
steps:
- uses: actions/checkout@v7
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --upgrade-package 'redis${{ matrix.redis-py.spec }}'
- name: Run tests
env:
REDIS_VERSION: "8.10"
run: >
uv run pytest --ignore=tests/cli
--cov-branch --cov-config=.coveragerc-core
--cov-fail-under=100
--cov-report=xml --cov-report=term-missing:skip-covered
--junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: redis-py-${{ matrix.redis-py.name }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results