From 55d24858caa61bcf4886581468349e94cd6a6509 Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Fri, 22 May 2026 21:49:43 +0800 Subject: [PATCH 1/3] Added 4.0 nightly to CI --- .circleci/config.yml | 30 ++++++++++++++++----- starter.sh | 50 ++++++++++++++++++++++++++--------- tests/static/cluster-4.0.conf | 15 +++++++++++ tests/static/single-4.0.conf | 14 ++++++++++ tests/test_transaction.py | 5 +++- 5 files changed, 93 insertions(+), 21 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 112a3f73..579b3c81 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,13 +15,29 @@ 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.10", "3.11", "3.12"] + python_version: ["3.13"] arangodb_config: ["single", "cluster"] 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: + parameters: + python_version: ["3.10", "3.11", "3.12"] + arangodb_config: ["cluster"] + arangodb_license: ["enterprise"] + arangodb_version: ["3.12"] jobs: lint: @@ -34,16 +50,16 @@ jobs: command: pip install .[dev] - run: name: Run black - command: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/ + command: black --check --verbose --diff --color --config=pyproject.toml ./arangoasync ./tests/ - run: name: Run flake8 - command: flake8 ./arango ./tests + command: flake8 ./arangoasync ./tests - run: name: Run isort - command: isort --check ./arango ./tests + command: isort --check ./arangoasync ./tests - run: name: Run mypy - command: mypy ./arango + command: mypy ./arangoasync test: parameters: python_version: @@ -91,7 +107,7 @@ jobs: fi echo "Running pytest with args: ${args[@]}" - pytest --cov=arango --cov-report=html:htmlcov --color=yes --code-highlight=yes "${args[@]}" + pytest --cov=arangoasync --cov-report=html:htmlcov --color=yes --code-highlight=yes "${args[@]}" - store_artifacts: path: htmlcov destination: coverage-report diff --git a/starter.sh b/starter.sh index faf8561f..6ca977c7 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.5 +# ./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:-cluster}" -license="${2:-enterprise}" +setup="${1:-single}" +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,9 +66,14 @@ 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" +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" diff --git a/tests/static/cluster-4.0.conf b/tests/static/cluster-4.0.conf new file mode 100644 index 00000000..e84e1dc1 --- /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 00000000..23902ab3 --- /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 15bf5e6d..db430377 100644 --- a/tests/test_transaction.py +++ b/tests/test_transaction.py @@ -13,10 +13,13 @@ from tests.helpers import extract, generate_db_name -def test_transaction_execute_raw(db, col, docs, skip_tests): +def test_transaction_execute_raw(db, 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 execute raw transaction doc = docs[0] key = doc["_key"] From 4363c4fddf53b5efbdb835c20f24217c47df04f6 Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Fri, 22 May 2026 21:56:21 +0800 Subject: [PATCH 2/3] Fixing path issues --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 579b3c81..7646551e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,16 +50,16 @@ jobs: command: pip install .[dev] - run: name: Run black - command: black --check --verbose --diff --color --config=pyproject.toml ./arangoasync ./tests/ + command: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/ - run: name: Run flake8 - command: flake8 ./arangoasync ./tests + command: flake8 ./arango ./tests - run: name: Run isort - command: isort --check ./arangoasync ./tests + command: isort --check ./arango ./tests - run: name: Run mypy - command: mypy ./arangoasync + command: mypy ./arango test: parameters: python_version: @@ -107,7 +107,7 @@ jobs: fi echo "Running pytest with args: ${args[@]}" - pytest --cov=arangoasync --cov-report=html:htmlcov --color=yes --code-highlight=yes "${args[@]}" + pytest --cov=arango --cov-report=html:htmlcov --color=yes --code-highlight=yes "${args[@]}" - store_artifacts: path: htmlcov destination: coverage-report From 6641f9aac027a97ab23597eadcc174f537355b5f Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Fri, 22 May 2026 22:13:16 +0800 Subject: [PATCH 3/3] Fixing config issues --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7646551e..c28db367 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,7 +102,7 @@ jobs: args+=("--cluster" "--port=8539" "--port=8549") fi - if [ << parameters.arangodb_license >> != "enterprise" ]; then + if [ << parameters.arangodb_license >> != "enterprise" ] && [ << parameters.arangodb_license >> != "enterprise-preview" ]; then args+=("--skip" "enterprise") fi