ai-assisted-todolist

Live tests#

The other layers test the code. This one tests a deployed environment from the outside, through CloudFront, the way a visitor reaches it — the part of qa that, until now, was checked by hand after each change, and where things fail that cannot fail anywhere else (#141).

It has three parts:

Part What it needs Issue
Smoke checks — everything that can be checked without signing in nothing: no account, no AWS role, no secret #142
The signed-in scenarios — tasks, two users kept apart and never served from a cache, sign-out qa's Cognito test accounts, with a password set per run #144
The app's flows — the released Android app signed in, changing tasks and attaching a file the same accounts, an Android emulator, and the release's app bundle #278

What the smoke checks check#

e2e/live/smoke.spec.ts, run with e2e/playwright.live.config.ts:

Group Check Would have caught
Frontend the app loads a broken site bucket or distribution
a deep link is the app with a 200 the SPA routing function gone (#110)
a missing asset is a 403, not the app routing that answers everything with index.html
index.html is no-cache, hashed assets immutable a deploy that broke deploy-frontend.yml's three passes
While down the page says Environment QA is paused at the moment., named by /environment.json the paused page lost, or the deploy no longer writing the name
API /api/auth/providers answers and offers Google the /api/* behaviour or the VPC origin broken
/api/tasks refuses without a session: 499 for a script, a redirect to Google for a navigation authentication switched off, or the app's HTML returned for an API path
/api/* is a Miss on a repeated request caching on the API, which would serve one user's answer to another
Sign in with Google ends at Google with redirect_uri=https://<host>/api/auth/callback the http/https return-address regression (#119)

The last one goes up to Google's door and not through it: following the button is checked, signing in at Google is not, because Google forbids automating that.

While the environment is down, and the containers serve /api/* there, CloudFront answers every /api request with a 503 and The backend is not running in this environment. An environment whose /api/* the Go backend serves, as qa's has since 2026-11-12 (#557), is never down in this sense: its API checks always run. e2e/live/backend-state.ts asks once, before the checks: the API checks then skip with that message, the frontend checks still run, because the site outlives down, and the paused page is checked — which in turn skips while the environment is up. The run summary says which of the two it was. Anything else that is not an answer — a 502, a timeout — is a failure, not a skip.

No retries. A live check that passes on the second attempt has found something flaky in the environment, which is worth a red run rather than a quiet green one.

The signed-in scenarios#

The same scenarios the Compose suite runs (e2e/tests/login.spec.ts and e2e/tests/attachments.spec.ts), with e2e/playwright.live-signed-in.config.ts, signed in as qa's Cognito test accounts (taskfest-test-one@example.com, taskfest-test-two@example.com, #190) instead of the local Keycloak ones. e2e/support/identity.ts is the only place the two differ: the button, how to fill in the provider's login page — Cognito's classic hosted UI carries its form twice, so only the visible one is addressed — and the accounts. One scenario runs in qa only: both accounts ask for /api/tasks straight after each other, and each must get a Miss from cloudfront and its own list (#120's check, automated).

The app's flows#

The released qa app (de.hilling.taskfest.qa) on an Android emulator, signed in as taskfest-test-one@example.com through Cognito's login page in the system browser — the job The app on qa, after the signed-in scenarios. Two Maestro flows in mobile/maestro/live/, each signing in first:

Flow What it does Would have caught
change-tasks.yaml adds a task, edits it, completes it, deletes it and takes the delete back the app and the deployed API disagreeing, or the app's sign-in on qa broken
attach.yaml adds a task, attaches an image through Android's file picker, and opens it qa's attachment bucket refusing the app's upload, or its signed links not reaching the phone

When it runs#

live-tests.yml, for qa only — prod has no live tests yet; the smoke checks first, then, if they passed, the signed-in scenarios, then the app's flows:

A failure fails the deploying run visibly. It rolls nothing back; whether to is a person's decision. On failure the Playwright report is uploaded as an artifact, and for the app, Maestro's screenshots.

Locally, against qa or anything else:

cd e2e
npm run test:live                                     # qa
LIVE_BASE_URL=https://example.test npm run test:live  # anywhere

Hourly traffic#

qa-traffic.yml sends qa ten anonymous requests every hour, a few seconds apart (#558): what a first visit sends, signed out -- the version and the sign-in providers, which answer 200, and /api/auth/me, whose 401 is how the website learns nobody is signed in. It is there so the dashboards -- CloudWatch's and the monitoring server's (observability.md) -- have something to draw between demos: one cold start an hour, then warm requests.

It is a smoke test as well: the run fails when a request answers otherwise three times running, so a passing hiccup does not count. GitHub mails a failed scheduled run to whoever last changed its schedule, if their notification settings for Actions say so. It sends nothing a visitor would not, but its four 401s an hour, 96 a day, are a floor under the dashboards' 4xx figures, which the access log, having no user agent, cannot tell from real ones. It does not sign in, which takes Cognito's login page in a browser, as the live tests above do after a deploy.

It assumes the Go backend serves qa's /api, which answers whether qa is up or down. Should qa go back to the containers, the repository variable QA_TRAFFIC=off pauses it, rather than a failure mail every hour while the environment is down. About 240 requests a day, a fraction of a cent a month on Lambda and API Gateway; Actions cost nothing for a public repository. GitHub runs a schedule when it can, sometimes minutes late, and turns it off after 60 days without a commit.

What it costs#

A few minutes of GitHub Actions per deploy, about ten more for the app's flows on the emulator. The smoke checks make no AWS calls; the signed-in scenarios and the app's flows each make two AdminSetUserPassword calls and one ListUserPools, which Cognito does not bill, and two monthly active users are far inside its free tier. The checks are only meaningful while qa is up (about $2 a day, cost); they never bring it up.