Skip to content

test(charts): add helm-unittest suite for mysql-storage-pvc template - #250

Merged
saadqbal merged 1 commit into
developfrom
auto-coverage/mysql-storage-pvc-suite
Jun 12, 2026
Merged

test(charts): add helm-unittest suite for mysql-storage-pvc template#250
saadqbal merged 1 commit into
developfrom
auto-coverage/mysql-storage-pvc-suite

Conversation

@saadqbal

@saadqbalsaadqbal commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dedicated helm-unittest suite for client/templates/mysql-storage-pvc.yaml, which had no test coverage. This template renders the PersistentVolumeClaim — and, on bare-metal (hostPath.enabled=true), the paired PersistentVolume — backing the per-cluster MySQL state store.

Tracking epic: #193

Why this gap

Cross-referencing templates/*.yaml against suites in tests/ on develop, all security-relevant templates (secrets, RBAC, SCC, network-policy, serviceaccount) are already covered. The only genuinely untested templates were the two storage PVCs (logs-pvc, mysql-storage-pvc); mysql-storage-pvc is the higher-impact of the two since it backs the runtime's state store.

Coverage delta

  • +1 template suite (mysql-storage-pvc); 14 tests, 28 assertions
  • chart suites 20 → 21; chart tests 212 → 226
  • full suite green locally (helm unittest ./client): 21 passed, 226 tests

What's asserted

  • dynamic-PVC-only path (hostPath.enabled=false, the managed-cluster default): single PVC, name/namespace, default ReadWriteMany, default 2Gi
  • bare-metal hostPath PV+PVC pair: release-scoped PV name, fixed /tracebloc/<release>/mysql path with DirectoryOrCreate, hard claimRef binding to the PVC, ReadWriteOnce, advertised capacity
  • the helm.sh/resource-policy: keep annotation that protects the state store from deletion on uninstall/upgrade
  • pvcAccessMode override and storageClass.create true/false name wiring

Notes

tests-only; no source/template/values changes. Security invariants unchanged.


Note

Low Risk
Tests-only change with no template, values, or runtime behavior modifications.

Overview
Adds helm-unittest coverage for templates/mysql-storage-pvc.yaml, which backs the per-cluster MySQL state store and previously had no tests.

The suite asserts the managed default (hostPath.enabled=false): a single mysql-pvc in the release namespace, ReadWriteMany, 2Gi, helm.sh/resource-policy: keep, and StorageClass wiring when storageClass.create is true vs a fixed name. It also covers overrides for pvcAccessMode and pvc.mysql size.

For bare-metal (hostPath.enabled=true), it checks a PV + PVC pair: release-scoped PV name, /tracebloc/<release>/mysql with DirectoryOrCreate, claimRef binding to mysql-pvc, ReadWriteOnce, and advertised capacity.

Tests only; no chart template or values changes.

Reviewed by Cursor Bugbot for commit f745c4d. Bugbot is set up for automated code reviews on this repo. Configure here.

The mysql-storage-pvc template (PVC + bare-metal hostPath PV backing the
per-cluster MySQL state store) had no dedicated suite. Add one covering:
- dynamic-PVC-only path (hostPath.enabled=false, managed default)
- hostPath PV+PVC pair, claimRef binding, fixed release-scoped path
- the helm.sh/resource-policy:keep annotation protecting the state store
- access-mode defaulting, pvc size, and storageClass wiring
Tests-only; no source/template/values changes. Security invariants unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
@saadqbalsaadqbal added the auto-coverage Automated test-coverage PRs label Jun 11, 2026
@saadqbalsaadqbal self-assigned this Jun 11, 2026
@aptracebloc
aptracebloc self-requested a review June 12, 2026 10:30
@saadqbal
saadqbal merged commit 7fb0ff4 into developJun 12, 2026
19 checks passed
saadqbal added a commit that referenced this pull request Jun 15, 2026
…light helm test, inert) (#254)
* test(charts): add helm-unittest suite for mysql-storage-pvc template (#250)
The mysql-storage-pvc template (PVC + bare-metal hostPath PV backing the
per-cluster MySQL state store) had no dedicated suite. Add one covering:
- dynamic-PVC-only path (hostPath.enabled=false, managed default)
- hostPath PV+PVC pair, claimRef binding, fixed release-scoped path
- the helm.sh/resource-policy:keep annotation protecting the state store
- access-mode defaulting, pvc size, and storageClass wiring
Tests-only; no source/template/values changes. Security invariants unchanged.
Co-authored-by: Claude <noreply@anthropic.com>
* test(charts): add helm-unittest suite for logs-pvc template (#251)
The logs-pvc template (PV + PVC for client logs) had no dedicated
helm-unittest suite. Adds tests/logs_pvc_test.yaml covering the
dynamic-provisioning PVC path and the hostPath PV+PVC path.
Co-authored-by: Claude <noreply@anthropic.com>
* Merge pull request #253 from tracebloc/feat/104-egress-enforcement-check
feat(egress-proxy): deploy-time egress-enforcement pre-flight (non-blocking) [client-runtime#104]
* fix(egress-proxy): enforcement check probes TCP reachability, not HTTP code [#104] (#255)
Bugbot (PR #254): the check treated curl HTTP code 000 as proof of a block, but a
TCP connection that succeeds (egress OPEN) then fails TLS verification also yields
000 — so `helm test` could pass on a non-enforcing CNI when probing an IP whose
cert doesn't validate (the default 1.1.1.1 without -k). It conflated "TLS failed"
with "egress blocked", defeating the check.
Key the verdict off TCP reachability via curl's exit code instead of the HTTP
status, and add -k so TLS is explicitly irrelevant: exit 28 (timeout) / 7 (connect
failed) => egress blocked => test PASSES (exit 0); any other outcome (0 success, or
a TLS-/HTTP-layer error such as 35/52/60 — all of which require the TCP connect to
have already succeeded) => egress reached => NOT enforced => test FAILS (exit 1).
Tests assert the verdict keys on the exit code (rc=$?, -k) and guard against a
regression to the old http_code/000 logic. helm-unittest 248/248; lint clean.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* fix(egress-proxy): probe reports DNS failure distinctly, not as "TCP connect succeeded" [#104] (#256)
Bugbot (PR #254): the non-enforcement WARNING ("...reached :443 ... the TCP connect
succeeded") was emitted for every non-{7,28} curl exit code, including exit 6 (DNS
resolution failure) where no TCP connection was ever attempted — so the failure
output could contradict what actually happened and mislead troubleshooting.
Split the verdict into a case:
7|28 => TCP never established => egress blocked (pass, exit 0)
6 => INCONCLUSIVE: could not resolve host, no TCP attempted => fail (exit 1)
with an accurate message (never claim "enforced" on a DNS failure)
else (0, or TLS-/HTTP-layer errors 35/52/56/60 that all require a completed TCP
connect) => host reached => NOT enforced (exit 1)
Default probe host is an IP, so exit 6 only arises for a hostname probe on a cluster
with broken DNS. helm-unittest 248/248; lint clean.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
@saadqbal
saadqbal deleted the auto-coverage/mysql-storage-pvc-suite branch July 9, 2026 11:41
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-coverageAutomated test-coverage PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@saadqbal@aptracebloc@LukasWodka