-
Notifications
You must be signed in to change notification settings - Fork 211
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
pytest-cov is incompatible with pytest-xdist 3.x due to injection of rsync option #557
Comments
The Azure job "Main prerelease_deps_coverage_64bit_blas" is failing because of an incompatibility between ptest-cov and pytest-xdist 3.0.2, so use ptest-xdist 2.5.0 until the issue pytest-dev/pytest-cov#557 is resolved. [skip cirrus] [skip actions] [skip circle]
The Azure job "Main prerelease_deps_coverage_64bit_blas" is failing because of an incompatibility between pytest-cov and pytest-xdist 3.0.2, so use ptest-xdist 2.5.0 until the issue pytest-dev/pytest-cov#557 is resolved. [skip cirrus] [skip actions] [skip circle]
The Azure job "Main prerelease_deps_coverage_64bit_blas" is failing because of an incompatibility between pytest-cov and pytest-xdist 3.0.2, so use pytest-xdist 2.5.0 until the issue pytest-dev/pytest-cov#557 is resolved. [skip cirrus] [skip actions] [skip circle]
It is coming from `pytest-cov`'s usage of the deprecated `rsyncdir` setting use. This patch can be reverted once pytest-dev/pytest-cov#558 is in and released. Ref: pytest-dev/pytest-cov#557
There were two categories of warnings being displayed, those related to the xdist plugin, and those related to SQLAlchemy 2.0 migration. The xdist plugin warnings are due to a bug in pytest-cov, see: pytest-dev/pytest-cov#557 We just ignore them entirely for now, as that issue seems to be quiet. The SQLAlchemy 2.0 migration warnings have 2 sub-categories. The first being that `declarative_base` has moved modules, and that warning is removed by using the proper import. However, once that `declarative_base` warning is removed, one encounters: .../pbench/server/database/models/datasets.py:875: RemovedIn20Warning: "Metadata" object is being merged into a Session along the backref cascade path for relationship "Dataset.metadatas"; in SQLAlchemy 2.0, this reverse cascade will not take place. Set cascade_backrefs to False in either the relationship() or backref() function for the 2.0 behavior; or to set globally for the whole Session, set the future=True flag (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) meta = Metadata(**kwargs) Since we are no going to migrate to SQLAlchemy 2.0 any time soon, it seemed appropriate to just use the big hammer and turn the warnings off entirely.
There were two categories of warnings being displayed, those related to the xdist plugin, and those related to SQLAlchemy 2.0 migration. The xdist plugin warnings are due to a bug in pytest-cov, see: pytest-dev/pytest-cov#557 We just ignore them entirely for now, as that issue seems to be quiet. The SQLAlchemy 2.0 migration warnings have 2 sub-categories. The first being that `declarative_base` has moved modules, and that warning is removed by using the proper import. However, once that `declarative_base` warning is removed, one encounters: .../pbench/server/database/models/datasets.py:875: RemovedIn20Warning: "Metadata" object is being merged into a Session along the backref cascade path for relationship "Dataset.metadatas"; in SQLAlchemy 2.0, this reverse cascade will not take place. Set cascade_backrefs to False in either the relationship() or backref() function for the 2.0 behavior; or to set globally for the whole Session, set the future=True flag (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) meta = Metadata(**kwargs) Since we are no going to migrate to SQLAlchemy 2.0 any time soon, it seemed appropriate to just use the big hammer and turn the warnings off entirely.
There were two categories of warnings being displayed, those related to the xdist plugin, and those related to SQLAlchemy 2.0 migration. The xdist plugin warnings are due to a bug in pytest-cov, see: pytest-dev/pytest-cov#557 We just ignore them entirely for now, as that issue seems to be quiet. The SQLAlchemy 2.0 migration warnings have 2 sub-categories. The first being that `declarative_base` has moved modules, and that warning is removed by using the proper import. However, once that `declarative_base` warning is removed, one encounters: .../pbench/server/database/models/datasets.py:875: RemovedIn20Warning: "Metadata" object is being merged into a Session along the backref cascade path for relationship "Dataset.metadatas"; in SQLAlchemy 2.0, this reverse cascade will not take place. Set cascade_backrefs to False in either the relationship() or backref() function for the 2.0 behavior; or to set globally for the whole Session, set the future=True flag (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) meta = Metadata(**kwargs) Since we are no going to migrate to SQLAlchemy 2.0 any time soon, it seemed appropriate to just use the big hammer and turn the warnings off entirely.
There were two categories of warnings being displayed, those related to the xdist plugin, and those related to SQLAlchemy 2.0 migration. The xdist plugin warnings are due to a bug in pytest-cov, see: pytest-dev/pytest-cov#557 We just ignore them entirely for now, as that issue seems to be quiet. The SQLAlchemy 2.0 migration warnings have 2 sub-categories. The first being that `declarative_base` has moved modules, and that warning is removed by using the proper import. However, once that `declarative_base` warning is removed, one encounters: .../pbench/server/database/models/datasets.py:875: RemovedIn20Warning: "Metadata" object is being merged into a Session along the backref cascade path for relationship "Dataset.metadatas"; in SQLAlchemy 2.0, this reverse cascade will not take place. Set cascade_backrefs to False in either the relationship() or backref() function for the 2.0 behavior; or to set globally for the whole Session, set the future=True flag (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) meta = Metadata(**kwargs) Since we are no going to migrate to SQLAlchemy 2.0 any time soon, it seemed appropriate to just use the big hammer and turn the warnings off entirely.
There were two categories of warnings being displayed, those related to the xdist plugin, and those related to SQLAlchemy 2.0 migration. The xdist plugin warnings are due to a bug in pytest-cov, see: pytest-dev/pytest-cov#557 We just ignore them entirely for now, as that issue seems to be quiet. The SQLAlchemy 2.0 migration warnings have 2 sub-categories. The first being that `declarative_base` has moved modules, and that warning is removed by using the proper import. However, once that `declarative_base` warning is removed, one encounters: .../pbench/server/database/models/datasets.py:875: RemovedIn20Warning: "Metadata" object is being merged into a Session along the backref cascade path for relationship "Dataset.metadatas"; in SQLAlchemy 2.0, this reverse cascade will not take place. Set cascade_backrefs to False in either the relationship() or backref() function for the 2.0 behavior; or to set globally for the whole Session, set the future=True flag (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) meta = Metadata(**kwargs) Since we are no going to migrate to SQLAlchemy 2.0 any time soon, it seemed appropriate to just use the big hammer and turn the warnings off entirely.
There were two categories of warnings being displayed, those related to the xdist plugin, and those related to SQLAlchemy 2.0 migration. The xdist plugin warnings are due to a bug in pytest-cov, see: pytest-dev/pytest-cov#557 We just ignore them entirely for now, as that issue seems to be quiet. The SQLAlchemy 2.0 migration warnings have 2 sub-categories. The first being that `declarative_base` has moved modules, and that warning is removed by using the proper import. However, once that `declarative_base` warning is removed, one encounters: .../pbench/server/database/models/datasets.py:875: RemovedIn20Warning: "Metadata" object is being merged into a Session along the backref cascade path for relationship "Dataset.metadatas"; in SQLAlchemy 2.0, this reverse cascade will not take place. Set cascade_backrefs to False in either the relationship() or backref() function for the 2.0 behavior; or to set globally for the whole Session, set the future=True flag (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) meta = Metadata(**kwargs) Since we are no going to migrate to SQLAlchemy 2.0 any time soon, it seemed appropriate to just use the big hammer and turn the warnings off entirely.
We're still seeing this |
We're also still getting this message. Our workaround was to not use --cov-config and instead pass the env variable
|
Oh damn I worded the changelog incorrectly. There's a feature test in pytest-cov for rsyncdir support. Basically the change allows pytest-cov to continute to work with xdist 4, it doesn't deal with the warning. |
It's strange, because passing this env variable tells coverage to use the file I want... if we use this:
We get this:
This does not make sense, as we don't use rsync at all. Doing this however:
then we can run without issues and no warning. Seems like an issue to me, can you verify please? :) |
Works as expected - because you have specified the config file via pytest-cov and enabled xdist it's being sent over xdist's file sharing mechanism. It may not be what you want but it is what it's implemented. |
I'm a bit confused here 😖 |
@ionelmc Could you help us out here? |
Well I guess there could be another pytest-cov release outright removing the rsync stuff. Don't really have an opinion here. Would that make everyone happy? |
I think so, if the warning is solved I think no one would complain again! |
Use COVERAGE_RCFILE environment variable instead of --cov-config. See pytest-dev/pytest-cov#557.
@ionelmc, unfortunately this solution doesn't work for all: with diofant/diofant@dd326d72ad I got this build failure (problem coming from measuring coverage from sub-processes). While removing the option completely (see skirpichev/pytest-cov@3e96ac3) does work for me, see diofant/diofant#1345 (i.e. no coverage regressions). |
Hi guys, there is still the use case of an explicit coverage file which seems to reply on rsync pytest-cov/src/pytest_cov/engine.py Lines 268 to 272 in 2c9f217
Any plan to allow this w/o using rsync? |
Summary
See pytest-dev/pytest-xdist#825 (comment) which reports a deprecation option related to rsyncdir(s) options. This breaks the builds for anyone that run with warnings-as-errors.
Code
pytest-cov/src/pytest_cov/engine.py
Line 263 in f7fced5
Link to your repository, gist, pastebin or just paste raw code that illustrates the issue.
Solution
We need to stop adding this option on newer versions as it was already deprecated and will be removed on next version of xdist.
The text was updated successfully, but these errors were encountered: