sahilSENPAII commented on code in PR #74890:
URL: https://github.com/apache/airflow/pull/74890#discussion_r4300180523


##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py:
##########
@@ -5099,6 +5099,29 @@ def test_bulk_update_note_only(self, test_client, 
session):
         assert dag_run.note == "bulk note"
         assert dag_run.state == DAG1_RUN1_STATE
 
+    @pytest.mark.usefixtures("configure_git_connection_for_dag_bundle")
+    def test_bulk_update_listener_sees_note_when_note_and_state_both_updated(
+        self, test_client, listener_manager
+    ):
+        listener = ClassBasedListener()
+        listener_manager(listener)
+        response = test_client.patch(
+            self.ENDPOINT_URL,
+            json={
+                "actions": [
+                    {
+                        "action": "update",
+                        "entities": [
+                            {"dag_run_id": DAG1_RUN2_ID, "state": "success", 
"note": "listener_note"}
+                        ],
+                    }
+                ]
+            },
+        )
+        assert response.status_code == 200
+        assert response.json()["update"]["success"] == 
[f"{DAG1_ID}.{DAG1_RUN2_ID}"]
+        assert listener.dag_run_note_at_listener == "listener_note"

Review Comment:
   Thanks for the review.
    Updated the test to cover success/failed, a new note, replacing an old 
note, and an empty note. An empty note clears the note, so the expected value 
there is None instead of "".
   Skipped the None/omitted-note cases since they don't hit patch_dag_run_note, 
so they pass with or without this fix. Can add them if needed.



-- 
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