Files
Aleksei Sviridkin 6f74a1c804 test(tests): wire the gpu-operator suite into the unit sweep
hack/helm-unit-tests.sh decides whether to enter a package by asking
`make -C <pkg> -n test`, and packages/system/gpu-operator declared only
`update:`. The sweep skipped it in silence, so the three test cases in
tests/kernel_module_config_test.yaml had never executed. They pass, so
this is dead coverage rather than a hidden red -- but the directory read
as coverage to anyone opening it, and a suite that has never run is
where a stale assertion hides.

Declare the target phony: hack/package.mk's .PHONY line lists only the
targets that file defines, so a path named `test` next to the Makefile
would otherwise make the target up to date and skip the recipe.

Pin the class in hack/, because every other guard in the sweep -- the
shadowed-target check, the zero-suite check, the positive-evidence
check -- runs inside a directory the sweep already reached, and a
package missing the target escapes all of them at once. The new case
probes with `make -n` rather than grepping for `test:`, so it asks the
same question the sweep asks, and it reports make's own diagnostic
rather than asserting the cause: an unparseable Makefile fails the same
probe as a missing rule and wants a different fix. Its predicate is
"ships at least one tests/*_test.yaml", not "has a tests/ directory":
that glob is what helm-unittest collects, and packages/system/nfs-driver
keeps a PersistentVolumeClaim and a StorageClass under tests/ to apply
by hand, with no suite for a target to run.

Of the 84 packages holding a tests/ directory, 83 ship a suite and
gpu-operator was the only one of those without the target.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-09-07 04:17:50 +03:00

21 lines
674 B
Makefile

export NAME=gpu-operator
export NAMESPACE=cozy-$(NAME)
include ../../../hack/common-envs.mk
include ../../../hack/package.mk
# hack/helm-unit-tests.sh discovers work by probing for this target, so a
# package without one is skipped in silence however many suites sit under
# tests/. Phony because hack/package.mk's .PHONY line lists only the targets
# that file defines, so a path named `test` here would make the target up to
# date and skip the recipe.
.PHONY: test
test:
helm unittest .
update:
rm -rf charts
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm repo update nvidia
helm pull nvidia/gpu-operator --untar --untardir charts --version v26.3.1