diff --git a/.github/workflows/build-lint-and-test.yml b/.github/workflows/build-lint-and-test.yml index 87b885ee..550071e5 100644 --- a/.github/workflows/build-lint-and-test.yml +++ b/.github/workflows/build-lint-and-test.yml @@ -60,64 +60,80 @@ jobs: strategy: matrix: - scylla-version: [ENTERPRISE-RELEASE, ENTERPRISE-PRIOR-RELEASE] + scylla-version: [LATEST, PRIOR, LTS-LATEST, LTS-PRIOR] fail-fast: false steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Python 3 - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - name: Update apt cache run: sudo apt-get update -y - name: Install CCM run: | - make install-ccm-if-missing + PATH="$HOME/.local/bin:$PATH" make install-ccm-if-missing + + - name: Select scylla filter + id: scylla-filter + run: | + # Select the latest stable patch on each release line and drop + # prerelease tags before taking the requested position. + case "${{ matrix.scylla-version }}" in + LATEST) + printf 'value=%s\n' '^[0-9]{4}$.^[2-9][0-9]*$.LAST and *.*.^[0-9]+$ and LAST' >> "$GITHUB_OUTPUT" + ;; + PRIOR) + printf 'value=%s\n' '^[0-9]{4}$.^[2-9][0-9]*$.LAST and *.*.^[0-9]+$ and LAST-1' >> "$GITHUB_OUTPUT" + ;; + LTS-LATEST) + printf 'value=%s\n' '^[0-9]{4}$.1.LAST and *.*.^[0-9]+$ and LAST' >> "$GITHUB_OUTPUT" + ;; + LTS-PRIOR) + printf 'value=%s\n' '^[0-9]{4}$.1.LAST and *.*.^[0-9]+$ and LAST-1' >> "$GITHUB_OUTPUT" + ;; + *) + echo "Unknown scylla version name ${{ matrix.scylla-version }}" + exit 1 + ;; + esac - name: Get scylla version id: scylla-version + uses: scylladb-actions/get-version@v0.4.5 + with: + source: dockerhub-imagetag + repo: scylladb/scylla + filters: ${{ steps.scylla-filter.outputs.value }} + + - name: Resolve scylla version + id: scylla-version-value run: | - if [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RELEASE" ]]; then - echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT - elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-PRIOR-RELEASE" ]]; then - echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-enterprise-stable:2 | tr -d '\"')" | tee -a $GITHUB_OUTPUT - elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RC" ]]; then - echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-rc | tr -d '\"')" | tee -a $GITHUB_OUTPUT - elif [[ "${{ matrix.scylla-version }}" == "OSS-RELEASE" ]]; then - echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT - elif [[ "${{ matrix.scylla-version }}" == "OSS-PRIOR-RELEASE" ]]; then - echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-oss-stable:2 | tr -d '\"')" | tee -a $GITHUB_OUTPUT - elif [[ "${{ matrix.scylla-version }}" == "OSS-RC" ]]; then - echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-rc | tr -d '\"')" | tee -a $GITHUB_OUTPUT - elif echo "${{ matrix.scylla-version }}" | grep -P '^[0-9\.]+'; then # If you want to run specific version do just that - echo "value=${{ matrix.scylla-version }}" | tee -a $GITHUB_OUTPUT - else - echo "Unknown scylla version name `${{ matrix.scylla-version }}`" + value='${{ fromJson(steps.scylla-version.outputs.versions)[0] }}' + if [ -z "$value" ]; then + echo "No Scylla version resolved for ${{ matrix.scylla-version }}" >&2 exit 1 fi + echo "value=$value" | tee -a "$GITHUB_OUTPUT" - name: Pull CCM image from the cache uses: actions/cache/restore@v4 id: pull-image with: path: ~/.ccm/scylla-repository - key: image-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }} + key: image-scylla-${{ runner.os }}-${{ steps.scylla-version-value.outputs.value }} - - name: Download Scylla (${{ steps.scylla-version.outputs.value }}) image + - name: Download Scylla (${{ steps.scylla-version-value.outputs.value }}) image if: steps.pull-image.outputs.cache-hit != 'true' - run: SCYLLA_VERSION="release:${{ steps.scylla-version.outputs.value }}" make download-ccm-scylla-image + run: | + PATH="$HOME/.local/bin:$PATH" SCYLLA_VERSION="release:${{ steps.scylla-version-value.outputs.value }}" make download-ccm-scylla-image - name: Save CCM image cache uses: actions/cache/save@v4 if: steps.pull-image.outputs.cache-hit != 'true' with: path: ~/.ccm/scylla-repository - key: image-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }} + key: image-scylla-${{ runner.os }}-${{ steps.scylla-version-value.outputs.value }} - name: Pull integration test binary uses: actions/cache/restore@v4 @@ -134,9 +150,10 @@ jobs: - name: Prepare environment run: make update-rust-tooling prepare-integration-test - - name: Run integration tests on Scylla ${{ steps.scylla-version.outputs.value }} + - name: Run integration tests on Scylla ${{ steps.scylla-version-value.outputs.value }} id: run-integration-tests - run: SCYLLA_VERSION="release:${{ steps.scylla-version.outputs.value }}" make run-test-integration-scylla + run: | + PATH="$HOME/.local/bin:$PATH" SCYLLA_VERSION="release:${{ steps.scylla-version-value.outputs.value }}" make run-test-integration-scylla - name: Upload test logs uses: actions/upload-artifact@v4 @@ -158,7 +175,7 @@ jobs: strategy: matrix: - cassandra-version: [RELEASE-3.X] + cassandra-version: [3-LATEST] java-version: [8] fail-fast: false @@ -172,45 +189,48 @@ jobs: java-version: ${{ matrix.java-version }} distribution: "adopt" - - name: Setup Python 3 - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - name: Update apt cache run: sudo apt-get update -y - name: Install CCM - run: make install-ccm-if-missing + run: | + PATH="$HOME/.local/bin:$PATH" make install-ccm-if-missing - name: Get cassandra version id: cassandra-version + uses: scylladb-actions/get-version@v0.4.5 + with: + source: github-tag + repo: apache/cassandra + prefix: cassandra- + out-no-prefix: true + github-token: ${{ secrets.GITHUB_TOKEN }} + filters: '^[0-9]+$.^[0-9]+$.^[0-9]+$ and 3.LAST.LAST' + + - name: Resolve cassandra version + id: cassandra-version-value run: | - if [[ "${{ matrix.cassandra-version }}" == "RELEASE-3.X" ]]; then - echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra3-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT - elif [[ "${{ matrix.cassandra-version }}" == "RELEASE-4.X" ]]; then - echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra4-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT - else - echo "Unknown cassandra version name `${{ matrix.cassandra-version }}`" - fi + value=${{ fromJson(steps.cassandra-version.outputs.versions)[0] }} + echo "value=${value#cassandra-}" | tee -a "$GITHUB_OUTPUT" - name: Pull CCM image from the cache uses: actions/cache/restore@v4 id: pull-image with: path: ~/.ccm/repository - key: image-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }} + key: image-cassandra-${{ runner.os }}-${{ steps.cassandra-version-value.outputs.value }} - - name: Download Cassandra (${{ steps.cassandra-version.outputs.value }}) image + - name: Download Cassandra (${{ steps.cassandra-version-value.outputs.value }}) image if: steps.pull-image.outputs.cache-hit != 'true' - run: CASSANDRA_VERSION="${{ steps.cassandra-version.outputs.value }}" make download-ccm-cassandra-image + run: | + PATH="$HOME/.local/bin:$PATH" CASSANDRA_VERSION="${{ steps.cassandra-version-value.outputs.value }}" make download-ccm-cassandra-image - name: Save CCM image cache uses: actions/cache/save@v4 if: steps.pull-image.outputs.cache-hit != 'true' with: path: ~/.ccm/repository - key: image-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }} + key: image-cassandra-${{ runner.os }}-${{ steps.cassandra-version-value.outputs.value }} - name: Pull integration test binary uses: actions/cache/restore@v4 @@ -227,9 +247,10 @@ jobs: - name: Prepare environment run: make update-rust-tooling prepare-integration-test - - name: Run integration tests on Cassandra ${{ steps.cassandra-version.outputs.value }} + - name: Run integration tests on Cassandra ${{ steps.cassandra-version-value.outputs.value }} id: run-integration-tests - run: CASSANDRA_VERSION="${{ steps.cassandra-version.outputs.value }}" make run-test-integration-cassandra + run: | + PATH="$HOME/.local/bin:$PATH" CASSANDRA_VERSION="${{ steps.cassandra-version-value.outputs.value }}" make run-test-integration-cassandra - name: Upload test logs uses: actions/upload-artifact@v4 diff --git a/Makefile b/Makefile index a9b3532a..44d6b8d9 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,14 @@ SHELL := bash ifeq ($(OS),Windows_NT) SHELL := pwsh.exe .SHELLFLAGS := -NoProfile -Command $$ErrorActionPreference = 'Stop'; +else + # Prefer the repo-local CCM shim, which can execute the cloned upstream tree + # and still fall back to a user-installed console script when present. + export PATH := $(HOME)/.local/bin:$(CURDIR)/ci:$(PATH) + CCM_SOURCE_DIR ?= $(HOME)/.ccm/scylla-ccm + export CCM_SOURCE_DIR + CCM_BIN ?= $(CURDIR)/ci/ccm + export CCM_BIN endif UNAME_S := $(shell uname -s) @@ -176,6 +184,10 @@ ifndef CCM_COMMIT_ID export CCM_COMMIT_ID := master endif +ifndef CCM_PIP_DEPENDENCIES + CCM_PIP_DEPENDENCIES := ruamel-yaml psutil requests packaging boto3 tqdm urllib3 +endif + ifndef SCYLLA_VERSION SCYLLA_VERSION := release:2025.3 endif @@ -242,13 +254,19 @@ install-clang-format-if-missing: update-apt-cache-if-needed ) install-ccm-if-missing: - @ccm list >/dev/null 2>&1 || ( + @$(CCM_BIN) list >/dev/null 2>&1 || ( echo "CCM not found in the system, install it." - pip3 install --user https://github.com/scylladb/scylla-ccm/archive/${CCM_COMMIT_ID}.zip + mkdir -p "$(dir $(CCM_SOURCE_DIR))" && \ + rm -rf "$(CCM_SOURCE_DIR)" && \ + git clone --depth 1 --branch "${CCM_COMMIT_ID}" https://github.com/scylladb/scylla-ccm.git "$(CCM_SOURCE_DIR)" && \ + python3 -m pip install --user ${CCM_PIP_DEPENDENCIES} ) install-ccm: - @pip3 install --user https://github.com/scylladb/scylla-ccm/archive/${CCM_COMMIT_ID}.zip + @mkdir -p "$(dir $(CCM_SOURCE_DIR))" && \ + rm -rf "$(CCM_SOURCE_DIR)" && \ + git clone --depth 1 --branch "${CCM_COMMIT_ID}" https://github.com/scylladb/scylla-ccm.git "$(CCM_SOURCE_DIR)" && \ + python3 -m pip install --user ${CCM_PIP_DEPENDENCIES} install-java8-if-missing: @dpkg -l openjdk-8-jre >/dev/null 2>&1 && exit 0 @@ -431,14 +449,14 @@ download-ccm-scylla-image: install-ccm-if-missing @echo "Downloading scylla ${SCYLLA_VERSION} CCM image" @rm -rf /tmp/download-scylla.ccm || true @mkdir /tmp/download-scylla.ccm || true - @ccm create ccm_1 -i 127.0.1. -n 3:0 -v "${SCYLLA_VERSION}" --scylla --config-dir=/tmp/download-scylla.ccm + @$(CCM_BIN) create ccm_1 -i 127.0.1. -n 3:0 -v "${SCYLLA_VERSION}" --scylla --config-dir=/tmp/download-scylla.ccm @rm -rf /tmp/download-scylla.ccm download-ccm-cassandra-image: install-ccm-if-missing @echo "Downloading cassandra ${CASSANDRA_VERSION} CCM image" @rm -rf /tmp/download-cassandra.ccm || true @mkdir /tmp/download-cassandra.ccm || true - @ccm create ccm_1 -i 127.0.1. -n 3:0 -v "${CASSANDRA_VERSION}" --config-dir=/tmp/download-cassandra.ccm + @$(CCM_BIN) create ccm_1 -i 127.0.1. -n 3:0 -v "${CASSANDRA_VERSION}" --config-dir=/tmp/download-cassandra.ccm @rm -rf /tmp/download-cassandra.ccm run-test-integration-scylla: .prepare-environment-update-aio-max-nr diff --git a/ci/ccm b/ci/ccm new file mode 100755 index 00000000..fbc66218 --- /dev/null +++ b/ci/ccm @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -euo pipefail + +source_ccm="${CCM_SOURCE_DIR:-$HOME/.ccm/scylla-ccm}" +if [ -n "$source_ccm" ] && [ -f "$source_ccm/ccm" ]; then + export PYTHONPATH="$source_ccm${PYTHONPATH:+:$PYTHONPATH}" + exec python3 "$source_ccm/ccm" "$@" +fi + +user_ccm="$(python3 -m site --user-base)/bin/ccm" +if [ -f "$user_ccm" ]; then + exec python3 "$user_ccm" "$@" +fi + +user_site="$(python3 -m site --user-site)" +if [ -n "${PYTHONPATH:-}" ]; then + export PYTHONPATH="${user_site}:${PYTHONPATH}" +else + export PYTHONPATH="${user_site}" +fi + +exec python3 -c 'from ccmlib.bin import main; main()' "$@" diff --git a/ci/version_fetch.py b/ci/version_fetch.py deleted file mode 100644 index 81bfcc19..00000000 --- a/ci/version_fetch.py +++ /dev/null @@ -1,212 +0,0 @@ -#!/usr/bin/python3 - -""" -This Python script allows you to list the -latest version numbers of Scylla and Cassandra. -You can specify whether you want the -versions of Scylla OSS or Scylla Enterprise, -either N latest stable X.Y.latest or -all non-obsolete RCs. You can also fetch -the latest version of Cassandra 3. -How are those versions fetched? We use Docker Hub -tags API. -""" - -import requests -import argparse -import re -import json -import sys - -DOCKER_HUB_TAGS_ENDPOINT = 'https://hub.docker.com/v2/namespaces/%s/repositories/%s/tags?page_size=1000' -DOCKER_HUB_SCYLLA_NAMESPACE = 'scylladb' - -SCYLLA_OSS = (DOCKER_HUB_SCYLLA_NAMESPACE, 'scylla') -SCYLLA_ENTERPRISE = (DOCKER_HUB_SCYLLA_NAMESPACE, 'scylla-enterprise') - -CASSANDRA_ENDPOINT = 'https://dlcdn.apache.org/cassandra/' -CASSANDRA_REGEX = re.compile(r'a href="([0-9])\.(\d+)\.(\d+)/"') - -VERSION_DEFINITION_RE = re.compile( - r'((?:(scylla-oss-stable):(\d+))|(?:(scylla-enterprise-stable)(:\d+)?)|(?:(cassandra3-stable)(:\d+)?)|(?:(cassandra4-stable)(:\d+)?)|(?:(scylla-oss-rc)(:\d+)?)|(?:(scylla-enterprise-rc)(:\d+)?))') -ONLY_DIGITS_RE = re.compile("^[0-9]+") - -class Version: - raw = "" - invalid = False - major = 0 - minor = 0 - minor_raw = "" - minor_rest = "" - patch = 0 - patch_raw = "" - patch_rest = "" - is_dev = False - - def __init__(self, ver): - self.raw = ver - chunks = ver.split(".", maxsplit=3) - if len(chunks) < 3: - self.invalid = True - return - - self.major, self.minor_raw, self.patch_raw = chunks - - try: - self.major = int(self.major) - except Exception: - self.invalid = True - return - - digits = ONLY_DIGITS_RE.match(self.minor_raw) - if digits: - try: - self.minor = int(self.minor_raw[digits.regs[0][0]:digits.regs[0][1]]) - self.minor_rest = self.minor_raw[digits.regs[0][1]:] - if self.minor_rest: - self.is_dev = True - except Exception: - self.invalid = True - else: - self.minor = 0 - - digits = ONLY_DIGITS_RE.match(self.patch_raw) - if digits: - try: - self.patch = int(self.patch_raw[digits.regs[0][0]:digits.regs[0][1]]) - self.patch_rest = self.patch_raw[digits.regs[0][1]:] - if self.patch_rest: - self.is_dev = True - except Exception: - self.invalid = True - else: - self.patch = 0 - - def __str__(self): - return self.raw - - def __repr__(self): - return self.raw - - def __lt__(self, other): - if self.major != other.major: - return self.major < other.major - if self.minor != other.minor: - return self.minor < other.minor - if self.patch != other.patch: - return self.patch < other.patch - if self.is_dev == other.is_dev: - return self.patch_rest < other.patch_rest - return self.is_dev - - -def fetch_docker_hub_tags(namespace, repository): - tags = [] - - # Fetch all pages of tags for a given repository - current_page_endpoint = DOCKER_HUB_TAGS_ENDPOINT % (namespace, repository) - while True: - # Fetch a page - tags_data = requests.get(current_page_endpoint).json() - - # Extract all tags from the response - tags.extend(map(lambda e: e['name'], tags_data['results'])) - - # Move to the next page if it's needed - if tags_data['next'] is not None: - current_page_endpoint = tags_data['next'] - else: - break - - result = [] - for tag in tags: - try: - ver = Version(tag) - if not ver.patch_raw or ver.invalid: - continue - result.append(ver) - except Exception: - continue - - return reversed(sorted(result)) - -rc_only = lambda x: x.is_dev -release_only = lambda x: not x.is_dev -scylla_oss_only = lambda x: x.major < 2000 -scylla_enterprise_only = lambda x: x.major > 2000 -cassandra_3_only = lambda x: x.major == 3 -cassandra_4_only = lambda x: x.major == 4 - -def filter_versions(all_versions, count, *filters): - result = [] - for ver in filter(lambda ver: all(map(lambda ft: ft(ver), filters)), all_versions): - for existing_ver in result: - if ver.major == existing_ver.major and ver.minor == existing_ver.minor: - break - else: - if len(result) >= count: - return result - result.append(ver) - return result - -def fetch_all_cassandra_versions(): - # Download folder listing for Cassandra download site - data = requests.get(CASSANDRA_ENDPOINT).text - - # Parse only those version numbers which match '3.NUM.NUM' - # into tuple (3, NUM, NUM) - data = CASSANDRA_REGEX.finditer(data) - data = map(lambda e: e.groups(), data) - data = map(lambda e: Version(f"{e[0]}.{e[1]}.{e[2]}"), data) - return reversed(sorted(data)) - - -if __name__ == '__main__': - total_result = [] - - def version_definition_type(arg): - if not VERSION_DEFINITION_RE.match(arg): - raise argparse.ArgumentTypeError(f"invalid version definition `{arg}`") - return arg - - parser = argparse.ArgumentParser(description='Get scylla and cassandra versions.') - parser.add_argument('definitions', metavar='VERSION-DEFINITION', type=version_definition_type, nargs='+', - help='A list of scylla and cassandra version definitions: scylla-oss-stable[:COUNT] | scylla-enterprise-stable[:COUNT] | cassandra3-stable[:COUNT] | cassandra4-stable[:COUNT] | scylla-oss-rc[:COUNT] | scylla-enterprise-rc[:COUNT]') - - parser.add_argument('--version-index', dest='version_index', type=int, default=0, help='print single version only') - - args = parser.parse_args() - - for version_def in args.definitions: - groups = VERSION_DEFINITION_RE.match(version_def).groups() - groups = [g for g in groups if g][1:] - - mode_name = groups[0] - versions_count = int(groups[1].replace(":","")) if len(groups) > 1 else 1 - - result = [] - if mode_name == 'scylla-oss-stable': - result = filter_versions(fetch_docker_hub_tags(*SCYLLA_OSS), versions_count, scylla_oss_only, release_only) - elif mode_name == 'scylla-enterprise-stable': - result = filter_versions(fetch_docker_hub_tags(*SCYLLA_ENTERPRISE), versions_count, scylla_enterprise_only, release_only) - elif mode_name == 'cassandra3-stable': - result = filter_versions(fetch_all_cassandra_versions(), versions_count, cassandra_3_only) - elif mode_name == 'cassandra4-stable': - result = filter_versions(fetch_all_cassandra_versions(), versions_count, cassandra_4_only) - elif mode_name == 'scylla-oss-rc': - result = filter_versions(fetch_docker_hub_tags(*SCYLLA_OSS), versions_count, scylla_oss_only, rc_only) - elif mode_name == 'scylla-enterprise-rc': - result = filter_versions(fetch_docker_hub_tags(*SCYLLA_ENTERPRISE), versions_count, scylla_enterprise_only, rc_only) - - total_result += result - - total_result = [str(k) for k in reversed(sorted(total_result))] - - if args.version_index == 0: - print(json.dumps(list(total_result))) - sys.exit(0) - if len(total_result) < args.version_index: - print("No versions found", file=sys.stderr) - sys.exit(1) - print(json.dumps(total_result[args.version_index-1])) - sys.exit(0) diff --git a/packaging/smoke-test-app/docker-compose.yml b/packaging/smoke-test-app/docker-compose.yml index 34a03630..1e353a5c 100644 --- a/packaging/smoke-test-app/docker-compose.yml +++ b/packaging/smoke-test-app/docker-compose.yml @@ -15,8 +15,9 @@ services: public: ipv4_address: 172.44.0.2 command: | - --rpc-address 172.44.0.2 - --listen-address 172.44.0.2 + --rpc-address 0.0.0.0 + --broadcast-rpc-address 127.0.0.1 + --listen-address 0.0.0.0 --skip-wait-for-gossip-to-settle 0 --ring-delay-ms 0 --smp 2 diff --git a/packaging/smoke-test-app/src/smoke_test.c b/packaging/smoke-test-app/src/smoke_test.c index b3bc8fdc..ea346190 100644 --- a/packaging/smoke-test-app/src/smoke_test.c +++ b/packaging/smoke-test-app/src/smoke_test.c @@ -29,6 +29,7 @@ int main(int argc, char* argv[]) { smoke_status_t result = SMOKE_ERR; cass_cluster_set_contact_points(cluster, contact_point); + cass_cluster_set_connect_timeout(cluster, 120000); connect_future = cass_session_connect(session, cluster); if (cass_future_error_code(connect_future) != CASS_OK) { diff --git a/scylla-rust-wrapper/Cargo.lock b/scylla-rust-wrapper/Cargo.lock index 96d97669..b6b18ad7 100644 --- a/scylla-rust-wrapper/Cargo.lock +++ b/scylla-rust-wrapper/Cargo.lock @@ -259,7 +259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -726,7 +726,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1057,7 +1057,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1086,8 +1086,8 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scylla" -version = "1.5.0" -source = "git+https://github.com/scylladb/scylla-rust-driver.git?rev=v1.5.0#d1a5c373a5fbab95f84635c25c5174480b7d6491" +version = "1.6.0" +source = "git+https://github.com/scylladb/scylla-rust-driver.git?rev=v1.6.0#33517599c1d4fcee899fe4fd40b1bfbd6bcb730e" dependencies = [ "arc-swap", "async-trait", @@ -1113,8 +1113,8 @@ dependencies = [ [[package]] name = "scylla-cql" -version = "1.5.0" -source = "git+https://github.com/scylladb/scylla-rust-driver.git?rev=v1.5.0#d1a5c373a5fbab95f84635c25c5174480b7d6491" +version = "1.6.0" +source = "git+https://github.com/scylladb/scylla-rust-driver.git?rev=v1.6.0#33517599c1d4fcee899fe4fd40b1bfbd6bcb730e" dependencies = [ "byteorder", "bytes", @@ -1132,8 +1132,8 @@ dependencies = [ [[package]] name = "scylla-macros" -version = "1.5.0" -source = "git+https://github.com/scylladb/scylla-rust-driver.git?rev=v1.5.0#d1a5c373a5fbab95f84635c25c5174480b7d6491" +version = "1.6.0" +source = "git+https://github.com/scylladb/scylla-rust-driver.git?rev=v1.6.0#33517599c1d4fcee899fe4fd40b1bfbd6bcb730e" dependencies = [ "darling", "proc-macro2", @@ -1143,8 +1143,8 @@ dependencies = [ [[package]] name = "scylla-proxy" -version = "0.0.5" -source = "git+https://github.com/scylladb/scylla-rust-driver.git?rev=v1.5.0#d1a5c373a5fbab95f84635c25c5174480b7d6491" +version = "0.0.6" +source = "git+https://github.com/scylladb/scylla-rust-driver.git?rev=v1.6.0#33517599c1d4fcee899fe4fd40b1bfbd6bcb730e" dependencies = [ "bigdecimal", "byteorder", @@ -1356,7 +1356,7 @@ dependencies = [ "getrandom 0.4.1", "once_cell", "rustix 1.1.4", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] diff --git a/scylla-rust-wrapper/Cargo.toml b/scylla-rust-wrapper/Cargo.toml index 988f64f2..bd251c79 100644 --- a/scylla-rust-wrapper/Cargo.toml +++ b/scylla-rust-wrapper/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0" rust-version = "1.88" [dependencies] -scylla = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v1.5.0", features = [ +scylla = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v1.6.0", features = [ "openssl-010", "metrics", "unstable-cpp-rs", @@ -38,8 +38,8 @@ bindgen = "0.65" chrono = "0.4.20" [dev-dependencies] -scylla-proxy = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v1.5.0" } -scylla-cql = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v1.5.0" } +scylla-proxy = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v1.6.0" } +scylla-cql = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v1.6.0" } bytes = "1.10.0" itertools = "0.10.3" assert_matches = "1.5.0" diff --git a/tests/src/integration/ccm/bridge.cpp b/tests/src/integration/ccm/bridge.cpp index 037de312..d499681b 100644 --- a/tests/src/integration/ccm/bridge.cpp +++ b/tests/src/integration/ccm/bridge.cpp @@ -20,6 +20,7 @@ #define _CRTDBG_MAP_ALLOC #include #include +#include // Enable memory leak detection for new operator #ifdef _DEBUG @@ -47,6 +48,7 @@ #endif #endif +#include #include #include #include @@ -99,6 +101,33 @@ const std::vector CCM::Bridge::DEFAULT_DSE_WORKLOAD( using namespace CCM; +namespace { + +#ifdef _WIN32 +bool is_executable(const std::string& path) { return _access(path.c_str(), 0) == 0; } +#else +bool is_executable(const std::string& path) { return access(path.c_str(), X_OK) == 0; } +#endif + +std::string resolve_ccm_binary() { + const char* ccm_bin = std::getenv("CCM_BIN"); + if (ccm_bin != NULL && *ccm_bin != '\0') { + return std::string(ccm_bin); + } + + const char* home = std::getenv("HOME"); + if (home != NULL && *home != '\0') { + std::string user_ccm = std::string(home) + "/.local/bin/ccm"; + if (is_executable(user_ccm)) { + return user_ccm; + } + } + + return std::string("ccm"); +} + +} // namespace + CCM::Bridge::Bridge( CassVersion server_version /*= DEFAULT_CASSANDRA_VERSION*/, bool use_git /*= DEFAULT_USE_GIT*/, const std::string& branch_tag /* ""*/, bool use_install_dir /*=DEFAULT_USE_INSTALL_DIR*/, @@ -1368,7 +1397,7 @@ std::string CCM::Bridge::read_libssh2_terminal() { std::string CCM::Bridge::execute_ccm_command(const std::vector& command) { // Create the CCM command std::vector ccm_command; - ccm_command.push_back("ccm"); + ccm_command.push_back(resolve_ccm_binary()); ccm_command.insert(ccm_command.end(), command.begin(), command.end()); LOG(implode(ccm_command)); diff --git a/tests/src/integration/tests/test_exec_profile.cpp b/tests/src/integration/tests/test_exec_profile.cpp index 7967fb77..4dc75dc0 100644 --- a/tests/src/integration/tests/test_exec_profile.cpp +++ b/tests/src/integration/tests/test_exec_profile.cpp @@ -267,9 +267,10 @@ CASSANDRA_INTEGRATION_TEST_F(ExecutionProfileTest, RequestTimeout) { ASSERT_EQ(CASS_OK, result.error_code()); // Execute a batched query with assigned profile (should timeout) - // NOTE: Selects are not allowed in batches but is OK for this test case + // Use a valid batch statement so the timeout path is exercised consistently + // across server versions. Batch batch; - batch.add(statement); + batch.add(insert_); batch.set_execution_profile("request_timeout"); batch.set_sleep_time(10); // Simulate >=10ms latency (well above 1ms timeout) result = session_.execute(batch, false);