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 95ece9feef Move Azure examples into system tests (#33727)
95ece9feef is described below
commit 95ece9feefcd1cc4d4b4e94f832d23073200229c
Author: Andrey Anshin <[email protected]>
AuthorDate: Fri Aug 25 21:33:13 2023 +0400
Move Azure examples into system tests (#33727)
---
.../providers/microsoft/azure/example_dag/__init__.py | 16 ----------------
.../operators/batch.rst | 2 +-
.../sensors/wasb_sensors.rst | 4 ++--
.../microsoft/azure}/example_azure_batch_operator.py | 7 +++++--
.../providers/microsoft/azure}/example_wasb_sensors.py | 6 ++++++
5 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/airflow/providers/microsoft/azure/example_dag/__init__.py
b/airflow/providers/microsoft/azure/example_dag/__init__.py
deleted file mode 100644
index 13a83393a9..0000000000
--- a/airflow/providers/microsoft/azure/example_dag/__init__.py
+++ /dev/null
@@ -1,16 +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.
diff --git a/docs/apache-airflow-providers-microsoft-azure/operators/batch.rst
b/docs/apache-airflow-providers-microsoft-azure/operators/batch.rst
index 561a3e9b75..5fa5a3808d 100644
--- a/docs/apache-airflow-providers-microsoft-azure/operators/batch.rst
+++ b/docs/apache-airflow-providers-microsoft-azure/operators/batch.rst
@@ -26,7 +26,7 @@ Use the
Below is an example of using this operator to trigger a task on Azure Batch
-.. exampleinclude::
/../../airflow/providers/microsoft/azure/example_dag/example_azure_batch_operator.py
+.. exampleinclude::
/../../tests/system/providers/microsoft/azure/example_azure_batch_operator.py
:language: python
:dedent: 0
:start-after: [START howto_azure_batch_operator]
diff --git
a/docs/apache-airflow-providers-microsoft-azure/sensors/wasb_sensors.rst
b/docs/apache-airflow-providers-microsoft-azure/sensors/wasb_sensors.rst
index f901928d9b..c01adeab1a 100644
--- a/docs/apache-airflow-providers-microsoft-azure/sensors/wasb_sensors.rst
+++ b/docs/apache-airflow-providers-microsoft-azure/sensors/wasb_sensors.rst
@@ -29,7 +29,7 @@ Wasb Blob Sensor
Waits for a blob to arrive on Azure Blob Storage.
:class:`~airflow.providers.microsoft.azure.sensors.wasb.WasbBlobSensor`
-.. exampleinclude::
/../../airflow/providers/microsoft/azure/example_dag/example_wasb_sensors.py
+.. exampleinclude::
/../../tests/system/providers/microsoft/azure/example_wasb_sensors.py
:language: python
:dedent: 4
:start-after: [START wasb_blob_sensor]
@@ -41,7 +41,7 @@ Wasb Prefix Sensor
Waits for blobs matching a prefix to arrive on Azure Blob Storage.
:class:`~airflow.providers.microsoft.azure.sensors.wasb.WasbPrefixSensor`
-.. exampleinclude::
/../../airflow/providers/microsoft/azure/example_dag/example_wasb_sensors.py
+.. exampleinclude::
/../../tests/system/providers/microsoft/azure/example_wasb_sensors.py
:language: python
:dedent: 4
:start-after: [START wasb_prefix_sensor]
diff --git
a/airflow/providers/microsoft/azure/example_dag/example_azure_batch_operator.py
b/tests/system/providers/microsoft/azure/example_azure_batch_operator.py
similarity index 91%
rename from
airflow/providers/microsoft/azure/example_dag/example_azure_batch_operator.py
rename to tests/system/providers/microsoft/azure/example_azure_batch_operator.py
index 7dc1c68978..435ef05060 100644
---
a/airflow/providers/microsoft/azure/example_dag/example_azure_batch_operator.py
+++ b/tests/system/providers/microsoft/azure/example_azure_batch_operator.py
@@ -22,8 +22,6 @@ This DAG relies on the following OS environment variables
* POOL_ID - The Pool ID in Batch accounts.
"""
-
-
from __future__ import annotations
import os
@@ -56,3 +54,8 @@ with DAG(
target_dedicated_nodes=1,
)
# [END howto_azure_batch_operator]
+
+from tests.system.utils import get_test_run # noqa: E402
+
+# Needed to run the example DAG with pytest (see:
tests/system/README.md#run_via_pytest)
+test_run = get_test_run(dag)
diff --git
a/airflow/providers/microsoft/azure/example_dag/example_wasb_sensors.py
b/tests/system/providers/microsoft/azure/example_wasb_sensors.py
similarity index 91%
rename from
airflow/providers/microsoft/azure/example_dag/example_wasb_sensors.py
rename to tests/system/providers/microsoft/azure/example_wasb_sensors.py
index 8d449e52a1..a0961113f2 100644
--- a/airflow/providers/microsoft/azure/example_dag/example_wasb_sensors.py
+++ b/tests/system/providers/microsoft/azure/example_wasb_sensors.py
@@ -58,3 +58,9 @@ with DAG(
task_id="wasb_sense_prefix",
)
# [END wasb_prefix_sensor]
+
+
+from tests.system.utils import get_test_run # noqa: E402
+
+# Needed to run the example DAG with pytest (see:
tests/system/README.md#run_via_pytest)
+test_run = get_test_run(dag)