Skip to content

Commit

Permalink
Adding basic helm chart tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh authored and potiuk committed Jan 29, 2023
1 parent 5290127 commit 5c2c55f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/charts/test_basic_helm_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,3 +508,35 @@ def test_invalid_dags_access_mode(self):
def test_namespace_names(self, namespace):
"""Test various namespace names to make sure they render correctly in templates"""
render_chart(namespace=namespace)

@pytest.mark.parametrize()
def test_postgres_connection_url_no_override(self):
# no nameoverride provided
assert "postgresql://postgres:postgres@my-release-postgresql.default:5432/postgres?sslmode=disable" == \
render_chart(
"my-release",
values={
"postgresql": {
"enabled": True,
}
},
show_only=[
"templates/secrets/metadata-connection-secret.yaml"
]
)["data"]["connection"]

@pytest.mark.parametrize()
def test_postgres_connection_url_name_override(self):
assert "postgresql://postgres:postgres@overrideName:5432/postgres?sslmode=disable" == \
render_chart(
"my-release",
values={
"postgresql": {
"enabled": True,
"nameOverride": "overrideName"
}
},
show_only=[
"templates/secrets/metadata-connection-secret.yaml"
]
)["data"]["connection"]

0 comments on commit 5c2c55f

Please sign in to comment.