kubernetes-helmPlugins.helm-unittest: add smoke passthru test (#534190)

This commit is contained in:
Ihar Hrachyshka
2026-07-03 00:36:39 +00:00
committed by GitHub
4 changed files with 46 additions and 2 deletions

View File

@@ -1,14 +1,18 @@
{
buildGoModule,
fetchFromGitHub,
kubernetes-helm,
lib,
nix-update-script,
runCommand,
wrapHelm,
writableTmpDirAsHomeHook,
}:
let
version = "1.1.1";
in
buildGoModule {
buildGoModule (finalAttrs: {
pname = "helm-unittest";
inherit version;
@@ -46,6 +50,26 @@ buildGoModule {
'';
passthru = {
tests.smoke =
let
helm = wrapHelm kubernetes-helm {
plugins = [ finalAttrs.finalPackage ];
};
in
runCommand "helm-unittest-plugin-smoke"
{
nativeBuildInputs = [
helm
writableTmpDirAsHomeHook
];
}
''
cp -r ${./tests/helm-unittest/smoke} chart
chmod -R u+w chart
helm unittest chart
touch $out
'';
updateScript = nix-update-script { };
};
@@ -58,4 +82,4 @@ buildGoModule {
yurrriq
];
};
}
})

View File

@@ -0,0 +1,3 @@
apiVersion: v2
name: smoke
version: 0.1.0

View File

@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ .Release.Name }}-smoke"
data:
value: "{{ .Values.value }}"

View File

@@ -0,0 +1,11 @@
suite: configmap
templates:
- templates/configmap.yaml
tests:
- it: renders the configured value
set:
value: ok
asserts:
- equal:
path: data.value
value: ok