-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Beyoncé Rule tests for OSS airflow chart strategy (#536)
Co-authored-by: pgvishnuram <[email protected]>
- Loading branch information
1 parent
fab84d1
commit fac9bc6
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Beyoncé Rule tests for OSS airflow scheduler behaviors | ||
|
||
import pytest | ||
|
||
from tests.chart.helm_template_generator import render_chart | ||
|
||
from .. import supported_k8s_versions | ||
|
||
|
||
@pytest.mark.parametrize("kube_version", supported_k8s_versions) | ||
class TestAirflowScheduler: | ||
def test_scheduler_defaults(self, kube_version): | ||
"""Test default behaviors of the scheduler that we rely on.""" | ||
docs = render_chart(kube_version=kube_version, show_only=["charts/airflow/templates/scheduler/scheduler-deployment.yaml"]) | ||
|
||
assert len(docs) == 1 | ||
doc = docs[0] | ||
assert doc["kind"] == "Deployment" | ||
assert doc["spec"]["strategy"] == {"type": "Recreate"} | ||
|
||
def test_scheduler_customizations(self, kube_version): | ||
"""Test custom behaviors of the scheduler that we rely on.""" | ||
values = {"airflow": {"scheduler": {"strategy": {"type": "RollingUpdate"}}}} | ||
docs = render_chart( | ||
kube_version=kube_version, show_only=["charts/airflow/templates/scheduler/scheduler-deployment.yaml"], values=values | ||
) | ||
|
||
assert len(docs) == 1 | ||
doc = docs[0] | ||
assert doc["kind"] == "Deployment" | ||
assert doc["spec"]["strategy"] == {"type": "RollingUpdate"} |