biocore / biocore/microsetta-private-api
Remove connexion version <= 2.7.0 limit after working around mock issue with newer connexion
- Dominant language
- Python
- Stars
- 6
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
As of 07/22/21:
Beware! Connexion has released two new versions in the last 14 days (2.8.0 and 2.9.0) and both are incompatible with the way our microsetta-private-api unit tests (e.g. in test_admin_api.py, test_api.py, and test_integration.py) mock get and post requests. It appears that as of connexion 2.8.0, the connexion authors have introduced a new object called a security handler factory that now handles requests, and it passes down the chain an argument called “required_scopes”. That argument appears to be propagated all the way down to python’s “mock_call” method, in which a call to “mock_verify” fails because it is receiving an unexpected parameter called “required_scopes”. (edited)
This causes every test in the entire microsetta-private-api test suite that mocks a get or post request to fail :man-facepalming::skin-tone-4:. Changing the pip requirements to prevent using a connexion version later than 2.7.0 makes everything pass again.
Dunno if this is a long-term solution, though … but figuring out how to change the mocking to avoid this is beyond me …
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the connexion version constraint and the mocked GET and POST tests in test_admin_api.py, test_api.py, and test_integration.py. Investigate how newer connexion versions pass required_scopes through the security handler factory into the mocks. Done means the version limit can be removed and the microsetta-private-api test suite passes with newer connexion releases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100