Copilot commented on code in PR #66616:
URL: https://github.com/apache/airflow/pull/66616#discussion_r3367134518


##########
chart/tests/helm_tests/otel_collector/test_otel_collector.py:
##########
@@ -400,6 +400,24 @@ def test_service_no_annotations_block_when_unset(self):
         docs = render_chart(values={"otelCollector": {"tracesEnabled": True}}, 
show_only=[SERVICE_TEMPLATE])
         assert "annotations" not in jmespath.search("metadata", docs[0])
 
+    def test_ip_family_policy(self):
+        docs = render_chart(
+            values={
+                "ipFamilyPolicy": "PreferDualStack",
+                "ipFamilies": ["IPv4", "IPv6"],
+            },
+            show_only=[SERVICE_TEMPLATE],
+        )

Review Comment:
   `otel-collector-service.yaml` is only rendered when 
`otelCollector.tracesEnabled` or `otelCollector.metricsEnabled` is true. This 
test does not enable either flag, so `render_chart(..., 
show_only=[SERVICE_TEMPLATE])` will return no docs and `docs[0]` will fail.



##########
chart/tests/helm_tests/otel_collector/test_otel_collector.py:
##########
@@ -400,6 +400,24 @@ def test_service_no_annotations_block_when_unset(self):
         docs = render_chart(values={"otelCollector": {"tracesEnabled": True}}, 
show_only=[SERVICE_TEMPLATE])
         assert "annotations" not in jmespath.search("metadata", docs[0])
 
+    def test_ip_family_policy(self):
+        docs = render_chart(
+            values={
+                "ipFamilyPolicy": "PreferDualStack",
+                "ipFamilies": ["IPv4", "IPv6"],
+            },
+            show_only=[SERVICE_TEMPLATE],
+        )
+
+        assert jmespath.search("spec.ipFamilyPolicy", docs[0]) == 
"PreferDualStack"
+        assert jmespath.search("spec.ipFamilies", docs[0]) == ["IPv4", "IPv6"]
+
+    def test_ip_family_policy_not_set_by_default(self):
+        docs = render_chart(show_only=[SERVICE_TEMPLATE])
+
+        assert jmespath.search("spec.ipFamilyPolicy", docs[0]) is None

Review Comment:
   `otel-collector-service.yaml` is gated behind 
`otelCollector.tracesEnabled`/`metricsEnabled`, so rendering it with no values 
will likely produce `docs == []` and make `docs[0]` crash. Enable the service 
in the test while leaving `ipFamilyPolicy`/`ipFamilies` unset to assert the 
default rendering behavior.



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