Skip to content

test: strengthen v5 unit coverage and fix uncovered regressions - #245

Merged
andrewzolotukhin merged 1 commit into
developmentfrom
test/v5-unit-coverage
Oct 5, 2026
Merged

andrewzolotukhin merged 1 commit into
developmentfrom
test/v5-unit-coverage

Conversation

@andrewzolotukhin

@andrewzolotukhin andrewzolotukhin commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Strengthen v5 unit coverage in ten high-risk libraries, with feature/module-grouped test files and stricter statement, branch, function and line floors. Existing source coverage inclusion/exclusion rules are unchanged; no tests or coverage paths are skipped.

Tests cover query execution and decoding, pagination and polymorphic reads, insert/conflict hooks, ORM identity tracking and concurrency failures, CLI routing and migrations, scheduler lifecycle and worker coordination, PostgreSQL storage and migrations, client transports and React hooks, multipart/WebSocket limits, nested mapping, form validation failures and deep utilities.

Measured coverage

Comparison against the successful Node 24 CI artifact for development commit 4d5efff2926b8a179075cfd5f5cc9e3419f1b411, using the same coverage configuration. Values are statement / branch percentages.

Package Before After
deep 78.88 / 88.62 98.74 / 98.40
mapper 93.90 / 83.90 98.78 / 90.24
react-form 95.50 / 89.47 99.47 / 96.84
scheduler 83.42 / 82.31 96.32 / 92.36
client 84.84 / 80.84 94.65 / 89.16
server 82.19 / 78.96 92.04 / 87.60
knex-schema 63.52 / 59.82 83.00 / 76.14
orm 81.00 / 61.67 92.07 / 80.62
orm-cli 61.23 / 62.86 98.68 / 97.14
scheduler-postgres 11.20 / 21.74 100.00 / 100.00
Overall 82.32 / 77.79 92.17 / 86.08

Historical v4 README badges are not a directly comparable baseline: coverage configuration changed, including TSX source inclusion. This PR uses an exact v5 baseline and refreshes badges from a complete passing run.

The database unit suites use real Knex compilation and a simulated driver boundary. They exercise SQL, bindings, decoding and error handling, but do not replace real PostgreSQL concurrency, transaction or lease tests. Real database suites and packaged-worker tests are retained, and this distinction is documented in CONTRIBUTING.

Bugs found and fixed

  • Circular object hashing no longer overflows the stack; golden tests preserve existing acyclic hashes and explicit exclusions.
  • useSubscription({ maxEvents: 0 }) keeps no event history while still exposing the last event.
  • Subscription middleware that responds without calling next() closes the WebSocket with policy-violation code 1008 instead of leaving it open.
  • Applying a default change no longer drops the column or ignores a new default. Generated default migrations no longer retype arbitrary columns to timestamps or change their nullability. Default-only DDL preserves stored data; literal quotes, question marks and backslashes have real PostgreSQL regressions. Generated down migrations restore the supplied previous default.

Each published behavior fix has a patch changeset and regression tests. Relevant API documentation is updated.

Validation

Full GitHub CI passed: lint/build/test, PostgreSQL query and scheduler integrations, S3 integration, demo API/browser/telemetry E2E, packed-package checks, documentation website builds and API-reference generation.

  • npm run lint — passed
  • npm run build — passed
  • npm run test — 293 files, 5,303 tests passed; no type errors
  • npm run test:coverage — passed; all published-package floors passed
  • npm run test:queries:integration — 102 tests passed against isolated PostgreSQL in UTC and America/Los_Angeles
  • npm run test:scheduler:integration — 12 tests passed against isolated PostgreSQL in UTC and America/Los_Angeles
  • npm run test:packages — 22 packages and 52 entry points passed (licenses, declarations, exports and browser bundle)
  • npm run typecheck:schema-site and npm run typecheck:docs-site — passed
  • npm audit --audit-level=high — passed; npm reports 3 low and 2 moderate existing dependency advisories, no high/critical findings (dependency changes are outside this coverage PR)

The existing CI also runs real PostgreSQL in UTC and America/Los_Angeles, S3 storage integration, demo API/browser/telemetry E2E, documentation builds and API-reference generation. No publication or merging is performed by this PR.

@andrewzolotukhin
andrewzolotukhin merged commit bd8b379 into development Oct 5, 2026
4 checks passed
@andrewzolotukhin
andrewzolotukhin deleted the test/v5-unit-coverage branch October 5, 2026 05:22
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