From bc4f13fa1a37c70cd7ac2bb4ffaa63c26bf9c12e Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Mon, 20 Jul 2026 18:26:45 +0000 Subject: [PATCH] ci: add a dedicated confluent-driver test matrix leg tests/unit/transport/drivers/test_confluent.py is skipped in CI because confluent-kafka is an optional extra (faust[ckafka]) that the test job never installs -- so the confluent driver ships with its unit tests effectively unrun. Give the test matrix an explicit `kafka-driver` axis: * aiokafka -- the default driver and a core dependency -- keeps the full Python x Cython grid (10 jobs, unchanged behaviour). * confluent -- a broker-less, pure-Python wrapper -- gets one dedicated leg per Python version (Cython off; the driver isn't Cython-accelerated). Each installs requirements/extras/ckafka.txt and runs just test_confluent.py, which now executes instead of skipping and adds coverage for the confluent driver. confluent-kafka 2.x publishes manylinux wheels for cp310-cp314, so every matrix Python is covered. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL --- .github/workflows/python-package.yml | 43 ++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 667a141d4..4d385299a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -38,7 +38,7 @@ jobs: - name: Run linting checks run: scripts/check test-pytest: - name: 'Python ${{ matrix.python-version }}/Cython: ${{ matrix.use-cython }}' + name: 'Python ${{ matrix.python-version }}/Cython: ${{ matrix.use-cython }}/Driver: ${{ matrix.kafka-driver }}' runs-on: ubuntu-latest timeout-minutes: 10 # Maybe we should remove this someday but the PyPy tests are acting strange strategy: @@ -49,6 +49,35 @@ jobs: python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] use-cython: ['true', 'false'] experimental: [false] + # aiokafka is the default driver and a core dependency, so it runs the + # full grid. The confluent driver lives behind the optional + # `ckafka` extra; give it a dedicated leg (below) so its tests -- + # tests/unit/transport/drivers/test_confluent.py, otherwise skipped for + # a missing confluent_kafka -- actually run. + kafka-driver: ['aiokafka'] + include: + # confluent driver: broker-less unit tests over a pure-Python + # wrapper, so one leg per Python version (Cython off) is enough. + - python-version: '3.10' + use-cython: 'false' + experimental: false + kafka-driver: 'confluent' + - python-version: '3.11' + use-cython: 'false' + experimental: false + kafka-driver: 'confluent' + - python-version: '3.12' + use-cython: 'false' + experimental: false + kafka-driver: 'confluent' + - python-version: '3.13' + use-cython: 'false' + experimental: false + kafka-driver: 'confluent' + - python-version: '3.14' + use-cython: 'false' + experimental: false + kafka-driver: 'confluent' env: USE_CYTHON: ${{ matrix.use-cython }} continue-on-error: ${{ matrix.experimental }} @@ -65,8 +94,18 @@ jobs: run: | pip install -r requirements/test.txt pip install . + if [ "${{ matrix.kafka-driver }}" = "confluent" ]; then + pip install -r requirements/extras/ckafka.txt + fi - name: Run tests - run: scripts/tests + run: | + if [ "${{ matrix.kafka-driver }}" = "confluent" ]; then + # Dedicated confluent leg: run just the confluent driver's unit + # tests (the aiokafka legs already cover the rest of the suite). + pytest tests/unit/transport/drivers/test_confluent.py + else + scripts/tests + fi - name: Enforce coverage uses: codecov/codecov-action@v5 with: