This is an automated email from the ASF dual-hosted git repository.
amoghdesai 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 d1a4c0c056a Stubbing missing tests for task sdk integration testing
for dagruns (#58036)
d1a4c0c056a is described below
commit d1a4c0c056a6f906867bb4c28aa127f3eeca9667
Author: Amogh Desai <[email protected]>
AuthorDate: Fri Nov 7 19:35:19 2025 +0530
Stubbing missing tests for task sdk integration testing for dagruns (#58036)
---
.../task_sdk_tests/test_dag_run_operations.py | 50 ++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/task-sdk-tests/tests/task_sdk_tests/test_dag_run_operations.py
b/task-sdk-tests/tests/task_sdk_tests/test_dag_run_operations.py
index 900bafa9b5c..b487279a71a 100644
--- a/task-sdk-tests/tests/task_sdk_tests/test_dag_run_operations.py
+++ b/task-sdk-tests/tests/task_sdk_tests/test_dag_run_operations.py
@@ -25,6 +25,8 @@ These tests validate the Execution API endpoints for DAG Run
operations:
from __future__ import annotations
+import pytest
+
from airflow.sdk.api.datamodels._generated import DagRunStateResponse
from airflow.sdk.execution_time.comms import DRCount
from task_sdk_tests import console
@@ -68,3 +70,51 @@ def test_dag_run_get_count(sdk_client, dag_info):
assert isinstance(response, DRCount)
assert response.count >= 1, f"Expected at least 1 DAG run, got
{response.count}"
console.print("[green]✅ DAG run get count test passed!")
+
+
[email protected](reason="TODO: Implement DAG Run get_state (not found) test")
+def test_dag_run_get_state_not_found(sdk_client):
+ """
+ Test getting state for non-existent DAG run.
+
+ Expected: ErrorResponse with DAGRUN_NOT_FOUND error
+ Endpoint: GET /execution/dag-runs/{dag_id}/{run_id}/state
+ """
+ console.print("[yellow]TODO: Implement test_dag_run_get_state_not_found")
+ raise NotImplementedError("test_dag_run_get_state_not_found not
implemented")
+
+
[email protected](reason="TODO: Implement DAG Run get_count (not found) test")
+def test_dag_run_get_count_not_found(sdk_client):
+ """
+ Test getting count for non-existent DAG.
+
+ Expected: DRCount with count=0
+ Endpoint: GET /execution/dag-runs/count
+ """
+ console.print("[yellow]TODO: Implement test_dag_run_get_count_not_found")
+ raise NotImplementedError("test_dag_run_get_count_not_found not
implemented")
+
+
[email protected](reason="TODO: Implement DAG Run get_previous test")
+def test_dag_run_get_previous(sdk_client, dag_info):
+ """
+ Test getting previous DAG run before a logical date.
+
+ Expected: PreviousDagRunResult with dag_run field
+ Endpoint: GET /execution/dag-runs/{dag_id}/previous
+ """
+ console.print("[yellow]TODO: Implement test_dag_run_get_previous")
+ raise NotImplementedError("test_dag_run_get_previous not implemented")
+
+
[email protected](reason="TODO: Implement DAG Run get_previous (not found)
test")
+def test_dag_run_get_previous_not_found(sdk_client):
+ """
+ Test getting previous DAG run for non-existent DAG.
+
+ Expected: ErrorResponse with DAG_NOT_FOUND error
+ Endpoint: GET /execution/dag-runs/{dag_id}/previous
+ """
+ console.print("[yellow]TODO: Implement
test_dag_run_get_previous_not_found")
+ raise NotImplementedError("test_dag_run_get_previous_not_found not
implemented")