Testing & Validation
Show the whole prompt
Read https://intentius.io/chant/lexicons/k8s/testing/.
In a chant checkout, run `just full-roundtrip --skip-clone` in lexicons/k8s (without `--skip-clone` the first time), then `just k3d-validate`, which creates and deletes a local k3d cluster.
Show me the output, and name each manifest that failed and the phase it failed in.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.Optional: hand this page to your coding agent
Read https://intentius.io/chant/lexicons/k8s/testing/.In a chant checkout, run `just full-roundtrip --skip-clone` in lexicons/k8s (without `--skip-clone` the first time), then `just k3d-validate`, which creates and deletes a local k3d cluster.Show me the output, and name each manifest that failed and the phase it failed in.Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.The Kubernetes lexicon has scripts that check the import and serialize round trip and apply the serialized YAML to a real cluster.
Roundtrip tests
Section titled “Roundtrip tests”The roundtrip test suite clones kubernetes/examples and runs each manifest through the full pipeline:
Input YAML → parse → generate TS → dynamic import → serialize YAML → re-parse → compare“Pass” means the serialized YAML, when re-parsed, produces the same number of resources with matching kind values. Exact YAML comparison is intentionally skipped — key ordering, quoting, and comments differ between input and output.
Running
Section titled “Running”cd lexicons/k8s
# Full roundtrip (clones repo on first run)just full-roundtrip
# Skip clone if repo is already cachedjust full-roundtrip --skip-clone
# Parse + generate only (skip serialize phase)just full-roundtrip --skip-clone --skip-serialize
# Verbose output + filter to a specific manifestjust full-roundtrip --skip-clone --verbose --manifest guestbookThe test requires just generate to have been run first so the generated index exports real constructors. If the generated index is empty, the test falls back to parse-only mode automatically.
Parse-only roundtrip
Section titled “Parse-only roundtrip”The original parse-only roundtrip test is still available:
just import-samples --skip-clone --verbosek3d cluster validation
Section titled “k3d cluster validation”The k3d validation script applies serialized YAML to a real Kubernetes cluster to check that the cluster accepts it.
Prerequisites
Section titled “Prerequisites”Running
Section titled “Running”cd lexicons/k8s
# Create cluster, run tests, delete clusterjust k3d-validate
# Keep cluster for manual inspectionjust k3d-validate --keep-cluster
# Reuse an existing clusterjust k3d-validate --reuse-cluster --verboseAfter --keep-cluster, inspect resources manually:
kubectl get allkubectl get deployments,servicesSafe manifest allowlist
Section titled “Safe manifest allowlist”The script uses a curated allowlist of ~14 manifests known to work on bare k3d (no cloud volumes, CRDs, or GPUs). These include:
- Guestbook — Deployments and Services for frontend + Redis
- Cassandra — Headless Service
- vLLM — Service
What it validates
Section titled “What it validates”For each manifest the script:
- Runs the full roundtrip (YAML to chant TypeScript and back to YAML)
- Applies the serialized YAML with
kubectl apply - Verifies the resource exists with
kubectl get
A failure at any stage is reported with the specific phase that failed.
See also
Section titled “See also”- Importing Existing YAML — convert existing K8s manifests into TypeScript