Skip to content

Commit 7b58a50

Browse files
authored
fix(arangodb): tests to pass on ARM CPUs - change default image to 3.11.x where ARM image is published (#479)
- updated arangodb image version which now supports ARM CPUs - skipping test for legacy version on ARM CPU fixes #449 ![Screenshot 2024-03-15 at 11 43 35](https://github.com/testcontainers/testcontainers-python/assets/13573675/9fe5edfc-9a83-44d2-beb5-9c917d41438c)
1 parent c07e99c commit 7b58a50

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

modules/arangodb/testcontainers/arangodb/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ArangoDbContainer(DbContainer):
2626
>>> from testcontainers.arangodb import ArangoDbContainer
2727
>>> from arango import ArangoClient
2828
29-
>>> with ArangoDbContainer("arangodb:3.9.1") as arango:
29+
>>> with ArangoDbContainer("arangodb:3.11.8") as arango:
3030
... client = ArangoClient(hosts=arango.get_connection_url())
3131
...
3232
... # Connect

modules/arangodb/tests/test_arangodb.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
from arango.exceptions import DatabaseCreateError, ServerVersionError
88

99
from testcontainers.arangodb import ArangoDbContainer
10+
import platform
1011

1112
ARANGODB_IMAGE_NAME = "arangodb"
13+
IMAGE_VERSION = "3.11.8"
1214

1315

1416
def arango_test_ops(arango_client, expeced_version, username="root", password=""):
@@ -50,8 +52,7 @@ def test_docker_run_arango():
5052
"""
5153
Test ArangoDB container with default settings.
5254
"""
53-
image_version = "3.9.1"
54-
image = f"{ARANGODB_IMAGE_NAME}:{image_version}"
55+
image = f"{ARANGODB_IMAGE_NAME}:{IMAGE_VERSION}"
5556
arango_root_password = "passwd"
5657

5758
with ArangoDbContainer(image) as arango:
@@ -62,22 +63,22 @@ def test_docker_run_arango():
6263
with pytest.raises(DatabaseCreateError):
6364
sys_db.create_database("test")
6465

65-
arango_test_ops(arango_client=client, expeced_version=image_version, password=arango_root_password)
66+
arango_test_ops(arango_client=client, expeced_version=IMAGE_VERSION, password=arango_root_password)
6667

6768

6869
def test_docker_run_arango_without_auth():
6970
"""
7071
Test ArangoDB container with ARANGO_NO_AUTH var set.
7172
"""
72-
image_version = "3.9.1"
73-
image = f"{ARANGODB_IMAGE_NAME}:{image_version}"
73+
image = f"{ARANGODB_IMAGE_NAME}:{IMAGE_VERSION}"
7474

7575
with ArangoDbContainer(image, arango_no_auth=True) as arango:
7676
client = ArangoClient(hosts=arango.get_connection_url())
7777

78-
arango_test_ops(arango_client=client, expeced_version=image_version, password="")
78+
arango_test_ops(arango_client=client, expeced_version=IMAGE_VERSION, password="")
7979

8080

81+
@pytest.mark.skipif(platform.processor() == "arm", reason="Test does not run on machines with ARM CPU")
8182
def test_docker_run_arango_older_version():
8283
"""
8384
Test ArangoDB container with older tag/version.
@@ -100,8 +101,7 @@ def test_docker_run_arango_random_root_password():
100101
"""
101102
Test ArangoDB container with ARANGO_RANDOM_ROOT_PASSWORD var set.
102103
"""
103-
image_version = "3.9.1"
104-
image = f"{ARANGODB_IMAGE_NAME}:{image_version}"
104+
image = f"{ARANGODB_IMAGE_NAME}:{IMAGE_VERSION}"
105105
arango_root_password = "passwd"
106106

107107
with ArangoDbContainer(image, arango_random_root_password=True) as arango:
@@ -110,4 +110,4 @@ def test_docker_run_arango_random_root_password():
110110
# Test invalid auth (we don't know the password in random mode)
111111
sys_db = client.db("_system", username="root", password=arango_root_password)
112112
with pytest.raises(ServerVersionError):
113-
assert sys_db.version() == image_version
113+
assert sys_db.version() == IMAGE_VERSION

0 commit comments

Comments
 (0)