Move core system tests outside of providers system tests (#39335)
* Move core system tests outside of providers system tests
* Add system tests into apache-airflow documentation toctree
diff --git a/docs/apache-airflow/howto/operator/external_task_sensor.rst b/docs/apache-airflow/howto/operator/external_task_sensor.rst
index f6f53f8..7ddbc4b 100644
--- a/docs/apache-airflow/howto/operator/external_task_sensor.rst
+++ b/docs/apache-airflow/howto/operator/external_task_sensor.rst
@@ -55,7 +55,7 @@
Also for this action you can use sensor in the deferrable mode:
-.. exampleinclude:: /../../tests/system/providers/core/example_external_task_parent_deferrable.py
+.. exampleinclude:: /../../tests/system/core/example_external_task_parent_deferrable.py
:language: python
:dedent: 4
:start-after: [START howto_external_task_async_sensor]
diff --git a/docs/apache-airflow/index.rst b/docs/apache-airflow/index.rst
index 760f31f..2c8c14f 100644
--- a/docs/apache-airflow/index.rst
+++ b/docs/apache-airflow/index.rst
@@ -175,3 +175,10 @@
Database Migrations <migrations-ref>
Database ERD Schema <database-erd-ref>
+
+.. toctree::
+ :hidden:
+ :maxdepth: 1
+ :caption: System tests
+
+ System Tests <_api/tests/system/core/index>
diff --git a/docs/conf.py b/docs/conf.py
index 951b5ba..11560b0 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -57,10 +57,11 @@
# By default (e.g. on RTD), build docs for `airflow` package
PACKAGE_NAME = os.environ.get("AIRFLOW_PACKAGE_NAME", "apache-airflow")
PACKAGE_DIR: pathlib.Path
+SYSTEM_TESTS_DIR: pathlib.Path | None
if PACKAGE_NAME == "apache-airflow":
PACKAGE_DIR = ROOT_DIR / "airflow"
PACKAGE_VERSION = airflow.__version__
- SYSTEM_TESTS_DIR = None
+ SYSTEM_TESTS_DIR = (ROOT_DIR / "tests" / "system" / "core").resolve(strict=True)
elif PACKAGE_NAME.startswith("apache-airflow-providers-"):
from provider_yaml_utils import load_package_data
diff --git a/tests/always/test_example_dags.py b/tests/always/test_example_dags.py
index b52d755..c86ff36 100644
--- a/tests/always/test_example_dags.py
+++ b/tests/always/test_example_dags.py
@@ -75,7 +75,7 @@
def example_not_excluded_dags():
- example_dirs = ["airflow/**/example_dags/example_*.py", "tests/system/providers/**/example_*.py"]
+ example_dirs = ["airflow/**/example_dags/example_*.py", "tests/system/**/example_*.py"]
excluded_providers_folders = get_suspended_providers_folders()
excluded_providers_folders.extend(get_python_excluded_providers_folders())
possible_prefixes = ["airflow/providers/", "tests/system/providers/"]
diff --git a/tests/system/providers/core/__init__.py b/tests/system/core/__init__.py
similarity index 100%
rename from tests/system/providers/core/__init__.py
rename to tests/system/core/__init__.py
diff --git a/tests/system/providers/core/example_external_task_child_deferrable.py b/tests/system/core/example_external_task_child_deferrable.py
similarity index 97%
rename from tests/system/providers/core/example_external_task_child_deferrable.py
rename to tests/system/core/example_external_task_child_deferrable.py
index f75eb4f..9af83b7 100644
--- a/tests/system/providers/core/example_external_task_child_deferrable.py
+++ b/tests/system/core/example_external_task_child_deferrable.py
@@ -28,7 +28,7 @@
catchup=False,
tags=["example", "async", "core"],
) as dag:
- dummy_task = BashOperator(
+ BashOperator(
task_id="child_task",
bash_command="echo 1; sleep 1; echo 2; sleep 2; echo 3; sleep 3",
)
diff --git a/tests/system/providers/core/example_external_task_parent_deferrable.py b/tests/system/core/example_external_task_parent_deferrable.py
similarity index 97%
rename from tests/system/providers/core/example_external_task_parent_deferrable.py
rename to tests/system/core/example_external_task_parent_deferrable.py
index 010286d..8896fdc 100644
--- a/tests/system/providers/core/example_external_task_parent_deferrable.py
+++ b/tests/system/core/example_external_task_parent_deferrable.py
@@ -47,7 +47,7 @@
"success",
"failed",
],
- execution_date="{{execution_date}}",
+ logical_date="{{ logical_date }}",
poke_interval=5,
reset_dag_run=True,
wait_for_completion=True,