Skip to content

Add CI that tests the dog API through both RDS proxies - #3

Merged
HarshCasper merged 2 commits into
mainfrom
ci/assert-dog-api
Oct 13, 2026
Merged

HarshCasper merged 2 commits into
mainfrom
ci/assert-dog-api

Conversation

@HarshCasper

@HarshCasper HarshCasper commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

The repo had no CI, and its integration test file was empty.

Sample fixes:

  • The functions connected to the proxy endpoint without a port, so JDBC used 5432. LocalStack returns the proxy endpoint as localhost.localstack.cloud and serves the database on the cluster port (4510), so every connection failed. Terraform now passes the cluster port, which on AWS is also the proxy port: HOST is endpoint:port for the secret auth functions.
  • put-dog reads DB_PORT to sign the IAM auth token, but Terraform never set it, so the function failed on init. Terraform now sets it, and the put-dog JDBC URL uses it.
  • get-dog, delete-dog and db-setup used the 3s default timeout, too short for a Java cold start plus a JDBC handshake. All functions now use 30s and 512 MB.
  • db-setup failed on a second run because CREATE USER token_user already existed. It now skips the user if present.
  • New outputs for both proxy endpoints.

Test:

  • New test.sh:
    • checks every function got its proxy endpoint, and invokes db-setup
    • POSTs a dog (secret auth proxy) and finds its id with the RDS Data API
    • GETs it (RDS Data API)
    • PUTs an update (IAM auth token through the IAM proxy) and checks the GET reflects it
    • DELETEs it and checks the GET returns 404
  • New make build, make init-db and make test targets. The README uses them.
  • New workflow builds the jars with Java 21, starts LocalStack with lstk, runs make deploy and make test.

Verified by CI.

https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM

Set DB_PORT for put-dog, raise Lambda timeouts for Java cold starts, make db-setup re-runnable, and add make build/init-db/test.

Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
LocalStack returns the proxy endpoint without a port, so JDBC fell back to 5432. Pass the cluster port, which matches the proxy port on AWS, and use it in the put-dog JDBC URL.

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

1 participant