-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Make Moto (tests) compatible with flask/werkzeug 2.x #3923
Make Moto (tests) compatible with flask/werkzeug 2.x #3923
Conversation
a263359
to
1a31519
Compare
This reverts commit 8bb0feb.
4ec2fa9
to
b0a5d6c
Compare
Codecov Report
@@ Coverage Diff @@
## master #3923 +/- ##
=======================================
Coverage 94.85% 94.86%
=======================================
Files 454 454
Lines 49275 49312 +37
=======================================
+ Hits 46741 46778 +37
Misses 2534 2534
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This is now part of moto >= 2.0.8.dev3 |
Although a upstream dev got test failures with werkzeug/flask 2.0 [1], all tests, including `managedblockchain` ones, are green on my machine. [1] getmoto/moto#3923 git-svn-id: file:///srv/repos/svn-community/svn@934603 9fca08f4-af9d-4005-b8df-a31f2cc04f65
Although a upstream dev got test failures with werkzeug/flask 2.0 [1], all tests, including `managedblockchain` ones, are green on my machine. [1] getmoto/moto#3923 git-svn-id: file:///srv/repos/svn-community/svn@934603 9fca08f4-af9d-4005-b8df-a31f2cc04f65
Fixes #3921
With this PR, moto will werk with both flask/werkzeug 1.x, and flask/werkzeug 2.x.
Issues encountered while trying to fix this
Problem: CodeCov throws an error for some builds:
{'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
Solution:
Problem:
test_s3_server_post_without_content_length
fails with werkzeug 2.x/flash 1.xSolution: Described in #3921
Problem:
managedblockchain
error handling fails in werkzeug 2.xUnderlying cause:
This service would return XML-errors, when boto3 expects them in JSON format. This would cause boto3 to throw an error saying:
Unable to validate response: <error>Can't find network x</error>
With werkzeug 2.x, some encoding acts differently, and the error returned suddenly looks like:
Unable to validate response: <error>Can"t find network x</error>
This caused the asserts to fail, as the error message no longer matches up.
Solution:
Rewrite all error scenarios to return JSON-formatted errors, and rewrite the tests to assert this is done correctly