-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Fix pytest plugin #43280
base: main
Are you sure you want to change the base?
Fix pytest plugin #43280
Conversation
pytest plugins _cannot_ be installed by a non-top-level conftest file. Now that provider tests are moved to a nested directory we need to plumb the plugin in a different way. The plugin is now provided on the command line for breeze testing commands.
The config files which contain exceptions for forbidden_warnings were set in pytest config in the conftest files. The plugin is now loaded at the top-level and before conftest files are. Move the config into the python module for the plugin itself. There should be no harm in configuring all exceptions for each test type
1163a12
to
c71472e
Compare
Nice. I was wondering why we have warnings (yellow tests) back ... I think too much now happens in helm tests simply |
@potiuk Yes this is to fix what was broken by Ash's changes to the directory structure (described in this comment). Every one of our system tests are currently failing for this reason. I think my fix should solve it, but for some reason all the Helm chart tests are failing as a side-effect and I have ZERO ideas why. I cannot see how they are related... |
Actually, when I run the tests locally on main it also fails. Which is a relief but also frustrating. How is main not more broken in the CI of all other PRs and Canary builds? |
As discussed in slack - and for posterity. This is another teeting problem after #42505 and later #43173. It is the result of accidentally triggering database initialization for xdist (parallel) tests - in your PR by plugin initialization, in main runnnig when BACKEND != none. A solution to that would be to force BACKEND to "none" and _AIRLFOW_SKIP_DB_TESTS to "true" in order to avoid all the DB autouse fixtures. But this is quite tricky as plugins passed with We need to find a better solution - likely use different mechanism of Pytest to do imports - likely https://docs.pytest.org/en/7.1.x/explanation/pythonpath.html or maybe find some other creative ways of loading plugins from common place. Or maybe figure out a better way of sharing common test code. |
cc: @ashb -> maybe you will have some ideas? |
pytest plugins cannot be installed by a non-top-level conftest file. Now that provider tests are moved to a nested directory we need to plumb the plugin in a different way.
The plugin is now provided on the command line for breeze testing commands.
Also the config files which contain exceptions for forbidden_warnings were
set in pytest config in the conftest files. Since the plugin is now loaded at
the top-level and before conftest files are loaded. Move the config into the
python module for the plugin itself. There should be no harm in
configuring all exceptions for each test type. Each discovered test is just checked against the set of exceptions.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.