This is an automated email from the ASF dual-hosted git repository.
jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new b5124173674 Chart: Add missing tests for PodDisruptionBudgets (#60615)
b5124173674 is described below
commit b5124173674df14bd1e89e7d3a8e00edf452c4c6
Author: Jed Cunningham <[email protected]>
AuthorDate: Sat Jan 24 12:53:36 2026 -0700
Chart: Add missing tests for PodDisruptionBudgets (#60615)
---
.../test_pdb_api_server.py} | 30 ++++++++++++++++------
.../test_pdb_dag_processor.py} | 28 +++++++++++++++-----
.../tests/helm_tests/other/test_pdb_pgbouncer.py | 16 ++++++++++++
3 files changed, 59 insertions(+), 15 deletions(-)
diff --git a/helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
b/helm-tests/tests/helm_tests/airflow_core/test_pdb_api_server.py
similarity index 59%
copy from helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
copy to helm-tests/tests/helm_tests/airflow_core/test_pdb_api_server.py
index c70e6a00f07..7a5f530caf8 100644
--- a/helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
+++ b/helm-tests/tests/helm_tests/airflow_core/test_pdb_api_server.py
@@ -16,28 +16,42 @@
# under the License.
from __future__ import annotations
+import jmespath
from chart_utils.helm_template_generator import render_chart
-class TestPgbouncerPdb:
- """Tests PgBouncer PDB."""
+class TestApiServerPdb:
+ """Tests API Server PDB."""
def test_should_pass_validation_with_just_pdb_enabled(self):
render_chart(
- values={"pgbouncer": {"enabled": True, "podDisruptionBudget":
{"enabled": True}}},
-
show_only=["templates/pgbouncer/pgbouncer-poddisruptionbudget.yaml"],
+ values={"apiServer": {"podDisruptionBudget": {"enabled": True}}},
+
show_only=["templates/api-server/api-server-poddisruptionbudget.yaml"],
)
+ def test_should_add_component_specific_labels(self):
+ docs = render_chart(
+ values={
+ "apiServer": {
+ "podDisruptionBudget": {"enabled": True},
+ "labels": {"test_label": "test_label_value"},
+ },
+ },
+
show_only=["templates/api-server/api-server-poddisruptionbudget.yaml"],
+ )
+
+ assert "test_label" in jmespath.search("metadata.labels", docs[0])
+ assert jmespath.search("metadata.labels", docs[0])["test_label"] ==
"test_label_value"
+
def
test_should_pass_validation_with_pdb_enabled_and_min_available_param(self):
render_chart(
values={
- "pgbouncer": {
- "enabled": True,
+ "apiServer": {
"podDisruptionBudget": {
"enabled": True,
"config": {"maxUnavailable": None, "minAvailable": 1},
- },
+ }
}
},
-
show_only=["templates/pgbouncer/pgbouncer-poddisruptionbudget.yaml"],
+
show_only=["templates/api-server/api-server-poddisruptionbudget.yaml"],
) # checks that no validation exception is raised
diff --git a/helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
b/helm-tests/tests/helm_tests/airflow_core/test_pdb_dag_processor.py
similarity index 59%
copy from helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
copy to helm-tests/tests/helm_tests/airflow_core/test_pdb_dag_processor.py
index c70e6a00f07..a8372e1ee3d 100644
--- a/helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
+++ b/helm-tests/tests/helm_tests/airflow_core/test_pdb_dag_processor.py
@@ -16,28 +16,42 @@
# under the License.
from __future__ import annotations
+import jmespath
from chart_utils.helm_template_generator import render_chart
-class TestPgbouncerPdb:
- """Tests PgBouncer PDB."""
+class TestDagProcessorPdb:
+ """Tests Dag Processor PDB."""
def test_should_pass_validation_with_just_pdb_enabled(self):
render_chart(
- values={"pgbouncer": {"enabled": True, "podDisruptionBudget":
{"enabled": True}}},
-
show_only=["templates/pgbouncer/pgbouncer-poddisruptionbudget.yaml"],
+ values={"dagProcessor": {"podDisruptionBudget": {"enabled":
True}}},
+
show_only=["templates/dag-processor/dag-processor-poddisruptionbudget.yaml"],
)
+ def test_should_add_component_specific_labels(self):
+ docs = render_chart(
+ values={
+ "dagProcessor": {
+ "podDisruptionBudget": {"enabled": True},
+ "labels": {"test_label": "test_label_value"},
+ },
+ },
+
show_only=["templates/dag-processor/dag-processor-poddisruptionbudget.yaml"],
+ )
+
+ assert "test_label" in jmespath.search("metadata.labels", docs[0])
+ assert jmespath.search("metadata.labels", docs[0])["test_label"] ==
"test_label_value"
+
def
test_should_pass_validation_with_pdb_enabled_and_min_available_param(self):
render_chart(
values={
- "pgbouncer": {
- "enabled": True,
+ "dagProcessor": {
"podDisruptionBudget": {
"enabled": True,
"config": {"maxUnavailable": None, "minAvailable": 1},
},
}
},
-
show_only=["templates/pgbouncer/pgbouncer-poddisruptionbudget.yaml"],
+
show_only=["templates/dag-processor/dag-processor-poddisruptionbudget.yaml"],
) # checks that no validation exception is raised
diff --git a/helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
b/helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
index c70e6a00f07..bde370102de 100644
--- a/helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
+++ b/helm-tests/tests/helm_tests/other/test_pdb_pgbouncer.py
@@ -16,6 +16,7 @@
# under the License.
from __future__ import annotations
+import jmespath
from chart_utils.helm_template_generator import render_chart
@@ -28,6 +29,21 @@ class TestPgbouncerPdb:
show_only=["templates/pgbouncer/pgbouncer-poddisruptionbudget.yaml"],
)
+ def test_should_add_component_specific_labels(self):
+ docs = render_chart(
+ values={
+ "pgbouncer": {
+ "enabled": True,
+ "podDisruptionBudget": {"enabled": True},
+ "labels": {"test_label": "test_label_value"},
+ },
+ },
+
show_only=["templates/pgbouncer/pgbouncer-poddisruptionbudget.yaml"],
+ )
+
+ assert "test_label" in jmespath.search("metadata.labels", docs[0])
+ assert jmespath.search("metadata.labels", docs[0])["test_label"] ==
"test_label_value"
+
def
test_should_pass_validation_with_pdb_enabled_and_min_available_param(self):
render_chart(
values={