Skip to content

Commit 0dbe460

Browse files
committed
PYCBC-1644: Update GoCAVES download URL to use arm64
Motivation ========== Recent updates to Jenkins have lead to macos arm tests failing with an OSError. Modification ============ Update test suite logic to download arm64 binary for macos platforms when on an arm64 architecture. Results ======= All tests pass. Change-Id: Ib0c8773ecb9c5df806037cfbb94d43519e53802b Reviewed-on: https://review.couchbase.org/c/couchbase-python-client/+/221171 Tested-by: Build Bot <[email protected]> Reviewed-by: Charles Dixon <[email protected]>
1 parent 7cb8dd4 commit 0dbe460

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tests/environments/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ class CollectionType(IntEnum):
2525
class CouchbaseTestEnvironmentException(Exception):
2626
"""Raised when something with the test environment is incorrect."""
2727

28-
def __init__(self, message=None, **kwargs):
29-
if message and 'message' not in kwargs:
30-
kwargs['message'] = message
31-
super().__init__(**kwargs)
28+
def __init__(self, message=None):
29+
super().__init__(message)
3230

3331
def __repr__(self):
34-
return f"{type(self).__name__}({super().__repr__()})"
32+
return f"{type(self).__name__}({super().__str__()})"
3533

3634
def __str__(self):
3735
return self.__repr__()

tests/mock_server.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,10 @@ def _build_caves_url(self, url):
292292
else:
293293
self._caves_url = f"{url}/{self._caves_version}/gocaves-linux-amd64"
294294
elif sys.platform.startswith('darwin'):
295-
self._caves_url = f"{url}/{self._caves_version}/gocaves-macos"
295+
if platform.machine() == 'arm64':
296+
self._caves_url = f"{url}/{self._caves_version}/gocaves-macos-arm64"
297+
else:
298+
self._caves_url = f"{url}/{self._caves_version}/gocaves-macos"
296299
elif sys.platform.startswith('win32'):
297300
self._caves_url = f"{url}/{self._caves_version}/gocaves-windows.exe"
298301
else:
@@ -303,7 +306,7 @@ def _validate_caves_path(self, caves_path=None):
303306
if sys.platform.startswith('linux'):
304307
caves_path = 'gocaves-linux-arm64' if platform.machine() == 'aarch64' else 'gocaves-linux-amd64'
305308
elif sys.platform.startswith('darwin'):
306-
caves_path = 'gocaves-macos'
309+
caves_path = 'gocaves-macos-arm64' if platform.machine() == 'arm64' else 'gocaves-macos'
307310
elif sys.platform.startswith('win32'):
308311
caves_path = 'gocaves-windows.exe'
309312

0 commit comments

Comments
 (0)