-
Notifications
You must be signed in to change notification settings - Fork 346
Rename test databases when running parallel Tox #680
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #680 +/- ##
=========================================
- Coverage 94.43% 94.34% -0.1%
=========================================
Files 33 33
Lines 1852 1857 +5
Branches 158 160 +2
=========================================
+ Hits 1749 1752 +3
- Misses 78 79 +1
- Partials 25 26 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #680 +/- ##
==========================================
- Coverage 98.06% 97.78% -0.28%
==========================================
Files 32 32
Lines 1862 1899 +37
Branches 147 150 +3
==========================================
+ Hits 1826 1857 +31
- Misses 24 27 +3
- Partials 12 15 +3
Continue to review full report at Codecov.
|
7282d75
to
a6f355b
Compare
To allow other libraries, or projects, to know if Tox is running in parallel mode, add the `TOX_PARALLEL_ENV` environment variable to the list of injected variables. Particularly, this is useful for `pytest-django` to know if Tox is running in parallel mode, to rename test databases [0]. [0] pytest-dev/pytest-django#680
To allow other libraries, or projects, to know if Tox is running in parallel mode, add the `TOX_PARALLEL_ENV` environment variable to the list of injected variables. Particularly, this is useful for `pytest-django` to know if Tox is running in parallel mode, to rename test databases [0]. [0] pytest-dev/pytest-django#680
a6f355b
to
7e02ddf
Compare
To allow other libraries, or projects, to know if Tox is running in parallel mode, add the `TOX_PARALLEL_ENV` environment variable to the list of injected variables. Particularly, this is useful for `pytest-django` to know if Tox is running in parallel mode, to rename test databases [0]. [0] pytest-dev/pytest-django#680
@blueyed updated to avoid removing the previous fixture, and avoided code duplication between the two new fixtures. This now depends on tox-dev/tox#1139 being merged, for the |
To allow other libraries, or projects, to know if Tox is running in parallel mode, add the `TOX_PARALLEL_ENV` environment variable to the list of injected variables. Particularly, this is useful for `pytest-django` to know if Tox is running in parallel mode, to rename test databases [0]. [0] pytest-dev/pytest-django#680
To allow other libraries, or projects, to know if Tox is running in parallel mode, add the `TOX_PARALLEL_ENV` environment variable to the list of injected variables. Particularly, this is useful for `pytest-django` to know if Tox is running in parallel mode, to rename test databases [0]. [0] pytest-dev/pytest-django#680
* Inject TOX_PARALLEL_ENV environment variables To allow other libraries, or projects, to know if Tox is running in parallel mode, add the `TOX_PARALLEL_ENV` environment variable to the list of injected variables. Particularly, this is useful for `pytest-django` to know if Tox is running in parallel mode, to rename test databases [0]. [0] pytest-dev/pytest-django#680 * Use strings (bytestrings in Python 2) in passenv whitelist
tox-dev/tox#1139 was merged for tox, so we can proceed here. |
Please rebase / fix coverage. |
7123ee3
to
bbe5b8b
Compare
5b73d1c
to
0258e25
Compare
When tests are executed using Tox in parallel, modify the test database names, to avoid name collisions between processes. This change renames the existing `django_db_modify_db_settings_xdist_suffix` fixture, to a generic `django_db_modify_db_settings_parallel_suffix` one, in case more scenarios/tools have to be considered in the future. It also handles projects where both `pytest-xdist` and parallel `tox` are being using, generating database names like `test_default_py37-django21_gw0`. Resolves pytest-dev#678.
0258e25
to
3da7437
Compare
@blueyed, rebased and improved coverage! There's only one line without coverage at the moment, which requires the database engine not to be Let me know how you'd like to proceed :) |
@blueyed bump! |
@adamantike |
When tests are executed using Tox in parallel, modify the test database
names, to avoid name collisions between processes.
This change renames the existing
django_db_modify_db_settings_xdist_suffix
fixture, to a genericdjango_db_modify_db_settings_parallel_suffix
one, in case morescenarios/tools have to be considered in the future.
It also handles projects where both
pytest-xdist
and paralleltox
are being using, generating database names like
test_default_py37-django21_gw0
.This change is based on
tox
new parallel mode [0].Resolves #678.
[0] tox-dev/tox#1102