dstandish commented on code in PR #26945:
URL: https://github.com/apache/airflow/pull/26945#discussion_r1016174254


##########
tests/charts/test_webserver.py:
##########
@@ -721,6 +721,30 @@ def test_should_add_component_specific_labels(self):
         assert "test_label" in jmespath.search("metadata.labels", docs[0])
         assert jmespath.search("metadata.labels", docs[0])["test_label"] == 
"test_label_value"
 
+    @parameterized.expand(
+        [
+            (
+                [{"name": "webserver-nodeport", "nodePort": "31000", "port": 
"8080"}],
+                [{"name": "webserver-nodeport", "nodePort": 31000, "port": 
8080}],
+            )
+        ]
+    )
+    def test_nodeport_service(self, ports, expected_ports):

Review Comment:
   all good.
   
   one thing though. 
   
   looking 
[here](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport),
 it looks like `name` is not a valid attr for nodeport. probably best to remov 
that.



##########
tests/charts/test_webserver.py:
##########
@@ -719,6 +719,35 @@ def test_should_add_component_specific_labels(self):
         assert "test_label" in jmespath.search("metadata.labels", docs[0])
         assert jmespath.search("metadata.labels", docs[0])["test_label"] == 
"test_label_value"
 
+    @pytest.mark.parametrize(
+        "ports, expected_ports",
+        [
+            (
+                [{"name": "webserver-nodeport", "nodePort": "31000", "port": 
"8080"}],
+                [{"name": "webserver-nodeport", "nodePort": 31000, "port": 
8080}],
+            ),
+            (
+                [{"name": "webserver-nodeport", "port": "8080"}],
+                [{"name": "webserver-nodeport", "port": 8080}],
+            ),
+        ],
+    )
+    def test_nodeport_service(self, ports, expected_ports):
+        docs = render_chart(
+            values={
+                "webserver": {
+                    "service": {
+                        "type": "NodePort",
+                        "ports": (ports),

Review Comment:
   ```suggestion
                           "ports": ports,
   ```



##########
tests/charts/test_webserver.py:
##########
@@ -719,6 +719,35 @@ def test_should_add_component_specific_labels(self):
         assert "test_label" in jmespath.search("metadata.labels", docs[0])
         assert jmespath.search("metadata.labels", docs[0])["test_label"] == 
"test_label_value"
 
+    @pytest.mark.parametrize(
+        "ports, expected_ports",
+        [
+            (
+                [{"name": "webserver-nodeport", "nodePort": "31000", "port": 
"8080"}],
+                [{"name": "webserver-nodeport", "nodePort": 31000, "port": 
8080}],
+            ),
+            (
+                [{"name": "webserver-nodeport", "port": "8080"}],
+                [{"name": "webserver-nodeport", "port": 8080}],
+            ),

Review Comment:
   ```suggestion
               (
                   [{"nodePort": "31000", "port": "8080"}],
                   [{"nodePort": 31000, "port": 8080}],
               ),
               (
                   [{"port": "8080"}],
                   [{"port": 8080}],
               ),
   ```



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