-
Notifications
You must be signed in to change notification settings - Fork 212
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
Refactor integration tests to have no side-effects #3544
Conversation
Co-authored-by: sarayourfriend <[email protected]>
@sarayourfriend I need your help with one thing here. This PR changes
...the following errors come up. I believe this is because once the tests have completed the test runner just exits without cleaning up the tasks threads. The tests still pass, which is great, but I would appreciate if you could take a look into how we can fix these errors. They don't appear when running all the tests with the following command...
...because this gives enough time for the tasks created during the ingestion tests to complete while pytest is running the unit tests. |
…erse into int_test_using_client
@dhruvkb I'm not totally sure, but one thing I'd try first is to use The specific error there about ClientSession is meant to be handled by I'll look more closely at this later today though, see if I can find out anything beyond these guesses. |
Trying this out locally, and noticing something interesting! I always use the Here it is using
|
Fascinating, I didn't think the behaviour with Also, in any case, your PR is really good so we should definitely merge it. |
92ba167
to
d1d370e
Compare
@dhruvkb Should we close this or revisit it? |
It is a net positive, doesn't break CI and I feel the refactoring is quite clean. I would like to revive this. Also @sarayourfriend contributed to this PR so maybe let's factor in what Sara thinks about reviving and possibly merging this? |
I think it's a great change. I don't know how many people rely on passing a filepath directly instead of using |
…t_test_using_client
@dhruvkb Just a heads up that the PR description is still "under construction 🚧" 😅 |
Oops, sorry I missed that in the excitement of undrafting the PR. I've updated the description now. |
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.
Awesome refactor!
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.
This is fantastic!! The way you leveraged a fixture for both media types is really excellent.
Co-authored-by: Madison Swain-Bowden <[email protected]>
Description
This PR refactors the integration tests.
integration/
directory withinapi/tests/
.api_client
instead ofrequests
to speed up tests and also enable mocking/patching.conftest.py
Testing Instructions
A passing CI suite is proof that the changes work, because this PR only affects tests.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin