-
Notifications
You must be signed in to change notification settings - Fork 16.3k
pre-commit check for xfail in unit tests #28773
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
|
We still have 1 test that needs to be excluded #23539 as we didnt finish removing xfail everywhere |
|
We also have one xfail marked test which not listed in #23539 airflow/tests/always/test_project_structure.py Lines 377 to 379 in 3eee33a
One of suggestion is remove this kind of tests, see: #28459 (comment) |
|
@frankcash I suggest to add exclusion for the 1-2 remaining tests |
|
@eladkal does this look like adding those files specifically to the exclude file list? |
|
@eladkal ✅ |
|
This is a -0.99 from me. XFail exists for a reason, we can discourage it's use without needing to remove it. See #28840 for where I think an xfail makes sense. |
Yep. I think there are reasons why you might want to have xfail. Some of the other fixes xfails in #23539 were simply mis-used - their reason was "the tests were flaky" but using xfail for the reason of "we know it should fail and we can fix it later" is quite ok. |
|
BTW. it does not mean that the encouragement of getting rid of those xfals is bad idea (if done correctly). |
|
Oh yeah I'm cool with "don't use XFail for flaky tests" etc. |
will resolve #28768
Adds regexp check for
@pytest.mark.xfailin files^tests/.*\.py$^ 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.rstor{issue_number}.significant.rst, in newsfragments.