Skip to content
Merged
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
22 changes: 19 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -86,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

Expand Down
50 changes: 37 additions & 13 deletions starter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand All @@ -22,34 +25,55 @@ 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 \
-p 8529:8529 \
$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"
Expand Down
15 changes: 15 additions & 0 deletions tests/static/cluster-4.0.conf
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions tests/static/single-4.0.conf
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion tests/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Loading