-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-4520 Add test-async tox command and automated async testing #1699
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
Changes from all commits
7319bc8
d11fa12
ead5084
7efc181
7b86cb0
af2382d
57bda72
c26dadc
2df5f49
0dcda6a
134ea5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ requires = | |
| envlist = | ||
| # Test using the system Python. | ||
| test, | ||
| # Test async tests using the system Python. | ||
| test-async, | ||
| # Test using the run-tests Evergreen script. | ||
| test-eg, | ||
| # Set up encryption files and services. | ||
|
|
@@ -34,6 +36,7 @@ envlist = | |
|
|
||
| labels = # Use labels and -m instead of -e so that tox -m <label> fails instantly if the label does not exist | ||
| test = test | ||
| test-async = test-async | ||
| test-eg = test-eg | ||
| setup-encryption = setup-encryption | ||
| teardown-encryption = teardown-encryption | ||
|
|
@@ -63,6 +66,14 @@ extras = | |
| test | ||
| commands = | ||
| pytest -v --durations=5 --maxfail=10 {posargs} | ||
| pytest -v --durations=5 --maxfail=10 test/synchronous/ {posargs} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does running pytest twice generate two XML reports? Which one gets uploaded? There should be a way to run both of these in one pytest command, no?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I'm not sure how the XML reports interact. I'll open a follow-up PR with a better solution.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you opened a ticket for this yet? The second XML file overwrites the first and there are actually other problems too. Like any test that relies on
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't, sorry--this slipped past me. I don't know if there is a way to run this all in one command while keeping the existing behavior: we want to run all tests in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem. Opened https://jira.mongodb.org/browse/PYTHON-4558. |
||
|
|
||
| [testenv:test-async] | ||
| description = run base set of async unit tests with no extra functionality | ||
| extras = | ||
| test | ||
| commands = | ||
| pytest -v --durations=5 --maxfail=10 test/asynchronous/ {posargs} | ||
|
|
||
| [testenv:test-eg] | ||
| description = run tests using run-tests.sh Evergreen script | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 to reduce the code duplication for the conversion process, due to the bulk of our tests still using the original
test/__init__.pyand associated helpers. Once we've fully migrated all tests into thetest/asynchronousandtest/synchronousdirectories, we will switch to usingtest.synchronous.<module>again.