jason810496 commented on code in PR #68614:
URL: https://github.com/apache/airflow/pull/68614#discussion_r3719254748


##########
airflow-e2e-tests/tests/airflow_e2e_tests/dags/example_dag_test_executor.py:
##########
@@ -0,0 +1,40 @@
+# 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
+from datetime import datetime
+
+from airflow import DAG
+from airflow.providers.standard.operators.empty import EmptyOperator
+
+with DAG(
+    dag_id="example_dag_test_executor",
+    start_date=datetime(2026, 1, 1),
+    schedule=None,
+    catchup=False,
+    tags=["e2e", "dag_test"],
+) as dag:
+    task_start = EmptyOperator(task_id="task_start")
+    task_end = EmptyOperator(task_id="task_end")
+
+    task_start >> task_end
+
+if __name__ == "__main__":
+    use_executor_flag = os.getenv("USE_EXECUTOR", "true").lower() == "true"

Review Comment:
   And perhaps another env flag that decide whether to execute the `dag.test` 
or not. So there will be four permutations.



##########
airflow-e2e-tests/tests/airflow_e2e_tests/basic_tests/test_dag_test_executor.py:
##########
@@ -0,0 +1,39 @@
+# 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 pytest
+
+
+class TestDagTestExecutor:
+    """Verifies that the `dag.test()` functionality executes cleanly via the 
Airflow CLI."""
+
+    @pytest.mark.parametrize("use_executor", ["true", "false"])
+    def test_dag_test_cli_execution(self, compose_instance, use_executor):
+        """
+        Executes the 'airflow dags test' CLI command inside a running service 
container.
+        This provides a true end-to-end integration verification of the 
dag.test engine
+        within a fully initialized environment.
+        """
+        stdout, stderr, exit_code = compose_instance.exec_in_container(
+            service_name="airflow-scheduler",
+            command=["airflow", "dags", "test", "example_dag_test_executor"],

Review Comment:
   We should add another case that exec with `python 
path/to//dags/example_dag_test_executor.py` to really execising the `dag.test` 
SDK.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to