From 9264adb08cc2a10f40c32ee6ee31d85deb4a7aca Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Fri, 15 Mar 2024 11:35:42 +0100 Subject: [PATCH] Updated anrangodb image version, skip test with old version on ARM CPU More recent image versions support ARM CPUs. --- .../testcontainers/arangodb/__init__.py | 2 +- modules/arangodb/tests/test_arangodb.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/arangodb/testcontainers/arangodb/__init__.py b/modules/arangodb/testcontainers/arangodb/__init__.py index 4977e79e..a7c95465 100644 --- a/modules/arangodb/testcontainers/arangodb/__init__.py +++ b/modules/arangodb/testcontainers/arangodb/__init__.py @@ -26,7 +26,7 @@ class ArangoDbContainer(DbContainer): >>> from testcontainers.arangodb import ArangoDbContainer >>> from arango import ArangoClient - >>> with ArangoDbContainer("arangodb:3.9.1") as arango: + >>> with ArangoDbContainer("arangodb:3.11.8") as arango: ... client = ArangoClient(hosts=arango.get_connection_url()) ... ... # Connect diff --git a/modules/arangodb/tests/test_arangodb.py b/modules/arangodb/tests/test_arangodb.py index 6c06b4ca..f526bf38 100644 --- a/modules/arangodb/tests/test_arangodb.py +++ b/modules/arangodb/tests/test_arangodb.py @@ -7,8 +7,10 @@ from arango.exceptions import DatabaseCreateError, ServerVersionError from testcontainers.arangodb import ArangoDbContainer +import platform ARANGODB_IMAGE_NAME = "arangodb" +IMAGE_VERSION = "3.11.8" def arango_test_ops(arango_client, expeced_version, username="root", password=""): @@ -50,8 +52,7 @@ def test_docker_run_arango(): """ Test ArangoDB container with default settings. """ - image_version = "3.9.1" - image = f"{ARANGODB_IMAGE_NAME}:{image_version}" + image = f"{ARANGODB_IMAGE_NAME}:{IMAGE_VERSION}" arango_root_password = "passwd" with ArangoDbContainer(image) as arango: @@ -62,22 +63,22 @@ def test_docker_run_arango(): with pytest.raises(DatabaseCreateError): sys_db.create_database("test") - arango_test_ops(arango_client=client, expeced_version=image_version, password=arango_root_password) + arango_test_ops(arango_client=client, expeced_version=IMAGE_VERSION, password=arango_root_password) def test_docker_run_arango_without_auth(): """ Test ArangoDB container with ARANGO_NO_AUTH var set. """ - image_version = "3.9.1" - image = f"{ARANGODB_IMAGE_NAME}:{image_version}" + image = f"{ARANGODB_IMAGE_NAME}:{IMAGE_VERSION}" with ArangoDbContainer(image, arango_no_auth=True) as arango: client = ArangoClient(hosts=arango.get_connection_url()) - arango_test_ops(arango_client=client, expeced_version=image_version, password="") + arango_test_ops(arango_client=client, expeced_version=IMAGE_VERSION, password="") +@pytest.mark.skipif(platform.processor() == "arm", reason="Test does not run on machines with ARM CPU") def test_docker_run_arango_older_version(): """ Test ArangoDB container with older tag/version. @@ -100,8 +101,7 @@ def test_docker_run_arango_random_root_password(): """ Test ArangoDB container with ARANGO_RANDOM_ROOT_PASSWORD var set. """ - image_version = "3.9.1" - image = f"{ARANGODB_IMAGE_NAME}:{image_version}" + image = f"{ARANGODB_IMAGE_NAME}:{IMAGE_VERSION}" arango_root_password = "passwd" with ArangoDbContainer(image, arango_random_root_password=True) as arango: @@ -110,4 +110,4 @@ def test_docker_run_arango_random_root_password(): # Test invalid auth (we don't know the password in random mode) sys_db = client.db("_system", username="root", password=arango_root_password) with pytest.raises(ServerVersionError): - assert sys_db.version() == image_version + assert sys_db.version() == IMAGE_VERSION