Skip to content

Expand staging test suite: full status-transition coverage - #3

Closed
darreneid wants to merge 1 commit into
stagingfrom
expand-staging-test-suite
Closed

Expand staging test suite: full status-transition coverage#3
darreneid wants to merge 1 commit into
stagingfrom
expand-staging-test-suite

Conversation

@darreneid

Copy link
Copy Markdown
Collaborator

Builds on the staging suite (#2, now merged) with much broader coverage.

Added

  • api_update transition matrix — all 12 ordered status pairs among new/open/snoozed/closed, each asserting the recorded row (from/to, source=api_update, acting user_id, null post_id, non-negative duration).
  • Full post_created branches:
    • Customer reply reopening snoozed → open; closed → open (recent + last-assigned, reassigned), → new (no last-assignee), → new (closed > 1 month ago).
    • Customer reply to new/open → sets waiting_*, no row.
    • Admin whisper reopening snoozed → open; closed → open/new; open → no change/no row (skips if whispers disabled).
    • Admin regular reply → clears waiting_*, no row.
  • Edge cases: invalid status → 422; no-op status → no row; row attributed to the pre-change assignee.

27 checks total (the matrix expands from one loop).

Rate limits

api() now honors 429s (waits the server-provided wait_seconds, bounded) so a full run (~30 topics) completes even on rate-limited instances.

Testing

Validated against a local Discourse dev instance with Data Explorer (real HTTP + real TopicStatusChange rows): 27/27 pass, including the auto-wait path, with cleanup.

🤖 Generated with Claude Code

Add an api_update transition matrix covering all 12 ordered status pairs, plus
the full set of post_created branches (customer/whisper/admin-reply, including
the closed-reopen variants and the 1-month rule) and waiting_* behavior. Honor
Discourse rate limits (429) with bounded auto-wait so large runs complete on
throttled instances.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@darreneid

Copy link
Copy Markdown
Collaborator Author

Superseded by #4 — the exhaustive status-transition coverage now lives as CI-gated rspec (no staging/API-key/DB limits, and it covers the no-status case the API suite couldn't reach). The thin API smoke suite from #2 remains in staging for post-deploy checks.

@darreneid darreneid closed this Jul 28, 2026
@darreneid
darreneid deleted the expand-staging-test-suite branch July 28, 2026 21:02
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