Skip to content

E2E Testing

E2E tests verify that every root example can be built from published tarballs and deployed to real cloud infrastructure. The build phase runs in Docker (same image as the smoke tests) to guarantee a clean environment, but deployment runs directly on the host using chant skills.

Docker (build only) Host (deploy)
─────────────────── ─────────────
Dockerfile.smoke-e2e Agent + skill
├─ Stage 1: bun builds tarballs cd examples/<name>
└─ Stage 2: npm install from .tgz npm run deploy
npm run build npm run teardown

Docker packs @intentius/chant and each lexicon into .tgz tarballs, then installs and builds each example from those tarballs — proving the published packages work in a clean environment.

Host deployment is driven by an AI agent using chant’s built-in skills (e.g. chant-eks, chant-k8s). Each example README describes the deploy flow. The agent runs npm run deploy (and teardown) directly on the host with real cloud credentials.

ExampleLexiconsSkillWhat it deploys
k8s-eks-microserviceAWS + K8schant-eksEKS cluster, K8s workloads, ALB, Route53
k8s-aks-microserviceAzure + K8schant-k8sAKS cluster, K8s workloads, AGIC, Azure DNS
k8s-gke-microserviceGCP + K8schant-k8sGKE cluster, K8s workloads, GCE Ingress, Cloud DNS
gitlab-aws-alb-infraAWS + GitLabchant-gitlab-aws-alb-infraShared ALB + VPC + ECS cluster via CloudFormation
gitlab-aws-alb-apiAWS + GitLabchant-gitlab-aws-alb-apiFargate API service behind ALB
gitlab-aws-alb-uiAWS + GitLabchant-gitlab-aws-alb-uiFargate UI service behind ALB
flyway-postgresql-gitlab-aws-rdsAWS + Flyway + GitLabchant-flyway-gitlab-aws-rdsRDS instance + Flyway migration via GitLab CI
  1. Build in Docker — the smoke test builds tarballs and verifies each example installs and compiles:

    Terminal window
    ./test/smoke.sh # builds all examples from tarballs in Docker
  2. Deploy on host — ask your agent to deploy, following the example README:

    Deploy the k8s-eks-microservice example to AWS. My domain is myapp.example.com.

    The agent invokes the appropriate skill and runs the example’s npm scripts directly on the host.

  3. Teardown — ask your agent to tear down, or run the example’s teardown script:

    Tear down the k8s-eks-microservice stack.

The host needs cloud CLIs and credentials for the examples you’re deploying:

Example groupHost requirements
EKSAWS CLI, kubectl, jq, AWS credentials with EKS permissions
AKSAzure CLI, kubectl, Azure credentials with AKS permissions
GKEgcloud CLI, kubectl, GCP credentials with GKE permissions
GitLab + AWSAWS CLI, AWS credentials, GITLAB_TOKEN + GITLAB_GROUP

Each example provides its own teardown script (npm run teardown or equivalent). The skill guides the agent through cleanup in the correct order — e.g. for EKS, K8s resources are deleted before the CloudFormation stack to allow the ALB controller to clean up load balancers.

FilePurpose
test/smoke.shBuilds Docker image, installs and compiles examples from tarballs
test/Dockerfile.smoke-e2eTwo-stage Dockerfile: bun builder → node runner
examples/<name>/README.mdDeploy instructions for each example
examples/<name>/package.jsonnpm scripts for build, deploy, teardown
  1. Create a root example in examples/<name>/ with working npm run build and npm run deploy scripts
  2. Add a corresponding skill in the relevant lexicon (see Skills)
  3. Write a README that describes the full deploy flow for the agent
  4. Ensure the Dockerfile builds and installs the example from tarballs