From 0fb9a36890f3eb94286fc0260724fc393b4f0f5b Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 23 Apr 2026 19:24:48 +0800 Subject: [PATCH 1/9] 4.0: /_admin/metrics/v2 endpoint has now been removed --- arangoasync/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arangoasync/database.py b/arangoasync/database.py index 386c036..c00a584 100644 --- a/arangoasync/database.py +++ b/arangoasync/database.py @@ -3004,7 +3004,7 @@ async def metrics(self, server_id: Optional[str] = None) -> Result[str]: ServerMetricsError: If the operation fails. References: - - `metrics-api-v2 `__ + - `metrics-api `__ """ # noqa: E501 params: Params = {} if server_id is not None: @@ -3012,7 +3012,7 @@ async def metrics(self, server_id: Optional[str] = None) -> Result[str]: request = Request( method=Method.GET, - endpoint="/_admin/metrics/v2", + endpoint="/_admin/metrics", params=params, ) From 00ae5df1ec98365a30ff8de766c7c2b7613c980d Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 23 Apr 2026 19:25:49 +0800 Subject: [PATCH 2/9] 4.0: tasks feature is deprecated and removed in ArangoDB v4.0 --- tests/conftest.py | 23 ++++++++++++----------- tests/test_task.py | 6 +++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 5025142..e935a10 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -294,18 +294,19 @@ async def teardown(): verify=False, ) - # Remove all tasks - test_tasks = [ - task - for task in await sys_db.tasks() - if task["name"].startswith("test_task") - ] - await asyncio.gather( - *( - sys_db.delete_task(task["id"], ignore_missing=True) - for task in test_tasks + if global_data.db_version < version.parse("4.0.0"): + # Remove all tasks + test_tasks = [ + task + for task in await sys_db.tasks() + if task["name"].startswith("test_task") + ] + await asyncio.gather( + *( + sys_db.delete_task(task["id"], ignore_missing=True) + for task in test_tasks + ) ) - ) # Remove all test users. tst_users = [ diff --git a/tests/test_task.py b/tests/test_task.py index 008e25d..15739d0 100644 --- a/tests/test_task.py +++ b/tests/test_task.py @@ -1,4 +1,5 @@ import pytest +from packaging import version from arangoasync.exceptions import ( TaskCreateError, @@ -10,10 +11,13 @@ @pytest.mark.asyncio -async def test_task_management(sys_db, bad_db, skip_tests): +async def test_task_management(db_version, sys_db, bad_db, skip_tests): # This test intentionally uses the system database because cleaning up tasks is # easier there. + if db_version >= version.parse("4.0.0"): + pytest.skip("The tasks feature is deprecated and removed in ArangoDB v4.0") + if "task" in skip_tests: pytest.skip("Skipping task tests") From 5e91fc6aa6e67c49e70d35a21d22910b9b5c61fd Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 23 Apr 2026 20:08:36 +0800 Subject: [PATCH 3/9] 4.0: skipping foxx tests in 4.0 --- tests/test_foxx.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_foxx.py b/tests/test_foxx.py index e972dc2..b589611 100644 --- a/tests/test_foxx.py +++ b/tests/test_foxx.py @@ -4,6 +4,7 @@ import aiofiles import aiohttp import pytest +from packaging import version from arangoasync.exceptions import ( FoxxCommitError, @@ -34,7 +35,10 @@ @pytest.mark.asyncio -async def test_foxx(db, bad_db, skip_tests, foxx_path): +async def test_foxx(db_version, db, bad_db, skip_tests, foxx_path): + if db_version >= version.parse("4.0.0"): + pytest.skip("Foxx API has been removed in ArangoDB v4.0") + if "foxx" in skip_tests: pytest.skip("Skipping Foxx tests") From 9f545f488c01f4e0abc78cd3dcda60e9398e6339 Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 23 Apr 2026 20:29:22 +0800 Subject: [PATCH 4/9] 4.0: skipping cluster statistics in 4.0 --- tests/test_cluster.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_cluster.py b/tests/test_cluster.py index 9a68a6b..63e9e96 100644 --- a/tests/test_cluster.py +++ b/tests/test_cluster.py @@ -60,15 +60,17 @@ async def test_cluster( health = await cluster.health() assert "Health" in health - # DB-Server statistics db_server = None for server in health["Health"]: if server.startswith("PRMR"): db_server = server break - assert db_server is not None, f"No DB server found in {health}" - stats = await cluster.statistics(db_server) - assert "enabled" in stats + + if db_version < version.parse("4.0.0"): + # DB-Server statistics + assert db_server is not None, f"No DB server found in {health}" + stats = await cluster.statistics(db_server) + assert "enabled" in stats # Cluster endpoints endpoints = await cluster.endpoints() From cd128344889d27f120bf8e78cf51d0633e858baf Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 23 Apr 2026 20:49:14 +0800 Subject: [PATCH 5/9] 4.0: skipping JS functions --- tests/test_aql.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_aql.py b/tests/test_aql.py index 43f3e34..e1c20f3 100644 --- a/tests/test_aql.py +++ b/tests/test_aql.py @@ -304,7 +304,10 @@ async def test_cache_plan_management(db, bad_db, doc_col, docs, db_version): @pytest.mark.asyncio -async def test_aql_function_management(db, bad_db): +async def test_aql_function_management(db_version, db, bad_db): + if db_version >= version.parse("4.0.0"): + pytest.skip("Javascript is not available in ArangoDB v4.0") + fn_group = "functions::temperature" fn_name_1 = "functions::temperature::celsius_to_fahrenheit" fn_body_1 = "function (celsius) { return celsius * 1.8 + 32; }" From 5817b250f2e765bd5117c7e4ac0e61f2698f24a5 Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 23 Apr 2026 20:59:46 +0800 Subject: [PATCH 6/9] 4.0: adjusted mix methods test --- tests/test_database.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/tests/test_database.py b/tests/test_database.py index d3df0f2..11ac608 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -90,7 +90,7 @@ async def test_database_misc_methods( # Version v = await sys_db.version() - assert v["version"].startswith("3.") + assert isinstance(v["version"], str) with pytest.raises(ServerVersionError): await bad_db.version() @@ -152,19 +152,20 @@ async def test_database_misc_methods( with pytest.raises(ServerShutdownProgressError): await bad_db.shutdown_progress() - with pytest.raises(ServerReloadRoutingError): - await bad_db.reload_routing() - await sys_db.reload_routing() + if db_version < version.parse("4.0.0"): + with pytest.raises(ServerReloadRoutingError): + await bad_db.reload_routing() + await sys_db.reload_routing() - with pytest.raises(ServerEchoError): - await bad_db.echo() - result = await sys_db.echo() - assert isinstance(result, dict) + with pytest.raises(ServerEchoError): + await bad_db.echo() + result = await sys_db.echo() + assert isinstance(result, dict) - with pytest.raises(ServerExecuteError): - await bad_db.execute("return 1") - result = await sys_db.execute("return 1") - assert result == 1 + with pytest.raises(ServerExecuteError): + await bad_db.execute("return 1") + result = await sys_db.execute("return 1") + assert result == 1 with pytest.raises(DatabaseCompactError): await bad_db.compact() @@ -176,10 +177,11 @@ async def test_database_misc_methods( # Custom Request request = Request( - method=Method.POST, endpoint="/_admin/execute", data="return 1".encode("utf-8") + method=Method.GET, + endpoint="/_api/version", ) response = await sys_db.request(request) - assert json.loads(response.raw_body) == 1 + assert "version" in json.loads(response.raw_body) if "enterprise" not in skip_tests and db_version >= version.parse("3.12.0"): # API calls From dc9ca177174db70c499b7ba56238148711d37c2e Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 23 Apr 2026 21:34:39 +0800 Subject: [PATCH 7/9] 4.0: adjusted cluster config --- tests/static/cluster-3.12.conf | 2 +- tests/static/single-3.12.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/static/cluster-3.12.conf b/tests/static/cluster-3.12.conf index 6e325cc..d88831c 100644 --- a/tests/static/cluster-3.12.conf +++ b/tests/static/cluster-3.12.conf @@ -5,7 +5,7 @@ address = 0.0.0.0 port = 8528 [auth] -jwt-secret = /tests/static/keyfile +jwt-secret-keyfile = /tests/static/keyfile [args] all.database.password = passwd diff --git a/tests/static/single-3.12.conf b/tests/static/single-3.12.conf index 28875d2..cb7e01c 100644 --- a/tests/static/single-3.12.conf +++ b/tests/static/single-3.12.conf @@ -4,7 +4,7 @@ address = 0.0.0.0 port = 8528 [auth] -jwt-secret = /tests/static/keyfile +jwt-secret-keyfile = /tests/static/keyfile [args] all.database.password = passwd From 8c4f18d649d72e102affb398f4131c7c176f16a0 Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 23 Apr 2026 21:35:25 +0800 Subject: [PATCH 8/9] 4.0: adjusted documentation examples --- README.md | 2 +- docs/graph.rst | 2 +- docs/overview.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e35c413..8fc7aa8 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ async def main(): # Traverse the graph in outbound direction, breath-first. query = """ FOR v, e, p IN 1..3 OUTBOUND 'students/01' GRAPH 'school' - OPTIONS { bfs: true, uniqueVertices: 'global' } + OPTIONS { order: 'bfs', uniqueVertices: 'global' } RETURN {vertex: v, edge: e, path: p} """ diff --git a/docs/graph.rst b/docs/graph.rst index b2c2467..a1adb6a 100644 --- a/docs/graph.rst +++ b/docs/graph.rst @@ -405,7 +405,7 @@ over edges and vertices using various algorithms. # Traverse 1 to 3 hops from the vertex "teachers/jon", query = """ FOR v, e, p IN 1..3 OUTBOUND 'teachers/jon' GRAPH 'school' - OPTIONS { bfs: true, uniqueVertices: 'global' } + OPTIONS { order: 'bfs', uniqueVertices: 'global' } RETURN {vertex: v, edge: e, path: p} """ diff --git a/docs/overview.rst b/docs/overview.rst index 38ecfd7..7b6b3bb 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -116,7 +116,7 @@ Another example with `graphs`_: # Traverse the graph in outbound direction, breath-first. query = """ FOR v, e, p IN 1..3 OUTBOUND 'students/01' GRAPH 'school' - OPTIONS { bfs: true, uniqueVertices: 'global' } + OPTIONS { order: 'bfs', uniqueVertices: 'global' } RETURN {vertex: v, edge: e, path: p} """ From 64b12230d25282e759275553481ba39704f3bd4b Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 23 Apr 2026 21:49:56 +0800 Subject: [PATCH 9/9] 4.0: using jwt-secrete again --- tests/static/cluster-3.12.conf | 2 +- tests/static/single-3.12.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/static/cluster-3.12.conf b/tests/static/cluster-3.12.conf index d88831c..6e325cc 100644 --- a/tests/static/cluster-3.12.conf +++ b/tests/static/cluster-3.12.conf @@ -5,7 +5,7 @@ address = 0.0.0.0 port = 8528 [auth] -jwt-secret-keyfile = /tests/static/keyfile +jwt-secret = /tests/static/keyfile [args] all.database.password = passwd diff --git a/tests/static/single-3.12.conf b/tests/static/single-3.12.conf index cb7e01c..28875d2 100644 --- a/tests/static/single-3.12.conf +++ b/tests/static/single-3.12.conf @@ -4,7 +4,7 @@ address = 0.0.0.0 port = 8528 [auth] -jwt-secret-keyfile = /tests/static/keyfile +jwt-secret = /tests/static/keyfile [args] all.database.password = passwd