-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
fix: 941 - respect rate-limits during integration tests #943
Conversation
New files: * `too_many_requests_exception.dart`: Exception when the server returns "Too many requests". * `too_many_requests_manager.dart`: Manager dedicated to "too many requests" server response. Deleted files: * `api_get_to_be_completed_products_test.dart`: moved "searchProduct" code to `api_search_products_test` * `api_get_user_products_test.dart`: moved "searchProduct" code to `api_search_products_test` * `api_matched_product_v2_test.dart`: moved "searchProduct" code to `api_search_products_test` Impacted files: * `api_get_localized_product_test.dart`: now using the `TooManyRequestsManager` for "getProduct" queries * `api_get_product_image_ids_test.dart`: now using the `TooManyRequestsManager` for "getProduct" queries * `api_get_product_test.dart`: moved "searchProduct" code to `api_search_products_test`; now using the `TooManyRequestsManager` for "getProduct" queries * `api_json_to_from_test.dart`: now using the `TooManyRequestsManager` for "getProduct" queries * `api_matched_product_v1_test.dart`: now using the `TooManyRequestsManager` for "getProduct" queries * `api_not_food_get_product_test.dart`: now using the `TooManyRequestsManager` for "getProduct" queries * `api_ocr_ingredients_test.dart`: now using the `TooManyRequestsManager` for "getProduct" queries * `api_search_products_test.dart`: now using the `TooManyRequestsManager` for "searchProducts" queries; moved code there from other test files, gathering all "searchProducts" queries here * `get_locations_order.dart`: unrelated minor improvement * `get_proofs_order.dart`: unrelated minor improvement * `open_food_api_client.dart`: now checking for `TooManyRequestsException`s for "getProduct" and "searchProducts" queries * `openfoodfacts.dart`: added the 2 new files
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #943 +/- ##
==========================================
- Coverage 76.34% 75.44% -0.91%
==========================================
Files 239 248 +9
Lines 8494 9027 +533
==========================================
+ Hits 6485 6810 +325
- Misses 2009 2217 +208 ☔ View full report in Codecov by Sentry. |
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.
LGTM 👌
Really interesting change!
Thank you @g123k for your review! |
What
Fixes bug(s)
Files
New files:
too_many_requests_exception.dart
: Exception when the server returns "Too many requests".too_many_requests_manager.dart
: Manager dedicated to "too many requests" server response.Deleted files:
api_get_to_be_completed_products_test.dart
: moved "searchProduct" code toapi_search_products_test
api_get_user_products_test.dart
: moved "searchProduct" code toapi_search_products_test
api_matched_product_v2_test.dart
: moved "searchProduct" code toapi_search_products_test
Impacted files:
api_get_localized_product_test.dart
: now using theTooManyRequestsManager
for "getProduct" queriesapi_get_product_image_ids_test.dart
: now using theTooManyRequestsManager
for "getProduct" queriesapi_get_product_test.dart
: moved "searchProduct" code toapi_search_products_test
; now using theTooManyRequestsManager
for "getProduct" queriesapi_json_to_from_test.dart
: now using theTooManyRequestsManager
for "getProduct" queriesapi_matched_product_v1_test.dart
: now using theTooManyRequestsManager
for "getProduct" queriesapi_not_food_get_product_test.dart
: now using theTooManyRequestsManager
for "getProduct" queriesapi_ocr_ingredients_test.dart
: now using theTooManyRequestsManager
for "getProduct" queriesapi_search_products_test.dart
: now using theTooManyRequestsManager
for "searchProducts" queries; moved code there from other test files, gathering all "searchProducts" queries hereget_locations_order.dart
: unrelated minor improvementget_proofs_order.dart
: unrelated minor improvementopen_food_api_client.dart
: now checking forTooManyRequestsException
s for "getProduct" and "searchProducts" queriesopenfoodfacts.dart
: added the 2 new files