Skip to content

test(automations): multi-pod e2e for webhook trigger fires#3451

Merged
viktormarinho merged 1 commit into
mainfrom
viktormarinho/webhook-automations-e2e-tests
May 22, 2026
Merged

test(automations): multi-pod e2e for webhook trigger fires#3451
viktormarinho merged 1 commit into
mainfrom
viktormarinho/webhook-automations-e2e-tests

Conversation

@viktormarinho
Copy link
Copy Markdown
Contributor

@viktormarinho viktormarinho commented May 22, 2026

What is this contribution about?

Adds a real end-to-end test for the webhook trigger type introduced in #3426. Boots the full tests/multi-pod docker stack (real Postgres + NATS + DBOS + 3 studio pods + mock-ai) and drives the public path: AUTOMATION_CREATE + AUTOMATION_TRIGGER_ADD (type=webhook) on pod-1, real Authorization: Bearer POST to the callback URL against pod-2, then polls COLLECTION_THREADS_LIST filtered by trigger_ids until the agent run reaches status=completed. Cross-pod POST proves the fire works regardless of which pod DBOS picks for the workflow. A second scenario calls AUTOMATION_TRIGGER_ROTATE_TOKEN, asserts the old token is refused (401/403) while the new one still fires.

How to Test

  1. ./tests/multi-pod/run.sh — brings up the cluster, runs all scenarios, tears down.
  2. Or, with the cluster already up: bun test ./tests/multi-pod/scenarios/automation-webhook.test.ts.
  3. Expected: 2 pass / 0 fail, ~10s once the images are built.

Migration Notes

None.

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working
  • Documentation is updated (if needed)
  • No breaking changes

Summary by cubic

Adds a full end-to-end test for webhook-triggered automations that boots the tests/multi-pod cluster and confirms a cross-pod webhook POST triggers an agent run to completion. Also verifies AUTOMATION_TRIGGER_ROTATE_TOKEN by rejecting the old token (401/403) while the new token fires successfully.

Written for commit e58dc36. Summary will update on new commits. Review in cubic

Boots the full multi-pod docker cluster (real PG/NATS/DBOS) and
exercises the webhook callback path end-to-end: AUTOMATION_TRIGGER_ADD
on pod-1, POST against pod-2, poll until the agent run completes. Also
covers AUTOMATION_TRIGGER_ROTATE_TOKEN by asserting the old token is
refused after rotation while the new one still fires.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@viktormarinho viktormarinho merged commit 9bf2be3 into main May 22, 2026
12 checks passed
@viktormarinho viktormarinho deleted the viktormarinho/webhook-automations-e2e-tests branch May 22, 2026 18:56
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