Skip to content

fix(issue-162): extract generateInvite test helper + harden CI smoke-test polling - #171

Open
luandro wants to merge 3 commits into
mainfrom
agent/comapeo-cloud-app/issue-162
Open

fix(issue-162): extract generateInvite test helper + harden CI smoke-test polling#171
luandro wants to merge 3 commits into
mainfrom
agent/comapeo-cloud-app/issue-162

Conversation

@luandro

@luandro luandro commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Changes

Implements #162 via autonomous Pool pipeline.

This PR bundles two concerns:

  1. Test refactor — extract a shared generateInvite helper in the SettingsScreen tests.
  2. CI flakiness fix — smoke-test jobs now poll /api/info until Cloudflare Pages Functions finish propagating before asserting the expected 400, with smoke-test timeouts bumped accordingly.

CI hardening (frontier review follow-up)

  • Add || true to the curl status probe in all three smoke-test jobs (preview, staging, prod). Under GitHub Actions' default bash -e, a connection-level curl failure (DNS not ready / connection refused during propagation) aborted the whole step before the retry loop could run.
  • Skip the sleep on the final poll attempt and emit an accurate "giving up" message instead of a misleading "retrying...".
  • Bump smoke-test-staging timeout 5 → 6 (it uses the longest curl retries plus the 15s poll, so its worst-case wait exceeds the preview/prod jobs bumped 3 → 5).

Verification

  • tsc --noEmit, vitest (unit), eslint src/ gate passed
  • Review: PASSED
  • CI polling loop verified locally under bash -e: survives simulated connection failures, reaches 400, and the all-fail path exits 1 with no wasted final sleep. YAML validated.

Closes #162

@luandro
luandro marked this pull request as ready for review July 30, 2026 02:57
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Preview deployment ready: https://agent-comapeo-cloud-app-issu-1jme.comapeo-cloud-app.pages.dev

Commit: f49e4e7

@luandro luandro added agent:pr-readiness-in-progress PR lifecycle label agent:pr-needs-human PR needs human decision labels Jul 30, 2026
The preview smoke test failed with "Expected 400 ... got 404" because it
probed /api/info once, ~8s after "Deployment complete". Cloudflare Pages
Functions take a few seconds to propagate; until they are live, /api/*
falls through to the static 404 handler. A live probe minutes later returns
the correct 400.

Replace the single-shot probe with a poll that retries until the function
answers 400, while still asserting the final status is exactly 400 (no
suppression). Applied to the identical preview/staging/prod blocks; bumped
those smoke jobs to a 5m timeout to absorb the worst-case poll.

Co-Authored-By: Claude <noreply@anthropic.com>
Address frontier review on PR #171:

- Add `|| true` to the curl status probe in all three smoke-test jobs
  (preview, staging, prod). Under GitHub Actions' default `bash -e`,
  a connection-level curl failure (DNS not ready / connection refused
  during Pages Function propagation) made the assignment exit non-zero
  and aborted the whole step before the retry loop could run.
- Skip the sleep on the final attempt and emit an accurate 'giving up'
  message instead of a misleading 'retrying...', avoiding a wasted
  10s/15s wait right before the hard failure.
- Render an empty probe result as 'none' for readable logs.
- Bump smoke-test-staging timeout 5 -> 6: it uses the longest curl
  retries (--retry 10 --retry-delay 15) plus the new 15s poll, so its
  worst-case wait exceeds the preview/prod jobs that were bumped 3 -> 5.

Verified locally: loop survives simulated connection failures under
set -e, reaches 400, and the all-fail path exits 1 after exactly 5
sleeps (no wasted final sleep). YAML validated.

Co-Authored-By: Claude <noreply@anthropic.com>
@luandro luandro changed the title fix(issue-162): refactor(test): extract shared generateInvite helper in SettingsScreen tests fix(issue-162): extract generateInvite test helper + harden CI smoke-test polling Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:pr-needs-human PR needs human decision agent:pr-readiness-in-progress PR lifecycle label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(test): extract shared generateInvite helper in SettingsScreen tests

1 participant