Skip to content

Add CI that deploys and tests each example - #3

Merged
HarshCasper merged 4 commits into
masterfrom
ci/assert-each-example
Oct 13, 2026
Merged

HarshCasper merged 4 commits into
masterfrom
ci/assert-each-example

Conversation

@HarshCasper

@HarshCasper HarshCasper commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

The repo had no CI and no test.

  • New test.sh <example> checks a deployed example:
    • the site serves index.html (S3 website endpoint for s3, CloudFront for the rest)
    • s3: a missing page returns 404 with error.html
    • lambda, api-gateway, dynamodb: the stack's backend URL returns the message the site displays, and so does the URL the site loads from config.json
  • Makefile:
    • make install skipped the CDK CLI whenever lstk was already installed. Each tool is now installed on its own.
    • make deploy-dynamodb deployed the api-gateway example.
    • New make deploy EXAMPLE=<name> and make test EXAMPLE=<name>.
  • README documents make deploy and make test.
  • New workflow deploys and tests each example in a matrix.

On LocalStack, the API Gateway URL written into config.json is https://<id>.execute-api.us-east-1.localhost.localstack.cloud/prod/, which does not respond. The stack output is https://<id>.execute-api.localhost.localstack.cloud:4566/prod/. The site already falls back to the URL without the region segment (site_assets/main.js), and the test follows the same path.

Verified by CI.

https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM

A matrix job deploys each of the five examples with lstk and checks the site and its backend respond. Fix make install skipping the CDK CLI when lstk is present, and make deploy-dynamodb deploying the api-gateway example.

Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
LocalStack writes the API Gateway URL into config.json with the region segment and without the port, while the stack output has the port and no region. Check both the stack output URL and the URL the site loads, including the site's own fallback.

Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
The first URL the site tries is expected to fail on LocalStack, so do not print it as a test failure.

Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
@HarshCasper
HarshCasper merged commit 5f4ac6d into master Oct 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants