-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Restore providers' unit tests marked as integration tests #39768
Conversation
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.
Some history: It moved into integration because it have unsupported marker @pytest.mark.backend("mssql")
: #38530, there was no check for unsupported DB Backends at that time.
That not a case anymore, because right now we check for supported backends: mysql
, postgres
, sqlite
All tests which marked as @pytest.mark.backend
also automatically (implicitly) marked as @pytest.mark.db_test
so it never run at non-db environment. Some modules or individual test might be required to be marked with pytest.mark.db_test
, you could check locally in breeze which moved tests required this marker https://github.com/apache/airflow/blob/main/contributing-docs/testing/unit_tests.rst#db-and-non-db-tests
❯ breeze shell --backend none
root@a2b2d941fc72:/opt/airflow# pytest tests --skip-db-tests tests/providers/google/cloud/transfers/test_mssql_to_gcs.py tests/providers/google/cloud/transfers/test_mssql_to_gcs.py tests/providers/apache/hive/transfers/test_mssql_to_hive.py tests/providers/google/cloud/transfers/test_bigquery_to_mssql.py
tests/integration/providers/google/cloud/transfers/test_bigquery_to_mssql.py
Outdated
Show resolved
Hide resolved
I ran the tests with these commands and all ran smoothly. |
Closing to avoid conflicts with #39831 (I implemented the unit tests relocation there) |
As I prepared to implement
mssql
integration tests (#38577), I noticed that existing unit tests had been moved totests/integration
(#38577, #28170), even though they are just pure unit tests. There's nosetup_method
for connection with an external service; everything is nicely mocked, and they run OK on Breeze locally (maybe a bit slow, but that's for another time)...why leave them out? :)This PR relocates the unit tests back to their original directory, and also fixes a path in the
test_project_structure.py
(the original paths for the unit tests above were left in this file as is).Also,
test_bigquery_to_mssql.py
was duplicated in the original path and in the providers' integration tests - I assume that by mistake or as a blueprint for the integration tests, but for now it's better be deleted to avoid confusion.cc: @potiuk, @Taragolis
^ 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.