Skip to content

test:automation-runtime fails on main: processPendingAutomationRuns delivers 0 #81

Description

@jusso-dev

Found while validating PR #78 (#67). Pre-existing on main — reproduced identically on main and on the PR branch, against separately created, freshly migrated and seeded Postgres 16 containers, so it is not a regression from that work.

Symptom

npm run test:automation-runtime

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
0 !== 1
    at main (scripts/test-automation-runtime.ts:123:10)

scripts/test-automation-runtime.ts:123 asserts result.delivered === 1 after processPendingAutomationRuns(). It returns 0.

The assertions before it pass, so the run and the webhook delivery are both enqueued correctly — exactly one automation_runs row and one webhook_deliveries row for the case. Only the processing step delivers nothing.

Reproduction

  1. Fresh postgres:16-alpine and redis:7-alpine containers.
  2. npm run db:migrate && npm run db:seed
  3. DATABASE_URL=... REDIS_URL=... npm run test:automation-runtime

Observed on main at cb42368.

Why it matters

This is one of the suites agents are asked to run as a merge gate for automation and response-action work. While it fails on main, a genuine regression introduced by a future PR is indistinguishable from this baseline failure, so the gate is currently blind for this path.

Likely direction

Worth checking whether the test depends on an unstated local prerequisite (a listening webhook receiver, a BullMQ worker, or specific REDIS_URL semantics) rather than an actual defect in processPendingAutomationRuns. If it needs a prerequisite, the script should assert that prerequisite up front and fail with a clear message instead of a bare count mismatch.

Acceptance criteria

  • npm run test:automation-runtime either passes from a clean, documented starting state or fails with an explicit message naming the missing prerequisite.
  • Any prerequisite is documented alongside the script and in the repository's testing notes.
  • If a real defect in processPendingAutomationRuns is found, it is fixed with a regression test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexecution:readyNo unresolved issue dependency blocks starting this workpriority:p1High: core workflow or operational usability gap

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions