Skip to content

Testing & Validation

llms.txt lists every page for an agent
Optional: hand this page to your coding agentThe steps work by hand too.
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`.

The Kubernetes lexicon has scripts that check the import and serialize round trip and apply the serialized YAML to a real cluster.

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.

Terminal window
cd lexicons/k8s
# Full roundtrip (clones repo on first run)
just full-roundtrip
# Skip clone if repo is already cached
just full-roundtrip --skip-clone
# Parse + generate only (skip serialize phase)
just full-roundtrip --skip-clone --skip-serialize
# Verbose output + filter to a specific manifest
just full-roundtrip --skip-clone --verbose --manifest guestbook

The 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.

The original parse-only roundtrip test is still available:

Terminal window
just import-samples --skip-clone --verbose

The k3d validation script applies serialized YAML to a real Kubernetes cluster to check that the cluster accepts it.

  • k3d — lightweight K8s cluster in Docker
  • kubectl — Kubernetes CLI
  • Docker running
Terminal window
cd lexicons/k8s
# Create cluster, run tests, delete cluster
just k3d-validate
# Keep cluster for manual inspection
just k3d-validate --keep-cluster
# Reuse an existing cluster
just k3d-validate --reuse-cluster --verbose

After --keep-cluster, inspect resources manually:

Terminal window
kubectl get all
kubectl get deployments,services

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

For each manifest the script:

  1. Runs the full roundtrip (YAML to chant TypeScript and back to YAML)
  2. Applies the serialized YAML with kubectl apply
  3. Verifies the resource exists with kubectl get

A failure at any stage is reported with the specific phase that failed.

chant