jedcunningham commented on code in PR #25031:
URL: https://github.com/apache/airflow/pull/25031#discussion_r952732539
##########
tests/charts/test_webserver.py:
##########
@@ -808,3 +816,61 @@ def test_deprecated_from_param(self):
assert [{"namespaceSelector": {"matchLabels": {"release":
"myrelease"}}}] == jmespath.search(
"spec.ingress[0].from", docs[0]
)
+
+ def test_should_add_component_specific_labels(self):
+ docs = render_chart(
+ values={
+ "networkPolicies": {"enabled": True},
+ "webserver": {
+ "labels": {"test_label": "test_label_value"},
+ },
+ },
+ show_only=["templates/webserver/webserver-networkpolicy.yaml"],
+ )
+ assert "test_label" in jmespath.search("metadata.labels", docs[0])
+ assert jmespath.search("metadata.labels", docs[0])["test_label"] ==
"test_label_value"
+
+
+class WebserverIngressTest(unittest.TestCase):
Review Comment:
There are separate files for ingess tests, e.g. `test_ingress_web.py`.
##########
tests/charts/test_webserver.py:
##########
@@ -808,3 +816,61 @@ def test_deprecated_from_param(self):
assert [{"namespaceSelector": {"matchLabels": {"release":
"myrelease"}}}] == jmespath.search(
"spec.ingress[0].from", docs[0]
)
+
+ def test_should_add_component_specific_labels(self):
+ docs = render_chart(
+ values={
+ "networkPolicies": {"enabled": True},
+ "webserver": {
+ "labels": {"test_label": "test_label_value"},
+ },
+ },
+ show_only=["templates/webserver/webserver-networkpolicy.yaml"],
+ )
+ assert "test_label" in jmespath.search("metadata.labels", docs[0])
+ assert jmespath.search("metadata.labels", docs[0])["test_label"] ==
"test_label_value"
+
+
+class WebserverIngressTest(unittest.TestCase):
+ def test_should_add_component_specific_labels(self):
+ docs = render_chart(
+ values={
+ "ingress": {"enabled": True},
+ "webserver": {
+ "labels": {"test_label": "test_label_value"},
+ },
+ },
+ show_only=["templates/webserver/webserver-ingress.yaml"],
+ )
+ assert "test_label" in jmespath.search("metadata.labels", docs[0])
+ assert jmespath.search("metadata.labels", docs[0])["test_label"] ==
"test_label_value"
+
+
+class WebserverPodDisruptionBudgetTest(unittest.TestCase):
Review Comment:
Same with these, e.g. `test_pdb_webserver.py`.
--
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]