Repository navigation
Conversation
roberthocking
approved these changes
Jun 17, 2026
…nds: Command-based KUTTL steps across the pre-existing tests/kuttl suites silently no-op for two independent reasons, so their e2e assertions have never actually run (the suites report PASS without executing kubectl/helm/curl): 1. `command:` + `args:` — kuttl's Command has no `args` field and `command` is a single string, so only the bare first word ran. 2. `spec:` wrapper — kuttl's TestStep has a top-level `commands` field and no `spec`, so nesting `commands:` under `spec:` made the whole step a no-op. (Confirmed empirically with a marker probe against the pinned kuttl v0.25.0.) This converts the 11 affected step files in alloy-clustered-test, collector-test, collector-comprehensive-test, webhook-test, and webhook-comprehensive-test to valid kuttl, preserving each step's intent: - Drop `spec:`; put `commands:` at the top level. Use `script:` / single-string `command:` instead of `command:`+`args:`. - Reference shared agent components by label (app.kubernetes.io/name= aggregator|webhook-server|ksm) and discover the install namespace, instead of the stale hardcoded `cz-agent-*` names that don't exist in the current chart. Exclude the alloy co-install (instance!=cz-alloy-ct). - Background `kubectl port-forward` (foreground would hang the step) and land the curl body to a file before `head` so a failed fetch fails the step. - Walk up to the repo root before the alloy helm calls (kuttl runs scripts with CWD = the step dir); pre-poll selector-based `kubectl wait`s. - Set explicit per-command `timeout:` on long-running commands (sleeps, helm --wait, and every `kubectl wait`): these suites' kuttl-test.yaml put `timeout` under `spec:`, which kuttl ignores, so the 30s per-command default otherwise applied and clamped them. - Consolidate webhook-comprehensive/03 into one `script:` so $WEBHOOK_METRICS survives across the curl/grep/count chain (kuttl runs each entry in its own shell). Once the suites actually run, they need a working agent image, which exposed a pre-existing gap: the test-matrix-k8s CI path installs an unpullable image (kind-overrides pins an intentionally-invalid tag and the freshly-built untested image was never wired in), so agent pods never reached Ready. It was false-green only because the suites were hollow. Fix CI to make the built image usable: - Add a `kind-load` Makefile target. - In both test-matrix-k8s jobs, log in to ghcr, pull the freshly-built untested image for the matrix arch, retag it as the tag the chart installs, kind-load it into the node, and run the kind phases explicitly (up -> load -> install/wait -> helm-test-kuttl -> teardown) so the image is present before install. All five suites verified to genuinely execute and PASS against a local kind cluster using this exact sequence, with a negative control confirming the now-live assertions go red on a real regression. The CP-43292 webhookserver-* suites are handled on that branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Command-based KUTTL steps across the pre-existing
tests/kuttlsuites have been silently no-op'ing, so their e2e assertions never actually ran — the suites reported PASS without executing any of theirkubectl/helm/curllogic. Two independent bugs cause this:command:+args:— kuttl'sCommandhas noargsfield andcommandis a single string, so only the bare first word (kubectl,sh,sleep) ran.spec:wrapper — kuttl'sTestStephas a top-levelcommandsfield and nospec, so nestingcommands:underspec:made the whole step a no-op. Confirmed empirically with a marker probe against the pinned kuttl v0.25.0.So
make kind-test/helm-test-kuttlhas been false-green for anything relying oncommands.Fix
Converts the 11 affected step files across
alloy-clustered-test,collector-test,collector-comprehensive-test,webhook-test, andwebhook-comprehensive-testto valid kuttl, preserving each step's original intent:spec:; putcommands:at the top level; usescript:/ single-stringcommand:instead ofcommand:+args:.app.kubernetes.io/name=aggregator|webhook-server|ksm) and discover the install namespace, instead of the stale hardcodedcz-agent-*names that don't exist in the current chart (<release>-cz-*). Discovery excludes the alloy co-install (instance!=cz-alloy-ct).kubectl port-forward(a foreground one would hang the step) and land the curl body to a file beforeheadso a failed fetch fails the step.helmcalls (kuttl runs scripts with CWD = the step dir), with a loop-termination guard; pre-poll selector-basedkubectl waits.timeout:on long-running commands (sleeps,helm --wait, and everykubectl wait): these suites'kuttl-test.yamlputtimeoutunderspec:, which kuttl ignores, so the 30s per-command default otherwise applied and clamped them.webhook-comprehensive/03into onescript:so$WEBHOOK_METRICSsurvives across the curl→grep→count chain (kuttl runs each entry in its own shell).CI: make the built image usable by the matrix kind tests
Once the suites genuinely run they need a working agent image, which exposed a pre-existing gap: the
test-matrix-k8spath installed an unpullable image (kind-overrides.yamlpins anintentionally-invalid-tagand the freshly-built untested image was never wired in), so agent pods never reached Ready — invisible while the suites were hollow. Fixed:kind-loadMakefile target.test-matrix-k8s.yamljobs now log in to ghcr, pull the freshly-built untested image for the matrix arch, retag it as the tag the chart installs (dev-<sha>),kind loadit into the node (chartimagePullPolicy: IfNotPresent), and run the kind phases explicitly (up → load → install/wait → helm-test-kuttl → teardown) so the image is present before install.Verification
All five suites verified to genuinely execute and PASS against a local kind cluster using the exact
up → kind-load → install/wait → helm-test-kuttlsequence CI now uses (5 PASS / 0 FAIL). A negative control (breaking an assertion / the curl target) confirms the now-live checks go red on a real regression.Scope
webhookserver-disabled-test/webhookserver-upgrade-testsuites share bug Bump anothrNick/github-tag-action from 1.69.0 to 1.70.0 #2 and are handled on that branch.Refs CP-43356.
🤖 Generated with Claude Code