Skip to content

Commit e3605d5

Browse files
committed
D205 Support - Helm files (apache#33302)
1 parent be5eed5 commit e3605d5

File tree

6 files changed

+17
-25
lines changed

6 files changed

+17
-25
lines changed

helm_tests/airflow_aux/test_airflow_common.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424

2525
class TestAirflowCommon:
2626
"""
27-
This class holds tests that apply to more than 1 Airflow component so
28-
we don't have to repeat tests everywhere.
27+
Tests that apply to more than 1 Airflow component so we don't have to repeat tests everywhere.
2928
30-
The one general exception will be the KubernetesExecutor PodTemplateFile,
31-
as it requires extra test setup.
29+
The one general exception will be the KubernetesExecutor PodTemplateFile, as it requires extra test setup.
3230
"""
3331

3432
@pytest.mark.parametrize(
@@ -126,8 +124,9 @@ def test_webserver_config_configmap_name_volume_mounts(self):
126124

127125
def test_annotations(self):
128126
"""
129-
Test Annotations are correctly applied on all pods created Scheduler, Webserver & Worker
130-
deployments.
127+
Test Annotations are correctly applied.
128+
129+
Verifies all pods created Scheduler, Webserver & Worker deployments.
131130
"""
132131
release_name = "test-basic"
133132
k8s_objects = render_chart(

helm_tests/airflow_aux/test_basic_helm_chart.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,9 @@ def test_labels_are_valid_on_job_templates(self):
408408

409409
def test_annotations_on_airflow_pods_in_deployment(self):
410410
"""
411-
Test Annotations are correctly applied on all pods created Scheduler, Webserver & Worker
412-
deployments.
411+
Test Annotations are correctly applied.
412+
413+
Verifies all pods created Scheduler, Webserver & Worker deployments.
413414
"""
414415
release_name = "test-basic"
415416
k8s_objects = render_chart(
@@ -441,10 +442,7 @@ def test_annotations_on_airflow_pods_in_deployment(self):
441442

442443
def test_chart_is_consistent_with_official_airflow_image(self):
443444
def get_k8s_objs_with_image(obj: list[Any] | dict[str, Any]) -> list[dict[str, Any]]:
444-
"""
445-
Recursive helper to retrieve all the k8s objects that have an "image" key
446-
inside k8s obj or list of k8s obj.
447-
"""
445+
"""Retrieve all the k8s objects that have an "image" key inside k8s obj or list of k8s obj."""
448446
out = []
449447
if isinstance(obj, list):
450448
for item in obj:

helm_tests/airflow_core/test_scheduler.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ class TestScheduler:
4040
],
4141
)
4242
def test_scheduler_kind(self, executor, persistence, kind):
43-
"""
44-
Test scheduler kind is StatefulSet only when using a local executor &
45-
worker persistence is enabled.
46-
"""
43+
"""Test scheduler kind is StatefulSet only with a local executor & worker persistence is enabled."""
4744
docs = render_chart(
4845
values={
4946
"executor": executor,
@@ -676,6 +673,7 @@ def test_dags_mount_and_gitsync_expected_with_dag_processor(
676673
):
677674
"""
678675
DAG Processor can move gitsync and DAGs mount from the scheduler to the DAG Processor only.
676+
679677
The only exception is when we have a Local executor.
680678
In these cases, the scheduler does the worker role and needs access to DAGs anyway.
681679
"""

helm_tests/airflow_core/test_triggerer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ def test_only_exists_on_new_airflow_versions(self, airflow_version, num_docs):
4444

4545
def test_can_be_disabled(self):
4646
"""
47-
Triggerer should be able to be disabled if the users desires
48-
(e.g. Python 3.6 or doesn't want to use async tasks).
47+
Triggerer should be able to be disabled if the users desires.
48+
49+
For example, user may be disabled when using Python 3.6 or doesn't want to use async tasks.
4950
"""
5051
docs = render_chart(
5152
values={"triggerer": {"enabled": False}},

helm_tests/other/test_git_sync_webserver.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ def test_should_have_service_account_defined(self):
8282
],
8383
)
8484
def test_git_sync_with_different_airflow_versions(self, airflow_version, exclude_webserver):
85-
"""
86-
If Airflow >= 2.0.0 - git sync related containers, volume mounts & volumes
87-
are not created.
88-
"""
85+
"""If Airflow >= 2.0.0 - git sync related containers, volume mounts & volumes are not created."""
8986
docs = render_chart(
9087
values={
9188
"airflowVersion": airflow_version,

helm_tests/other/test_keda.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ def test_keda_disabled_by_default(self):
4141
],
4242
)
4343
def test_keda_enabled(self, executor, is_created):
44-
"""ScaledObject should only be created when set to enabled and
45-
executor is Celery or CeleryKubernetes.
46-
"""
44+
"""ScaledObject should only be created when enabled and executor is Celery or CeleryKubernetes."""
4745
docs = render_chart(
4846
values={
4947
"workers": {"keda": {"enabled": True}, "persistence": {"enabled": False}},
@@ -128,6 +126,7 @@ def test_keda_concurrency(self, executor, concurrency):
128126
def test_keda_query_kubernetes_queue(self, executor, queue, should_filter):
129127
"""
130128
Verify keda sql query ignores kubernetes queue when CKE is used.
129+
131130
Sometimes a user might want to use a different queue name for k8s executor tasks,
132131
and we also verify here that we use the configured queue name in that case.
133132
"""

0 commit comments

Comments
 (0)