jykae commented on code in PR #67333:
URL: https://github.com/apache/airflow/pull/67333#discussion_r3308941325


##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/triggers/test_job.py:
##########
@@ -120,6 +120,39 @@ async def test_run_success(self, mock_hook, trigger):
             }
         )
 
+    @pytest.mark.asyncio
+    @mock.patch(f"{TRIGGER_CLASS}.hook")
+    async def test_run_success_emits_pod_info_when_get_logs_false(self, 
mock_hook):
+        """pod_names/pod_namespace must be in the event even with 
get_logs=False.
+
+        The operator's execute_complete needs them to clean up monitoring pods.
+        """
+        trigger_no_logs = KubernetesJobTrigger(
+            job_name=JOB_NAME,
+            job_namespace=NAMESPACE,
+            pod_names=[POD_NAME],
+            pod_namespace=NAMESPACE,
+            base_container_name=CONTAINER_NAME,
+            kubernetes_conn_id=CONN_ID,
+            poll_interval=POLL_INTERVAL,
+            cluster_context=CLUSTER_CONTEXT,
+            config_file=CONFIG_FILE,
+            in_cluster=IN_CLUSTER,
+            get_logs=False,
+            do_xcom_push=XCOM_PUSH,
+        )
+        mock_job = mock.MagicMock()
+        mock_job.metadata.name = JOB_NAME
+        mock_job.metadata.namespace = NAMESPACE

Review Comment:
   fixed 
https://github.com/apache/airflow/pull/67333/commits/d42fd91c5b16ac1d40d530b893576e5b7a11b40a



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