From df307e0e25e1768b4588923572e9848c172325c6 Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Fri, 22 May 2026 21:16:42 +0800 Subject: [PATCH 1/3] Added 4.0 nightly to CI --- .circleci/config.yml | 9 ++++++-- starter.sh | 41 +++++++++++++++++++++++++---------- tests/static/cluster-4.0.conf | 15 +++++++++++++ tests/static/single-4.0.conf | 14 ++++++++++++ tests/test_transaction.py | 6 ++++- 5 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 tests/static/cluster-4.0.conf create mode 100644 tests/static/single-4.0.conf diff --git a/.circleci/config.yml b/.circleci/config.yml index 2be20e2..4fc73d5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,8 +20,13 @@ workflows: parameters: python_version: ["3.10", "3.11", "3.12"] arangodb_config: ["single", "cluster"] - arangodb_license: ["enterprise"] - arangodb_version: ["3.12"] + arangodb_license: ["enterprise", "enterprise-preview"] + arangodb_version: ["3.12", "4.0-nightly"] + exclude: + - arangodb_license: "enterprise" + arangodb_version: "4.0-nightly" + - arangodb_license: "enterprise-preview" + arangodb_version: "3.12" jobs: lint: diff --git a/starter.sh b/starter.sh index 3eef281..6023995 100755 --- a/starter.sh +++ b/starter.sh @@ -4,12 +4,15 @@ # Useful for testing the python-arango driver against a local ArangoDB setup. # Usage: -# ./starter.sh [single|cluster] [community|enterprise] [version] +# ./starter.sh [single|cluster] [community|enterprise|enterprise-preview] [version] +# ./starter.sh [single|cluster] [image[:tag]] # Example: # ./starter.sh cluster enterprise 3.12.4 +# ./starter.sh single enterprise-preview 4.0-nightly +# ./starter.sh single arangodb/enterprise-preview:4.0-nightly setup="${1:-single}" -license="${2:-community}" +image="${2:-community}" version="${3:-latest}" extra_ports="" @@ -22,24 +25,40 @@ else exit 1 fi -image_name="" -if [ "$license" == "community" ]; then - image_name="arangodb" -elif [ "$license" == "enterprise" ]; then - image_name="enterprise" +image_ref="" +if [[ "$image" == */* ]]; then + if [[ "$image" == *:* ]]; then + image_ref="$image" + if [ "$version" == "latest" ]; then + version="${image##*:}" + fi + else + image_ref="$image:$version" + fi +elif [ "$image" == "community" ]; then + image_ref="arangodb/arangodb:$version" +elif [ "$image" == "enterprise" ]; then + image_ref="arangodb/enterprise:$version" +elif [ "$image" == "enterprise-preview" ]; then + image_ref="arangodb/enterprise-preview:$version" else - echo "Invalid argument. Please provide either 'community' or 'enterprise'." + echo "Invalid argument. Please provide 'community', 'enterprise', 'enterprise-preview', or a full image reference." exit 1 fi if [ "$version" == "latest" ]; then conf_file="${setup}-3.12" -elif [[ "$version" == *.*.* ]]; then - conf_file="${setup}-${version%.*}" +elif [[ "$version" =~ ^([0-9]+\.[0-9]+) ]]; then + conf_file="${setup}-${BASH_REMATCH[1]}" else conf_file="${setup}-${version}" fi +if [ ! -f "tests/static/$conf_file.conf" ]; then + echo "Missing configuration file: tests/static/$conf_file.conf" + exit 1 +fi + docker run -d \ --name arango \ -p 8528:8528 \ @@ -47,7 +66,7 @@ docker run -d \ $extra_ports \ -v "$(pwd)/tests/static/":/tests/static \ -v /tmp:/tmp \ - "arangodb/$image_name:$version" \ + "$image_ref" \ /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq diff --git a/tests/static/cluster-4.0.conf b/tests/static/cluster-4.0.conf new file mode 100644 index 0000000..e84e1dc --- /dev/null +++ b/tests/static/cluster-4.0.conf @@ -0,0 +1,15 @@ +[starter] +mode = cluster +local = true +address = 0.0.0.0 +port = 8528 + +[auth] +jwt-secret = /tests/static/keyfile + +[args] +all.database.password = passwd +all.vector-index = true +all.database.extended-names = true +all.log.api-enabled = true +all.server.options-api = admin diff --git a/tests/static/single-4.0.conf b/tests/static/single-4.0.conf new file mode 100644 index 0000000..23902ab --- /dev/null +++ b/tests/static/single-4.0.conf @@ -0,0 +1,14 @@ +[starter] +mode = single +address = 0.0.0.0 +port = 8528 + +[auth] +jwt-secret = /tests/static/keyfile + +[args] +all.database.password = passwd +all.vector-index = true +all.database.extended-names = true +all.log.api-enabled = true +all.server.options-api = admin diff --git a/tests/test_transaction.py b/tests/test_transaction.py index 1a7363c..1e6972f 100644 --- a/tests/test_transaction.py +++ b/tests/test_transaction.py @@ -1,6 +1,7 @@ import asyncio import pytest +from packaging import version from arangoasync.database import TransactionDatabase from arangoasync.errno import BAD_PARAMETER, FORBIDDEN, TRANSACTION_NOT_FOUND @@ -14,10 +15,13 @@ @pytest.mark.asyncio -async def test_transaction_execute_raw(db, doc_col, docs, skip_tests): +async def test_transaction_execute_raw(db, doc_col, docs, skip_tests, db_version): if "js-transactions" in skip_tests: pytest.skip("Skipping JS transaction tests") + if db_version >= version.parse("4.0"): + pytest.skip("Javascript transactions are no longer supported in ArangoDB 4.0") + # Test a valid JS transaction doc = docs[0] key = doc["_key"] From c1147235a03e47728070cd65615a20db3e454e68 Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Fri, 22 May 2026 21:29:17 +0800 Subject: [PATCH 2/3] Using Python 3.13 for most tests --- .circleci/config.yml | 10 +++++++++- starter.sh | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4fc73d5..153cd2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ workflows: name: Python (<< matrix.python_version >>) - ArangoDB (<< matrix.arangodb_license >>, << matrix.arangodb_version >> << matrix.arangodb_config >>) matrix: parameters: - python_version: ["3.10", "3.11", "3.12"] + python_version: ["3.13"] arangodb_config: ["single", "cluster"] arangodb_license: ["enterprise", "enterprise-preview"] arangodb_version: ["3.12", "4.0-nightly"] @@ -27,6 +27,14 @@ workflows: arangodb_version: "4.0-nightly" - arangodb_license: "enterprise-preview" arangodb_version: "3.12" + - test: + name: Python (<< matrix.python_version >>) - ArangoDB (enterprise, 3.12 cluster) + matrix: + parameters: + python_version: ["3.10", "3.11", "3.12"] + arangodb_config: ["cluster"] + arangodb_license: ["enterprise"] + arangodb_version: ["3.12"] jobs: lint: diff --git a/starter.sh b/starter.sh index 6023995..6ca977c 100755 --- a/starter.sh +++ b/starter.sh @@ -69,6 +69,11 @@ docker run -d \ "$image_ref" \ /bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf" +if [ $? -ne 0 ]; then + echo "ERROR starter failed to start container" + exit 1 +fi + wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq if [ $? -eq 0 ]; then echo "OK starter ready" From aca84902e1e44ff97554b7aef91c30d827bb772f Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Fri, 22 May 2026 21:33:36 +0800 Subject: [PATCH 3/3] Fixing config --- .circleci/config.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 153cd2c..579b3c8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,18 +15,21 @@ workflows: jobs: - lint - test: - name: Python (<< matrix.python_version >>) - ArangoDB (<< matrix.arangodb_license >>, << matrix.arangodb_version >> << matrix.arangodb_config >>) + name: Python (<< matrix.python_version >>) - ArangoDB (enterprise, << matrix.arangodb_version >> << matrix.arangodb_config >>) matrix: parameters: python_version: ["3.13"] arangodb_config: ["single", "cluster"] - arangodb_license: ["enterprise", "enterprise-preview"] - arangodb_version: ["3.12", "4.0-nightly"] - exclude: - - arangodb_license: "enterprise" - arangodb_version: "4.0-nightly" - - arangodb_license: "enterprise-preview" - arangodb_version: "3.12" + arangodb_license: ["enterprise"] + arangodb_version: ["3.12"] + - test: + name: Python (<< matrix.python_version >>) - ArangoDB (enterprise-preview, << matrix.arangodb_version >> << matrix.arangodb_config >>) + matrix: + parameters: + python_version: ["3.13"] + arangodb_config: ["single", "cluster"] + arangodb_license: ["enterprise-preview"] + arangodb_version: ["4.0-nightly"] - test: name: Python (<< matrix.python_version >>) - ArangoDB (enterprise, 3.12 cluster) matrix: