amoghrajesh commented on code in PR #29929:
URL: https://github.com/apache/airflow/pull/29929#discussion_r1200457473


##########
tests/executors/test_kubernetes_executor.py:
##########
@@ -1162,6 +1166,39 @@ def test_supports_pickling(self):
     def test_supports_sentry(self):
         assert not KubernetesExecutor.supports_sentry
 
+    def test_annotations_for_logging_task_metadata(self):
+        annotations_test = {
+            "dag_id": "dag",
+            "run_id": "run_id",
+            "task_id": "task",
+            "try_number": "1",
+        }
+        with mock.patch.dict(
+            os.environ, {"AIRFLOW__KUBERNETES_EXECUTOR__LOGS_TASK_METADATA": 
"True"}, clear=True
+        ):
+            expected_annotations = {
+                "dag_id": "dag",
+                "run_id": "run_id",
+                "task_id": "task",
+                "try_number": "1",
+            }
+            annotations_actual = 
annotations_for_logging_task_metadata(annotations_test)
+            assert annotations_actual == expected_annotations
+
+    def test_annotations_for_logging_task_metadata_fallback(self):
+        annotations_test = {
+            "dag_id": "dag",
+            "run_id": "run_id",
+            "task_id": "task",
+            "try_number": "1",
+        }
+        with mock.patch.dict(
+            os.environ, {"AIRFLOW__KUBERNETES_EXECUTOR__LOGS_TASK_METADATA": 
"False"}, clear=True
+        ):
+            expected_annotations = "<omitted>"
+            annotations_actual = 
annotations_for_logging_task_metadata(annotations_test)
+            assert annotations_actual == expected_annotations
+

Review Comment:
   These tests seem to work fine in my environment. Not sure how/why these are 
failing in the CI. Any hints @hussein-awala ?
   



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