Skip to content
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

Remove connexion version <= 2.7.0 limit after working around mock issue with newer connexion #369

Open
AmandaBirmingham opened this issue Aug 18, 2021 · 3 comments

Comments

@AmandaBirmingham
Copy link
Collaborator

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 …

@wasade
Copy link
Member

wasade commented Aug 18, 2021

Thanks, @AmandaBirmingham. I believe this is solved with pinning the connexion version?

@AmandaBirmingham
Copy link
Collaborator Author

AmandaBirmingham commented Aug 18, 2021

@wasade yes, changing the pip requirements to prevent using a connexion version later than 2.7.0 makes everything pass again ... but presumably eventually being stuck on an old version of connexion will itself become a problem, so I'm just recording this for someday

@wasade
Copy link
Member

wasade commented Aug 18, 2021

Makes sense, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants