jedcunningham commented on code in PR #39132:
URL: https://github.com/apache/airflow/pull/39132#discussion_r1575261805


##########
helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -900,3 +900,31 @@ def test_airflow_kerberos_init_container(
         if expected_init_containers == 1:
             assert initContainers[0]["name"] == "kerberos-init"
             assert initContainers[0]["args"] == ["kerberos", "-o"]
+
+    @pytest.mark.parametrize(
+        "cmd, expected",
+        [
+            (["test", "command", "to", "run"], ["test", "command", "to", 
"run"]),
+            (["cmd", "{{ .Release.Name }}"], ["cmd", "release-name"]),
+        ],
+    )
+    def test_should_add_command(self, cmd, expected):
+        docs = render_chart(
+            values={
+                "workers": {"command": cmd},
+            },
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+
+        assert expected == jmespath.search("spec.containers[0].command", 
docs[0])
+
+    @pytest.mark.parametrize("values", [{"workers": {"command": None}}, 
{"workers": {"command": []}}, None])
+    def test_should_not_add_command(self, values):
+        docs = render_chart(
+            values=values,
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+
+        assert None is jmespath.search("spec.containers[0].command", docs[0])

Review Comment:
   ```suggestion
           assert None is jmespath.search("spec.containers[0].command", docs[0])
           
       def test_should_not_add_command_by_default(self):
           docs = render_chart(
               show_only=["templates/pod-template-file.yaml"],
               chart_dir=self.temp_chart_dir,
           )
   
           assert None is jmespath.search("spec.containers[0].command", docs[0])
   ```
   
   Oops, lost this test!



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