Skip to content

Commit de2bec0

Browse files
committed
Add a manifest test to check we don't have things that look like they should be templated left over in the manifests
1 parent 8f5075c commit de2bec0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

newsfragments/791.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CI: add a test that we don't have anything that looks like a template string in the rendered files.

tests/manifests/test_basic.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# SPDX-License-Identifier: AGPL-3.0-only
44

55
import pytest
6+
import yaml
67

78
from . import PropertyType, all_deployables_details, values_files_to_test
89
from .utils import template_id
@@ -123,3 +124,15 @@ async def test_default_values_file_sets_stub_values(base_values):
123124
assert hostAliases == unset_marker, (
124125
f"{deployable_details.name} has default {hostAliases=} rather than being unset"
125126
)
127+
128+
129+
@pytest.mark.parametrize("values_file", values_files_to_test)
130+
@pytest.mark.asyncio_cooperative
131+
async def test_doesnt_contain_any_unrendered_helm_templates(templates):
132+
# This test does not cover `NOTES.txt` as https://github.com/helm/helm/issues/6901
133+
for template in templates:
134+
for idx, line in enumerate(yaml.safe_dump(template).splitlines()):
135+
assert ".Values." not in line, (
136+
f"{template_id(template)} contains what looks like an un-rendered Helm template "
137+
f"on line number {idx + 1}"
138+
)

0 commit comments

Comments
 (0)