Skip to content

Commit 96d909d

Browse files
authored
feat(ci): add helm-unittest mise task and CI step (#1367)
Adds a helm:test mise task that installs the helm-unittest plugin if not present and runs chart unit tests under deploy/helm/openshell. Installs the plugin into Dockerfile.ci so CI runs do not need to download it each time. Closes #1281 Signed-off-by: Mesut Oezdil <versusfinem@gmail.com>
1 parent 5159ebc commit 96d909d

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/helm-lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ jobs:
5555

5656
- name: Lint Helm chart
5757
run: mise run helm:lint
58+
59+
- name: Run Helm chart unit tests
60+
run: mise run helm:test

deploy/docker/Dockerfile.ci

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ RUN --mount=type=secret,id=MISE_GITHUB_TOKEN \
8383
npm install -g "npm@${NPM_VERSION}" && \
8484
mise reshim && \
8585
(/root/.cargo/bin/rustup component remove rust-docs || true) && \
86-
rm -rf /root/.rustup/toolchains/*/share/doc /root/.rustup/toolchains/*/share/man
86+
rm -rf /root/.rustup/toolchains/*/share/doc /root/.rustup/toolchains/*/share/man && \
87+
helm plugin install https://github.com/helm-unittest/helm-unittest
8788

8889
# Set working directory for CI jobs
8990
WORKDIR /builds

tasks/helm.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ run = """
1919
echo "All variants passed."
2020
"""
2121

22+
["helm:test"]
23+
description = "Run Helm chart unit tests"
24+
run = """
25+
set -e
26+
if ! helm plugin list | grep -q unittest; then
27+
helm plugin install https://github.com/helm-unittest/helm-unittest
28+
fi
29+
helm unittest deploy/helm/openshell
30+
"""
31+
2232
["helm:skaffold:dev"]
2333
description = "Run skaffold dev for deploy/helm/openshell (iterative deploy)"
2434
dir = "deploy/helm/openshell"

0 commit comments

Comments
 (0)