Skip to content
Draft
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
177 changes: 177 additions & 0 deletions .github/workflows/scylla-driver-testpy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: Scylla test.py driver compatibility

on:
push:
branches:
- master
- 'branch-**'
paths:
- cassandra/**
- tests/**
- scripts/run_scylla_driver_testpy.sh
- scripts/scylla-driver-testpy-tests.txt
- .github/workflows/scylla-driver-testpy.yml
- pyproject.toml
- uv.lock
- setup.py
pull_request:
paths:
- cassandra/**
- tests/**
- scripts/run_scylla_driver_testpy.sh
- scripts/scylla-driver-testpy-tests.txt
- .github/workflows/scylla-driver-testpy.yml
- pyproject.toml
- uv.lock
- setup.py
workflow_dispatch:

permissions:
contents: read

jobs:
testpy-driver-compat:
name: latest Scylla release test.py driver subset
if: "!contains(github.event.pull_request.labels.*.name, 'disable-integration-tests')"
runs-on: ubuntu-24.04
timeout-minutes: 120
env:
GET_VERSION_SHA256: 2dfbf1afd596fc9efd68c7795bfa52df0fd69d0342237574a17521b14f173df3
GET_VERSION_VERSION: 0.4.3
MC_SHA256: 01f866e9c5f9b87c2b09116fa5d7c06695b106242d829a8bb32990c00312e891
MC_VERSION: RELEASE.2025-08-13T08-35-41Z
MINIO_SHA256: 7c5bd8512c6e966455b1d198209358b2d191c77a83ab377c4073281065fb855f
MINIO_VERSION: RELEASE.2025-09-07T16-13-09Z
SCYLLA_CCM_COMMIT: d15a2fab9d22fffad8a30c806a7c8e1632e58aae
TOXIPROXY_SHA256: 65e042d3fc2290c099527bc506446a6fd863a09f113b8944b636ece70221c2b3
TOXIPROXY_VERSION: 2.12.0

steps:
- name: Checkout driver
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Install system dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
curl \
libaio1t64 \
libev4 \
libev-dev \
ldap-utils \
sasl2-bin \
slapd \
tar \
unzip
sudo mkdir -p /etc/openldap
sudo ln -sfn /etc/ldap/schema /etc/openldap/schema
if command -v apparmor_parser >/dev/null 2>&1 && [[ -f /etc/apparmor.d/usr.sbin.slapd ]]; then
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.slapd || true
fi
echo /usr/sbin >> "$GITHUB_PATH"

- name: Install Scylla test.py service tools
run: |
mkdir -p "$RUNNER_TEMP/bin"
curl -fsSLo "$RUNNER_TEMP/bin/minio" \
"https://dl.min.io/server/minio/release/linux-amd64/archive/minio.${MINIO_VERSION}"
echo "${MINIO_SHA256} $RUNNER_TEMP/bin/minio" | sha256sum -c -
curl -fsSLo "$RUNNER_TEMP/bin/mc" \
"https://dl.min.io/client/mc/release/linux-amd64/archive/mc.${MC_VERSION}"
echo "${MC_SHA256} $RUNNER_TEMP/bin/mc" | sha256sum -c -
curl -fsSLo "$RUNNER_TEMP/toxiproxy.tar.gz" \
"https://github.com/Shopify/toxiproxy/releases/download/v${TOXIPROXY_VERSION}/toxiproxy_${TOXIPROXY_VERSION}_linux_amd64.tar.gz"
echo "${TOXIPROXY_SHA256} $RUNNER_TEMP/toxiproxy.tar.gz" | sha256sum -c -
tar -xzf "$RUNNER_TEMP/toxiproxy.tar.gz" -C "$RUNNER_TEMP/bin" toxiproxy-server toxiproxy-cli
chmod +x "$RUNNER_TEMP/bin/minio" "$RUNNER_TEMP/bin/mc" "$RUNNER_TEMP/bin/toxiproxy-server" "$RUNNER_TEMP/bin/toxiproxy-cli"
printf '%s\n' \
'#!/usr/bin/env bash' \
'exec /usr/sbin/slapd -u "$(id -un)" -g "$(id -gn)" "$@"' \
> "$RUNNER_TEMP/bin/slapd"
chmod +x "$RUNNER_TEMP/bin/slapd"
echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"

- name: Install get-version
run: |
mkdir -p "$RUNNER_TEMP/bin"
curl -fsSLo "$RUNNER_TEMP/get-version.zip" \
"https://github.com/scylladb-actions/get-version/releases/download/v${GET_VERSION_VERSION}/get-version_${GET_VERSION_VERSION}_linux_amd64v3.zip"
echo "${GET_VERSION_SHA256} $RUNNER_TEMP/get-version.zip" | sha256sum -c -
unzip -q -o "$RUNNER_TEMP/get-version.zip" -d "$RUNNER_TEMP/bin"
chmod +x "$RUNNER_TEMP/bin/get-version"
Comment on lines +100 to +104
echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"

- name: Resolve latest stable Scylla release
id: scylla-release
run: |
version="$(scripts/run_scylla_driver_testpy.sh --resolve-scylla-version)"
Comment on lines +107 to +110
if [[ -z "$version" ]]; then
echo "Failed to resolve latest stable Scylla release" >&2
exit 1
fi
git ls-remote --exit-code --refs --tags https://github.com/scylladb/scylladb.git "refs/tags/scylla-$version"
echo "version=$version" >> "$GITHUB_OUTPUT"

- name: Checkout matching Scylla test.py
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: scylladb/scylladb
ref: scylla-${{ steps.scylla-release.outputs.version }}
path: scylladb
fetch-depth: 1
persist-credentials: false

- name: Prepare Scylla test.py host compatibility
run: |
if [[ -f /usr/lib/ldap/back_mdb.so ]] && ! grep -q '^moduleload back_mdb' scylladb/test/resource/slapd.conf; then
sed -i '1imoduleload back_mdb\nmodulepath /usr/lib/ldap' scylladb/test/resource/slapd.conf
fi

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.13"

- name: Build driver
run: uv sync --no-dev

- name: Install ccm and Scylla test.py Python dependencies
run: |
uv pip install \
"ccm @ git+https://github.com/scylladb/scylla-ccm.git@${SCYLLA_CCM_COMMIT}" \
aiohttp \
allure-pytest \
colorama \
cryptography \
humanfriendly \
psutil \
PyKMIP \
"pytest~=8.0" \
pytest-asyncio \
pytest-repeat \
pytest-timeout \
pytest-xdist \
requests \
sqlalchemy \
tabulate \
treelib \
unidiff \
universalasync

- name: Cache Scylla ccm download
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.ccm/repository
~/.ccm/scylla-repository
key: scylla-ccm-release-${{ steps.scylla-release.outputs.version }}-${{ runner.os }}

- name: Run Scylla test.py driver subset
env:
SCYLLA_SOURCE_DIR: ${{ github.workspace }}/scylladb
SCYLLA_TESTPY_TMPDIR: ${{ runner.temp }}/scylla-testpy
SCYLLA_VERSION: ${{ steps.scylla-release.outputs.version }}
run: scripts/run_scylla_driver_testpy.sh
Loading
Loading