This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-9-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 96224a5f590bc86613316553dffd733c9ebf704e
Author: Andrey Anshin <[email protected]>
AuthorDate: Tue May 7 18:59:21 2024 +0400

    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
    
    (cherry picked from commit e299ac91e2fddc709487aaaa4bb24162f77ba615)
---
 docs/apache-airflow/howto/operator/external_task_sensor.rst        | 2 +-
 docs/apache-airflow/index.rst                                      | 7 +++++++
 docs/conf.py                                                       | 3 ++-
 tests/always/test_example_dags.py                                  | 2 +-
 tests/system/{providers => }/core/__init__.py                      | 0
 .../{providers => }/core/example_external_task_child_deferrable.py | 2 +-
 .../core/example_external_task_parent_deferrable.py                | 2 +-
 7 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/docs/apache-airflow/howto/operator/external_task_sensor.rst 
b/docs/apache-airflow/howto/operator/external_task_sensor.rst
index f6f53f87e5..7ddbc4b241 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 @@ via ``allowed_states`` and ``failed_states`` parameters.
 
 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 760f31fde4..2c8c14f3d2 100644
--- a/docs/apache-airflow/index.rst
+++ b/docs/apache-airflow/index.rst
@@ -175,3 +175,10 @@ so coding will always be required.
 
     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 e959544a09..3b1fd0cb43 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -57,10 +57,11 @@ ROOT_DIR = CONF_DIR.parent
 # 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 9c6ef1be29..8b3bc60faa 100644
--- a/tests/always/test_example_dags.py
+++ b/tests/always/test_example_dags.py
@@ -75,7 +75,7 @@ def get_python_excluded_providers_folders() -> list[str]:
 
 
 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 f75eb4f234..9af83b7699 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 @@ with DAG(
     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 98%
rename from 
tests/system/providers/core/example_external_task_parent_deferrable.py
rename to tests/system/core/example_external_task_parent_deferrable.py
index 010286dfdb..8896fdc1b9 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 @@ with DAG(
             "success",
             "failed",
         ],
-        execution_date="{{execution_date}}",
+        logical_date="{{ logical_date }}",
         poke_interval=5,
         reset_dag_run=True,
         wait_for_completion=True,

Reply via email to