Repository navigation
Add CI that checks weather lookups are stored and served - #3
Merged
Merged
Conversation
Add test.sh and a workflow that deploy the app to LocalStack, check the weather for a city through API Gateway and read it back from the history API. CI serves the OpenWeather responses from an S3 stub, so it needs no API key. Connect to the RDS proxy on the cluster port, and make db-setup safe to run twice. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
terraform-local used 'OPTIONS /weather/' and 'OPTIONS /history/'. API Gateway rejects a route key with an empty path part, so the deploy failed. terraform/ already uses '/{location}'.
Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo had no CI and no test.
test.sh(make test):db-setupand expects a 200GET /dev/weather/{location})GET /dev/history/{location}, which proves the weather Lambda wrote both rows through the RDS proxyOPEN_WEATHER_BASE_URL(default: the real API). CI points it at an S3 object, and the test fills it with the fixtures intests/fixtures:niceWeather: trueniceWeather: false$CITY(default London) and checks the response shape only.make build,make deployandmake test. On failure it prints the Lambda logs and LocalStack logs.Sample fixes:
terraform-localpassed the proxy endpoint without a port, so JDBC used 5432. LocalStack serves the database on the cluster port, soHOSTis now<proxy endpoint>:<cluster port>.terraform-localused the route keysOPTIONS /weather/andOPTIONS /history/, which API Gateway rejects ("Part of the given route key path is empty"), so the deploy failed. They now matchterraform/:OPTIONS /weather/{location}andOPTIONS /history/{location}.db-setupfailed on a second run. It now usesCREATE TABLE IF NOT EXISTS.weather-lambdaanddb-setup-lambdaare rebuilt from the changed sources.make buildandmake testtargets, and a README section on testing.Verified by CI.
https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM