#!/usr/bin/env bash # Smoke test: list apps -> create a session -> ask a question -> check the tool was used. # Usage: ./test.sh (uses the Cloud Run URL from terraform output) # URL=http://localhost:8080 ./test.sh (local server) set -euo pipefail cd "$(dirname "$0")" URL=${URL:-$(terraform -chdir=terraform output -raw url)} TOKEN=$(gcloud auth print-identity-token) H=(-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json") SID="smoke-$(date +%s)" echo "== apps:"; curl -fsS "${H[@]}" "$URL/list-apps"; echo curl -fsS "${H[@]}" -X POST "$URL/apps/weather_agent/users/u1/sessions/$SID" -d '{}' >/dev/null echo "== session $SID created" curl -fsS "${H[@]}" -X POST "$URL/run" -d @- <