Skip to content

test: cover durable object request and alarm paths - #159

Open
ScryUser wants to merge 1 commit into
outerbase:mainfrom
ScryUser:add-durable-object-coverage
Open

ScryUser wants to merge 1 commit into
outerbase:mainfrom
ScryUser:add-durable-object-coverage

Conversation

@ScryUser

Copy link
Copy Markdown

/claim #71

Summary

  • Expands the Durable Object test harness so src/do.test.ts can exercise storage alarms, ctx.getTags, environment auth tokens, and fresh SQL cursors per test.
  • Adds focused coverage for default temporary table setup, init() helper bindings, statistics, alarm scheduling and recovery errors, raw query metadata, transaction error propagation, socket upgrade routing, websocket message/error/close cleanup, broadcast filtering, and cron callback auth/retry behavior.
  • Test-only change; no production behavior is changed.

Verification

  • \.\node_modules\.bin\prettier.cmd --check src/do.test.ts passed.
  • git diff --check -- src/do.test.ts passed.
  • \.\node_modules\.bin\vitest.cmd run src/do.test.ts passed: 26 tests.
  • \.\node_modules\.bin\vitest.cmd run src/do.test.ts --coverage --coverage.reporter=text passed the focused test file; the command exits 1 only because global coverage thresholds are evaluated while a single test file is selected. The focused report shows src/do.ts at 100% statements, 79.41% branches, 100% functions, and 100% lines.
  • \.\node_modules\.bin\vitest.cmd run still has the existing unrelated RLS baseline failures in src/rls/index.test.ts:
    • applyRLS - Query Modification > should modify SELECT queries with WHERE conditions
    • applyRLS - Multi-Table Queries > should apply RLS policies to tables in JOIN conditions
    • applyRLS - Multi-Table Queries > should apply RLS policies to multiple tables in a JOIN
    • applyRLS - Multi-Table Queries > should apply RLS policies to subqueries inside FROM clause

Advertised bounty: $250 via Algora on #71.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant