Skip to content

Commit 030b2a6

Browse files
committed
Merge branch 'feature/misc-wb-cleanup' into feature/post-buff-worms
Closes #465 [ENG-8558]
2 parents aae81c9 + 17773f3 commit 030b2a6

File tree

6 files changed

+12
-51
lines changed

6 files changed

+12
-51
lines changed

tests/providers/s3/test_provider.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
from http import client
1010
from urllib import parse
1111
from unittest import mock
12-
1312
import pytest
14-
# from boto.compat import BytesIO
15-
# from boto.utils import compute_md5
1613

1714
from waterbutler.providers.s3 import S3Provider
1815
from waterbutler.core.path import WaterButlerPath
@@ -151,8 +148,6 @@ def list_upload_chunks_body(parts_metadata):
151148
</ListPartsResult>
152149
'''
153150

154-
# md5 = compute_md5(BytesIO(payload))
155-
# md5 = compute_md5(payload)
156151
md5 = hashlib.md5(payload)
157152

158153
headers = {
@@ -169,7 +164,10 @@ def build_folder_params(path):
169164

170165
class TestRegionDetection:
171166

172-
@pytest.mark.skip('TODO fix broken s3 provider tests')
167+
@pytest.mark.skip('S3 test suite tests are skipped because many of them are incompatible with the recent '
168+
'migration from the older `boto` library to `boto3`. The underlying mechanisms for request signing'
169+
'and client interaction have changed significantly, breaking the old test logic. The suite '
170+
'needs to be refactored to work properly with the current S3 providers implementation.')
173171
@pytest.mark.asyncio
174172
@pytest.mark.aiohttpretty
175173
@pytest.mark.parametrize("region_name,expected_region", [
@@ -196,23 +194,6 @@ async def test_region_host(self, auth, credentials, settings, region_name, expec
196194
aiohttpretty.register_uri('GET', region_url, status=200, body=location_response(region_name))
197195
await provider._check_region()
198196
assert provider.region == expected_region
199-
# provider = S3Provider(auth, credentials, settings)
200-
# await provider._check_region()
201-
# res = await provider._get_bucket_region()
202-
# # region_url = provider.bucket.generate_url(
203-
# # 100,
204-
# # 'GET',
205-
# # query_parameters={'location': ''},
206-
# # )
207-
# region_url = 'https://s3.amazonaws.com/that-kerning?location=&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=Dont%20dead%2F20250526%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250526T134653Z&X-Amz-Expires=100&X-Amz-SignedHeaders=host&X-Amz-Signature=80f8426c4fc6d0af68bd3e52a553c9e4d838144b9a70600aff507f70056696f1 '
208-
# aiohttpretty.register_uri('GET',
209-
# region_url,
210-
# status=200,
211-
# body=location_response(region_name))
212-
#
213-
# await provider._check_region()
214-
# assert provider.connection.host == host
215-
216197

217198
class TestValidatePath:
218199

tests/tasks/conftest.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,6 @@
1414
logger = logging.getLogger(__name__)
1515

1616

17-
# Task testing doesn't play nice with unittest-style tests, so fallback to regular pytest-style
18-
# setup/teardown.
19-
20-
# def pytest_runtest_setup(item):
21-
# print(f'@@@ pytest setup alpha')
22-
# policy = asyncio.get_event_loop_policy()
23-
# policy.get_event_loop().close()
24-
# event_loop = policy.new_event_loop()
25-
# policy.set_event_loop(event_loop)
26-
# logger.error(f'@@@ pytest setup beta')
27-
28-
29-
# def pytest_runtest_teardown(item):
30-
# logger.error(f'@@@ pytest teardown gamma')
31-
# policy = asyncio.get_event_loop_policy()
32-
# policy.get_event_loop().close()
33-
# logger.error(f'@@@ pytest teardown delta')
34-
35-
3617
# Fixtures for task tests
3718

3819
@pytest.fixture(autouse=True)

tests/utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,6 @@ def tearDown(self):
199199
def get_app(self):
200200
return make_app(debug=False)
201201

202-
# def get_new_ioloop(self):
203-
# loop = asyncio.new_event_loop()
204-
# asyncio.set_event_loop(loop)
205-
# return loop
206-
207202

208203
class MultiProviderHandlerTestCase(HandlerTestCase):
209204

waterbutler/providers/s3/provider.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,14 @@ async def get_s3_bucket_object_location(self):
130130
)
131131
return resp
132132

133-
# Todo: the commented solution may be more stable than not commented
133+
# NOTE: These commented-out blocks are left as a reference to an
134+
# alternative implementation.
135+
# The current active implementation was chosen to maintain unification
136+
# with the generic `make_request` pattern used all over providers (see PR #463 for discussion).
137+
# A trade-off is that the current approach requires using `unquote` on the path to handle xml properly,
138+
# which this paginator-based solution might avoid, however maybe there is more explicit solution without `unquote`
139+
# for 'make_requests' to keep it more explicit.
140+
#
134141
# async def get_folder_metadata(self, path, params):
135142
# try:
136143
# contents, prefixes = [], []

waterbutler/server/api/v0/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class BaseHandler(server_utils.CORsMixin, server_utils.UtilMixin, tornado.web.Re
4646
ACTION_MAP = {} # type: dict
4747

4848
def write_error(self, status_code, exc_info):
49-
# TODO: maybe it is needed to change there too somehow
5049
sentry_sdk.capture_exception(exc_info)
5150
etype, exc, _ = exc_info
5251

waterbutler/server/api/v1/core.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import tornado.web
44
import tornado.gen
55
import tornado.iostream
6-
76
import sentry_sdk
87

98
from waterbutler import tasks
@@ -20,7 +19,6 @@ def as_entry(cls):
2019
return cls.PATTERN, cls
2120

2221
def write_error(self, status_code, exc_info):
23-
# TODO: maybe it is needed to change there too somehow
2422
etype, exc, _ = exc_info
2523

2624
finish_args = []

0 commit comments

Comments
 (0)