Skip to content

Commit

Permalink
Move core system tests outside of providers system tests (apache#39335)
Browse files Browse the repository at this point in the history
* Move core system tests outside of providers system tests

* Add system tests into apache-airflow documentation toctree
  • Loading branch information
Taragolis authored and pateash committed May 13, 2024
1 parent fe4d299 commit e921dc3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
7 changes: 7 additions & 0 deletions docs/apache-airflow/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/always/test_example_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e921dc3

Please sign in to comment.