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.
Architecture
Section titled “Architecture”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 teardownDocker 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.
Examples
Section titled “Examples”| Example | Lexicons | Skill | What it deploys |
|---|---|---|---|
k8s-eks-microservice | AWS + K8s | chant-eks | EKS cluster, K8s workloads, ALB, Route53 |
k8s-aks-microservice | Azure + K8s | chant-k8s | AKS cluster, K8s workloads, AGIC, Azure DNS |
k8s-gke-microservice | GCP + K8s | chant-k8s | GKE cluster, K8s workloads, GCE Ingress, Cloud DNS |
gitlab-aws-alb-infra | AWS + GitLab | chant-gitlab-aws-alb-infra | Shared ALB + VPC + ECS cluster via CloudFormation |
gitlab-aws-alb-api | AWS + GitLab | chant-gitlab-aws-alb-api | Fargate API service behind ALB |
gitlab-aws-alb-ui | AWS + GitLab | chant-gitlab-aws-alb-ui | Fargate UI service behind ALB |
flyway-postgresql-gitlab-aws-rds | AWS + Flyway + GitLab | chant-flyway-gitlab-aws-rds | RDS instance + Flyway migration via GitLab CI |
Running an E2E test
Section titled “Running an E2E test”-
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 -
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.
-
Teardown — ask your agent to tear down, or run the example’s teardown script:
Tear down the k8s-eks-microservice stack.
Required tools
Section titled “Required tools”The host needs cloud CLIs and credentials for the examples you’re deploying:
| Example group | Host requirements |
|---|---|
| EKS | AWS CLI, kubectl, jq, AWS credentials with EKS permissions |
| AKS | Azure CLI, kubectl, Azure credentials with AKS permissions |
| GKE | gcloud CLI, kubectl, GCP credentials with GKE permissions |
| GitLab + AWS | AWS CLI, AWS credentials, GITLAB_TOKEN + GITLAB_GROUP |
Cleanup
Section titled “Cleanup”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.
| File | Purpose |
|---|---|
test/smoke.sh | Builds Docker image, installs and compiles examples from tarballs |
test/Dockerfile.smoke-e2e | Two-stage Dockerfile: bun builder → node runner |
examples/<name>/README.md | Deploy instructions for each example |
examples/<name>/package.json | npm scripts for build, deploy, teardown |
Adding a new E2E example
Section titled “Adding a new E2E example”- Create a root example in
examples/<name>/with workingnpm run buildandnpm run deployscripts - Add a corresponding skill in the relevant lexicon (see Skills)
- Write a README that describes the full deploy flow for the agent
- Ensure the Dockerfile builds and installs the example from tarballs