Skip to content

Commit

Permalink
fix helm chart unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Jun 27, 2024
1 parent b14e8c7 commit 670214b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/unit/charts/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# pylint: disable=attribute-defined-outside-init
# pylint: disable=protected-access

import re
import subprocess
from tempfile import NamedTemporaryFile
from typing import Dict, Optional
Expand Down Expand Up @@ -68,7 +69,6 @@ def test_labels_are_set(self):
@pytest.mark.parametrize(
"label, label_value",
[
("app.kubernetes.io/version", "12.0.0"),
("app.kubernetes.io/name", "logprep-logprep"),
("app.kubernetes.io/application", "logprep"),
("app.kubernetes.io/managed-by", "Helm"),
Expand All @@ -78,3 +78,9 @@ def test_labels_are_set(self):
def test_common_labels_are_set(self, label, label_value):
for manifest in self.manifests:
assert manifest["metadata.labels"][label] == label_value

def test_chart_version_is_set(self):
for manifest in self.manifests:
assert re.search(
r"\d+\.\d+\.\d+", manifest["metadata.labels"]["app.kubernetes.io/version"]
)

0 comments on commit 670214b

Please sign in to comment.