Skip to content

Add CI that tests the SES, SQS and SNS examples - #4

Merged
HarshCasper merged 3 commits into
mainfrom
ci/assert-deep-dive-examples
Oct 13, 2026
Merged

HarshCasper merged 3 commits into
mainfrom
ci/assert-deep-dive-examples

Conversation

@HarshCasper

@HarshCasper HarshCasper commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

The repo had no CI and no tests, and the SQS sample order could not be processed.

Fixes:

  • sqs/sampleData/order.json sent items with name, but OrderManager reads itemDetail. The DynamoDB document client rejected the undefined value, so make test-order failed before anything reached the queue. The data now uses itemDetail.
  • OrderManager now keeps an item's itemId when the order gives one. The sample's IDs (ITEM-101, ITEM-223) are the ones the README's failure rules describe.
  • sqs gets esbuild as a dev dependency, so cdk deploy bundles locally instead of in Docker.
  • The sqs and sns Makefiles put node_modules/.bin on PATH. lstk cdk runs cdk from PATH, so make deploy failed with "cdk not found in PATH" without a global install.
  • ses/Makefile resolved the topic ARN from aws configure get region and fell back to plain aws without the LocalStack endpoint. It now uses lstk aws sns create-topic, which returns the existing topic.
  • sns/README.md: phone numbers in E.164 format, a placeholder instead of a real API ID, and Content-Type: application/json on the filter examples. Without it, LocalStack's API Gateway re-encodes the body as form data and the Lambda cannot parse it.

Tests, run with make test in each example:

  • ses: runs make setup-all, checks the sender is verified, the configuration set exists, and the email subscription is confirmed. Sends a text and an HTML email and reads both back from /_aws/ses.
  • sqs: submits the sample order under a unique ID, checks the order total, then waits until ITEM-223 is FAILED through the DLQ, ITEM-101 is PROCESSED or FAILED, and the other items are PROCESSED.
  • sns: publishes four events through the API, checks each subscriber Lambda's logs only contain the events its filter policy allows, that ops-alerts published to its topic, and that SMS messages were sent. Also checks an invalid event type returns 400.

The SES test does not read back the event destination. On LocalStack, describe-configuration-set with eventDestination returns an empty EventDestinations list after a successful create-configuration-set-event-destination, and sesv2 get-configuration-set-event-destinations is not implemented. make setup-all still fails if the create fails.

New workflow runs the three examples in a matrix: start LocalStack with lstk, deploy the CDK stack for sqs and sns, then make test.

Verified by CI.

https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM

Fix the SQS sample order and the SES topic lookup, add a make test target and test.sh per example, and run all three in a GitHub Actions matrix.

Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
lstk cdk looks for cdk on PATH, which only has it after a global install. The SES test prints the describe-configuration-set and sesv2 responses to show where the event destination is missing.

Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
LocalStack returns an empty EventDestinations list from describe-configuration-set and does not implement the sesv2 read, so the test relies on make setup-all failing if the create fails. Give the SQS test more time, since retries in one FIFO message group run in sequence.

Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
@HarshCasper
HarshCasper merged commit b945fa7 into main Oct 13, 2026
3 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