You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2024/10/30 09:58:45 UTC
(airflow) branch main updated: Revert "Fix pytest plugin (#43280)" (#43504)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 8911f709fb Revert "Fix pytest plugin (#43280)" (#43504)
8911f709fb is described below
commit 8911f709fb03c0b01bdec9176de5f6b97bd91eaf
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Wed Oct 30 10:58:38 2024 +0100
Revert "Fix pytest plugin (#43280)" (#43504)
This reverts commit c3254a363ff647034272dc5f0a458ccd9b1a9cd4.
---
dev/breeze/src/airflow_breeze/utils/run_tests.py | 5 -
helm_tests/conftest.py | 29 ----
providers/tests/conftest.py | 11 ++
providers/tests/deprecations_ignore.yml | 128 ++++++++++++++++++
task_sdk/tests/conftest.py | 9 ++
tests/conftest.py | 10 ++
tests/deprecations_ignore.yml | 53 ++++++++
tests_common/_internals/forbidden_warnings.py | 161 +++--------------------
8 files changed, 229 insertions(+), 177 deletions(-)
diff --git a/dev/breeze/src/airflow_breeze/utils/run_tests.py b/dev/breeze/src/airflow_breeze/utils/run_tests.py
index bb3eba8816..99763c1196 100644
--- a/dev/breeze/src/airflow_breeze/utils/run_tests.py
+++ b/dev/breeze/src/airflow_breeze/utils/run_tests.py
@@ -31,7 +31,6 @@ from airflow_breeze.utils.virtualenv_utils import create_temp_venv
DOCKER_TESTS_ROOT = AIRFLOW_SOURCES_ROOT / "docker_tests"
DOCKER_TESTS_REQUIREMENTS = DOCKER_TESTS_ROOT / "requirements.txt"
-COMMON_TESTS_PYTEST_PLUGIN = "tests_common.pytest_plugin"
def verify_an_image(
@@ -339,10 +338,6 @@ def generate_args_for_pytest(
"-rfEX",
]
)
- if test_type != HELM_TESTS:
- # Helm tests previously did not make use of the pytest plugin from their conftest file. So do not
- # enable it for those tests with the new mechanism
- args.append(f"-p {COMMON_TESTS_PYTEST_PLUGIN}")
if skip_db_tests:
args.append("--skip-db-tests")
if run_db_tests_only:
diff --git a/helm_tests/conftest.py b/helm_tests/conftest.py
deleted file mode 100644
index 843620e2b2..0000000000
--- a/helm_tests/conftest.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-from __future__ import annotations
-
-import os
-
-import pytest
-
-# Task SDK does not need access to the Airflow database
-os.environ["_AIRFLOW_SKIP_DB_TESTS"] = "true"
-
-
-@pytest.hookimpl(tryfirst=True)
-def pytest_configure(config: pytest.Config) -> None:
- config.inicfg["airflow_deprecations_ignore"] = []
diff --git a/providers/tests/conftest.py b/providers/tests/conftest.py
index 0ba88caf6e..85ffd8f1d9 100644
--- a/providers/tests/conftest.py
+++ b/providers/tests/conftest.py
@@ -17,10 +17,21 @@
from __future__ import annotations
+import pathlib
from unittest import mock
import pytest
+pytest_plugins = "tests_common.pytest_plugin"
+
+
+@pytest.hookimpl(tryfirst=True)
+def pytest_configure(config: pytest.Config) -> None:
+ dep_path = [pathlib.Path(__file__).parent.joinpath("deprecations_ignore.yml")]
+ config.inicfg["airflow_deprecations_ignore"] = (
+ config.inicfg.get("airflow_deprecations_ignore", []) + dep_path # type: ignore[assignment,operator]
+ )
+
@pytest.fixture
def hook_conn(request):
diff --git a/providers/tests/deprecations_ignore.yml b/providers/tests/deprecations_ignore.yml
new file mode 100644
index 0000000000..b5aff3c84e
--- /dev/null
+++ b/providers/tests/deprecations_ignore.yml
@@ -0,0 +1,128 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+---
+
+- providers/tests/amazon/aws/deferrable/hooks/test_base_aws.py::TestAwsBaseAsyncHook::test_get_client_async
+- providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_cluster_status
+- providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_get_cluster_status
+- providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_get_cluster_status_exception
+- providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_pause_cluster
+- providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_resume_cluster
+- providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_resume_cluster_exception
+- providers/tests/amazon/aws/triggers/test_redshift_cluster.py::TestRedshiftClusterTrigger::test_redshift_cluster_sensor_trigger_exception
+- providers/tests/amazon/aws/triggers/test_redshift_cluster.py::TestRedshiftClusterTrigger::test_redshift_cluster_sensor_trigger_resuming_status
+- providers/tests/amazon/aws/triggers/test_redshift_cluster.py::TestRedshiftClusterTrigger::test_redshift_cluster_sensor_trigger_success
+- providers/tests/google/common/auth_backend/test_google_openid.py::TestGoogleOpenID::test_success
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_api_resource_configs
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_api_resource_configs_duplication_warning
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_cancel_queries
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_cancel_query_cancel_completed
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_cancel_query_cancel_timeout
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_cancel_query_jobs_to_cancel
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_get_dataset_tables_list
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_invalid_schema_update_and_write_disposition
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_invalid_schema_update_options
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_invalid_source_format
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_extract
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_load_with_non_csv_as_src_fmt
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_schema_update_options
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_schema_update_options_incorrect
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_sql_dialect
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_sql_dialect_default
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_sql_dialect_legacy_with_query_params
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_sql_dialect_legacy_with_query_params_fails
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_with_arg
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_without_sql_fails
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_table_delete
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookRunWithConfiguration::test_run_with_configuration_location
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithKMS::test_create_external_table_with_kms
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithKMS::test_run_copy_with_kms
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithKMS::test_run_load_with_kms
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithKMS::test_run_query_with_kms
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithLabelsAndDescription::test_create_external_table_description
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithLabelsAndDescription::test_create_external_table_labels
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithLabelsAndDescription::test_run_load_description
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithLabelsAndDescription::test_run_load_labels
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestClusteringInRunJob::test_run_load_default
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestClusteringInRunJob::test_run_load_with_arg
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestClusteringInRunJob::test_run_query_default
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestClusteringInRunJob::test_run_query_with_arg
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestDatasetsOperations::test_patch_dataset
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestTableOperations::test_patch_table
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_load_default
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_load_with_arg
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_query_with_arg
+- providers/tests/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_with_auto_detect
+- providers/tests/google/cloud/hooks/test_gcs.py::TestGCSHook::test_list__error_match_glob_and_invalid_delimiter
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithDefaultProjectIdFromConnection::test_error_operation
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithDefaultProjectIdFromConnection::test_life_science_client_creation
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithDefaultProjectIdFromConnection::test_run_pipeline_immediately_complete
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithDefaultProjectIdFromConnection::test_waiting_operation
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_delegate_to_runtime_error
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_error_operation
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_life_science_client_creation
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_location_path
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_run_pipeline_immediately_complete
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_waiting_operation
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithoutProjectId::test_life_science_client_creation
+- providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithoutProjectId::test_run_pipeline
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_cancel_pipeline_job
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_create_pipeline_job
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_delete_pipeline_job
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_get_pipeline_job
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_list_pipeline_jobs
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_cancel_pipeline_job
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_create_pipeline_job
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_delete_pipeline_job
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_get_pipeline_job
+- providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_list_pipeline_jobs
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcHadoopOperator::test_execute
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcHiveOperator::test_builder
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcHiveOperator::test_execute
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcPigOperator::test_builder
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcPigOperator::test_execute
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcPySparkOperator::test_execute
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcSparkOperator::test_execute
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcSparkSqlOperator::test_builder
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcSparkSqlOperator::test_execute
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcSparkSqlOperator::test_execute_override_project_id
+- providers/tests/google/cloud/operators/test_dataproc.py::TestDataprocClusterScaleOperator::test_execute
+- providers/tests/google/cloud/operators/test_dataproc.py::test_create_cluster_operator_extra_links
+- providers/tests/google/cloud/operators/test_dataproc.py::test_scale_cluster_operator_extra_links
+- providers/tests/google/cloud/operators/test_dataproc.py::test_submit_spark_job_operator_extra_links
+- providers/tests/google/cloud/operators/test_gcs.py::TestGoogleCloudStorageListOperator::test_execute__delimiter
+- providers/tests/google/cloud/operators/test_kubernetes_engine.py::TestGoogleCloudPlatformContainerOperator::test_create_execute_error_body
+- providers/tests/google/cloud/operators/test_life_sciences.py::TestLifeSciencesRunPipelineOperator::test_executes
+- providers/tests/google/cloud/operators/test_life_sciences.py::TestLifeSciencesRunPipelineOperator::test_executes_without_project_id
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_copy_files_into_a_folder
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_last_modified_time
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_more_than_1_wildcard
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_no_prefix
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_no_suffix
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_prefix_and_suffix
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_empty_destination_object
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_with_destination_object
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_with_destination_object_retained_prefix
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_with_replace_flag_false
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_with_replace_flag_false_with_destination_object
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_without_destination_object
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_executes_with_a_delimiter
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_executes_with_delimiter_and_destination_object
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_executes_with_different_delimiter_and_destination_object
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_wc_with_last_modified_time_with_all_true_cond
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_wc_with_last_modified_time_with_one_true_cond
+- providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_wc_with_no_last_modified_time
diff --git a/task_sdk/tests/conftest.py b/task_sdk/tests/conftest.py
index 1c34489e95..ddc7c61656 100644
--- a/task_sdk/tests/conftest.py
+++ b/task_sdk/tests/conftest.py
@@ -18,5 +18,14 @@ from __future__ import annotations
import os
+import pytest
+
+pytest_plugins = "tests_common.pytest_plugin"
+
# Task SDK does not need access to the Airflow database
os.environ["_AIRFLOW_SKIP_DB_TESTS"] = "true"
+
+
+@pytest.hookimpl(tryfirst=True)
+def pytest_configure(config: pytest.Config) -> None:
+ config.inicfg["airflow_deprecations_ignore"] = []
diff --git a/tests/conftest.py b/tests/conftest.py
index e882b73b57..de13fe99c4 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -29,6 +29,8 @@ from tests_common.test_utils.log_handlers import non_pytest_handlers
# unit test mode config is set as early as possible.
assert "airflow" not in sys.modules, "No airflow module can be imported before these lines"
+pytest_plugins = "tests_common.pytest_plugin"
+
# Ignore files that are really test dags to be ignored by pytest
collect_ignore = [
"tests/dags/subdir1/test_ignore_this.py",
@@ -38,6 +40,14 @@ collect_ignore = [
]
+@pytest.hookimpl(tryfirst=True)
+def pytest_configure(config: pytest.Config) -> None:
+ dep_path = [config.rootpath.joinpath("tests", "deprecations_ignore.yml")]
+ config.inicfg["airflow_deprecations_ignore"] = (
+ config.inicfg.get("airflow_deprecations_ignore", []) + dep_path # type: ignore[assignment,operator]
+ )
+
+
@pytest.fixture
def reset_environment():
"""Resets env variables."""
diff --git a/tests/deprecations_ignore.yml b/tests/deprecations_ignore.yml
new file mode 100644
index 0000000000..c3d5ddd8ea
--- /dev/null
+++ b/tests/deprecations_ignore.yml
@@ -0,0 +1,53 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+---
+
+# CLI
+# https://github.com/apache/airflow/issues/39199
+- tests/cli/commands/test_kubernetes_command.py::TestGenerateDagYamlCommand::test_generate_dag_yaml
+
+
+# Core
+- tests/models/test_dagbag.py::TestDagBag::test_load_subdags
+- tests/models/test_mappedoperator.py::test_expand_mapped_task_instance_with_named_index
+- tests/models/test_xcom.py::TestXCom::test_set_serialize_call_old_signature
+
+
+# WWW
+- tests/www/api/experimental/test_dag_runs_endpoint.py::TestDagRunsEndpoint::test_get_dag_runs_success
+- tests/www/api/experimental/test_dag_runs_endpoint.py::TestDagRunsEndpoint::test_get_dag_runs_success_with_capital_state_parameter
+- tests/www/api/experimental/test_dag_runs_endpoint.py::TestDagRunsEndpoint::test_get_dag_runs_success_with_state_no_result
+- tests/www/api/experimental/test_dag_runs_endpoint.py::TestDagRunsEndpoint::test_get_dag_runs_success_with_state_parameter
+- tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_dagrun_status
+- tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_get_dag_code
+- tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_info
+- tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_task_info
+- tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_task_instance_info
+- tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_trigger_dag
+- tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_trigger_dag_for_date
+- tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_create_pool
+- tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_create_pool_with_bad_name
+- tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_delete_default_pool
+- tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_delete_pool
+- tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_delete_pool_non_existing
+- tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_get_pool
+- tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_get_pool_non_existing
+- tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_get_pools
+- tests/www/views/test_views_acl.py::test_success
+- tests/www/views/test_views_rendered.py::test_rendered_task_detail_env_secret
+- tests/www/views/test_views_tasks.py::test_rendered_task_view
+- tests/www/views/test_views_tasks.py::test_views_get
diff --git a/tests_common/_internals/forbidden_warnings.py b/tests_common/_internals/forbidden_warnings.py
index 814773fa49..0b0a11262b 100644
--- a/tests_common/_internals/forbidden_warnings.py
+++ b/tests_common/_internals/forbidden_warnings.py
@@ -17,15 +17,28 @@
from __future__ import annotations
+import os
+from collections.abc import Sequence
+from pathlib import Path
+
import pytest
+import yaml
class ForbiddenWarningsPlugin:
"""Internal plugin for restricting warnings during the tests run."""
node_key: str = "forbidden_warnings_node"
+ deprecations_ignore: Sequence[str | os.PathLike]
def __init__(self, config: pytest.Config, forbidden_warnings: tuple[str, ...]):
+ # Set by a pytest_configure hook in conftest
+ deprecations_ignore = config.inicfg["airflow_deprecations_ignore"]
+ if isinstance(deprecations_ignore, (str, os.PathLike)):
+ self.deprecations_ignore = [deprecations_ignore]
+ else:
+ self.deprecations_ignore = deprecations_ignore
+
excluded_cases = {
# Skip: Integration and System Tests
"tests/integration/",
@@ -36,149 +49,11 @@ class ForbiddenWarningsPlugin:
"tests/dags/",
"tests/dags_corrupted/",
"tests/dags_with_system_exit/",
- # CLI
- # https://github.com/apache/airflow/issues/39199
- "tests/cli/commands/test_kubernetes_command.py::TestGenerateDagYamlCommand::test_generate_dag_yaml",
- # Core
- "tests/models/test_dagbag.py::TestDagBag::test_load_subdags",
- "tests/models/test_mappedoperator.py::test_expand_mapped_task_instance_with_named_index",
- "tests/models/test_xcom.py::TestXCom::test_set_serialize_call_old_signature",
- # WWW
- "tests/www/api/experimental/test_dag_runs_endpoint.py::TestDagRunsEndpoint::test_get_dag_runs_success",
- "tests/www/api/experimental/test_dag_runs_endpoint.py::TestDagRunsEndpoint::test_get_dag_runs_success_with_capital_state_parameter",
- "tests/www/api/experimental/test_dag_runs_endpoint.py::TestDagRunsEndpoint::test_get_dag_runs_success_with_state_no_result",
- "tests/www/api/experimental/test_dag_runs_endpoint.py::TestDagRunsEndpoint::test_get_dag_runs_success_with_state_parameter",
- "tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_dagrun_status",
- "tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_get_dag_code",
- "tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_info",
- "tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_task_info",
- "tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_task_instance_info",
- "tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_trigger_dag",
- "tests/www/api/experimental/test_endpoints.py::TestApiExperimental::test_trigger_dag_for_date",
- "tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_create_pool",
- "tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_create_pool_with_bad_name",
- "tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_delete_default_pool",
- "tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_delete_pool",
- "tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_delete_pool_non_existing",
- "tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_get_pool",
- "tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_get_pool_non_existing",
- "tests/www/api/experimental/test_endpoints.py::TestPoolApiExperimental::test_get_pools",
- "tests/www/views/test_views_acl.py::test_success",
- "tests/www/views/test_views_rendered.py::test_rendered_task_detail_env_secret",
- "tests/www/views/test_views_tasks.py::test_rendered_task_view",
- "tests/www/views/test_views_tasks.py::test_views_get",
- # Providers
- "providers/tests/amazon/aws/deferrable/hooks/test_base_aws.py::TestAwsBaseAsyncHook::test_get_client_async",
- "providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_cluster_status",
- "providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_get_cluster_status"
- "providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_get_cluster_status_exception",
- "providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_pause_cluster",
- "providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_resume_cluster",
- "providers/tests/amazon/aws/deferrable/hooks/test_redshift_cluster.py::TestRedshiftAsyncHook::test_resume_cluster_exception",
- "providers/tests/amazon/aws/triggers/test_redshift_cluster.py::TestRedshiftClusterTrigger::test_redshift_cluster_sensor_trigger_exception",
- "providers/tests/amazon/aws/triggers/test_redshift_cluster.py::TestRedshiftClusterTrigger::test_redshift_cluster_sensor_trigger_resuming_status",
- "providers/tests/amazon/aws/triggers/test_redshift_cluster.py::TestRedshiftClusterTrigger::test_redshift_cluster_sensor_trigger_success",
- "providers/tests/google/common/auth_backend/test_google_openid.py::TestGoogleOpenID::test_success",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_api_resource_configs",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_api_resource_configs_duplication_warning",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_cancel_queries",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_cancel_query_cancel_completed",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_cancel_query_cancel_timeout",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_cancel_query_jobs_to_cancel",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_get_dataset_tables_list",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_invalid_schema_update_and_write_disposition",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_invalid_schema_update_options",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_invalid_source_format",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_extract",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_load_with_non_csv_as_src_fmt",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_schema_update_options",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_schema_update_options_incorrect",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_sql_dialect",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_sql_dialect_default",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_sql_dialect_legacy_with_query_params",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_sql_dialect_legacy_with_query_params_fails",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_with_arg",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_query_without_sql_fails",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookMethods::test_run_table_delete",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryHookRunWithConfiguration::test_run_with_configuration_location",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithKMS::test_create_external_table_with_kms",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithKMS::test_run_copy_with_kms",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithKMS::test_run_load_with_kms",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithKMS::test_run_query_with_kms",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithLabelsAndDescription::test_create_external_table_description",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithLabelsAndDescription::test_create_external_table_labels",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithLabelsAndDescription::test_run_load_description",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestBigQueryWithLabelsAndDescription::test_run_load_labels",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestClusteringInRunJob::test_run_load_default",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestClusteringInRunJob::test_run_load_with_arg",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestClusteringInRunJob::test_run_query_default",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestClusteringInRunJob::test_run_query_with_arg",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestDatasetsOperations::test_patch_dataset",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestTableOperations::test_patch_table",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_load_default",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_load_with_arg",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_query_with_arg",
- "providers/tests/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_with_auto_detect",
- "providers/tests/google/cloud/hooks/test_gcs.py::TestGCSHook::test_list__error_match_glob_and_invalid_delimiter",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithDefaultProjectIdFromConnection::test_error_operation",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithDefaultProjectIdFromConnection::test_life_science_client_creation",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithDefaultProjectIdFromConnection::test_run_pipeline_immediately_complete",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithDefaultProjectIdFromConnection::test_waiting_operation",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_delegate_to_runtime_error",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_error_operation",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_life_science_client_creation",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_location_path",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_run_pipeline_immediately_complete",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithPassedProjectId::test_waiting_operation",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithoutProjectId::test_life_science_client_creation",
- "providers/tests/google/cloud/hooks/test_life_sciences.py::TestLifeSciencesHookWithoutProjectId::test_run_pipeline",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_cancel_pipeline_job",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_create_pipeline_job",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_delete_pipeline_job",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_get_pipeline_job",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithDefaultProjectIdHook::test_list_pipeline_jobs",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_cancel_pipeline_job",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_create_pipeline_job",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_delete_pipeline_job",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_get_pipeline_job",
- "providers/tests/google/cloud/hooks/vertex_ai/test_custom_job.py::TestCustomJobWithoutDefaultProjectIdHook::test_list_pipeline_jobs",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcHadoopOperator::test_execute",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcHiveOperator::test_builder",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcHiveOperator::test_execute",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcPigOperator::test_builder",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcPigOperator::test_execute",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcPySparkOperator::test_execute",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcSparkOperator::test_execute",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcSparkSqlOperator::test_builder",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcSparkSqlOperator::test_execute",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataProcSparkSqlOperator::test_execute_override_project_id",
- "providers/tests/google/cloud/operators/test_dataproc.py::TestDataprocClusterScaleOperator::test_execute",
- "providers/tests/google/cloud/operators/test_dataproc.py::test_create_cluster_operator_extra_links",
- "providers/tests/google/cloud/operators/test_dataproc.py::test_scale_cluster_operator_extra_links",
- "providers/tests/google/cloud/operators/test_dataproc.py::test_submit_spark_job_operator_extra_links",
- "providers/tests/google/cloud/operators/test_gcs.py::TestGoogleCloudStorageListOperator::test_execute__delimiter",
- "providers/tests/google/cloud/operators/test_kubernetes_engine.py::TestGoogleCloudPlatformContainerOperator::test_create_execute_error_body",
- "providers/tests/google/cloud/operators/test_life_sciences.py::TestLifeSciencesRunPipelineOperator::test_executes",
- "providers/tests/google/cloud/operators/test_life_sciences.py::TestLifeSciencesRunPipelineOperator::test_executes_without_project_id",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_copy_files_into_a_folder",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_last_modified_time",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_more_than_1_wildcard",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_no_prefix",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_no_suffix",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_prefix_and_suffix",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_empty_destination_object",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_with_destination_object",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_with_destination_object_retained_prefix",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_with_replace_flag_false",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_with_replace_flag_false_with_destination_object",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_execute_wildcard_without_destination_object",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_executes_with_a_delimiter",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_executes_with_delimiter_and_destination_object",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_executes_with_different_delimiter_and_destination_object",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_wc_with_last_modified_time_with_all_true_cond",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_wc_with_last_modified_time_with_one_true_cond",
- "providers/tests/google/cloud/transfers/test_gcs_to_gcs.py::TestGoogleCloudStorageToCloudStorageOperator::test_wc_with_no_last_modified_time",
}
+ for path in self.deprecations_ignore:
+ path = Path(path).resolve()
+ with path.open() as fp:
+ excluded_cases.update(yaml.safe_load(fp))
self.config = config
self.forbidden_warnings = forbidden_warnings
@@ -263,7 +138,7 @@ class ForbiddenWarningsPlugin:
# we might suggest adding it into the exclusion list
report_message += (
"\n\nIf this is significant change in code base you might add tests cases ids into the "
- "forbidden_warnings.py file, please make sure that you also create "
+ f"{self.deprecations_ignore} file, please make sure that you also create "
"follow up Issue/Task in https://github.com/apache/airflow/issues"
)
terminalreporter.write_line(report_message.rstrip(), red=True)