-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 200 errors implementation #3276
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #3276 +/- ##
===========================================
- Coverage 93.17% 93.14% -0.04%
===========================================
Files 66 66
Lines 14339 14358 +19
===========================================
+ Hits 13361 13374 +13
- Misses 978 984 +6 ☔ View full report in Codecov by Sentry. |
f5a7bb6
to
6e31ea8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some high level comments of what may make this a bit simpler. We should be able to drop the empty body requirement after our discussion.
tests/functional/configured_endpoint_urls/test_configured_endpoint_url.py
Outdated
Show resolved
Hide resolved
b08fd43
to
e3f275a
Compare
Co-authored-by: Nate Prewitt <[email protected]>
Co-authored-by: Nate Prewitt <[email protected]>
Co-authored-by: Nate Prewitt <[email protected]>
Co-authored-by: Nate Prewitt <[email protected]>
e3f275a
to
bd5d4ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Have a few minor notes on comments and unit tests. We want to try to be succinct with comments/logging as long messages are often ignored.
def test_500_status_code_set_for_200_response( | ||
operation_model_for_200_error, response_dict_for_200_error | ||
): | ||
handlers._handle_200_error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we aren't invoking private functions outside of their respective modules. Do we have specific cases we're testing in these unit tests that aren't already verified with the functional tests?
def test_500_response_can_be_none(): | ||
# A 500 response can raise an exception, which means the response | ||
# object is None. We need to handle this case. | ||
handlers._retry_200_error(None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, we should always be asserting something in our tests to ensure accidental no-op regressions don't sneak in. If we wanted to validate that None
is a valid, we should be testing what the behavior of the function is when that's passed. In this case, we know it will return None
if it's working as expected.
Read the above comment about testing private functions though before making any changes.
Co-authored-by: Nate Prewitt <[email protected]>
Co-authored-by: Nate Prewitt <[email protected]>
Co-authored-by: Nate Prewitt <[email protected]>
Co-authored-by: Nate Prewitt <[email protected]>
Co-authored-by: Nate Prewitt <[email protected]>
Co-authored-by: Nate Prewitt <[email protected]>
Co-authored-by: Nate Prewitt <[email protected]>
The S3 service may occasionally respond with an HTTP 200 OK status code while including errors in the response body. This PR addresses this handling to ensure accurate error reporting.