Skip to content

test: expand node:sqlite parity coverage#6467

Open
TheHypnoo wants to merge 1 commit into
mainfrom
test/expand-node-sqlite-parity
Open

test: expand node:sqlite parity coverage#6467
TheHypnoo wants to merge 1 commit into
mainfrom
test/expand-node-sqlite-parity

Conversation

@TheHypnoo

@TheHypnoo TheHypnoo commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

  • add 39 granular node:sqlite fixtures, expanding the module from 1 to 40 cases
  • cover deterministic in-memory database lifecycle/configuration, statements, binding, metadata, transactions, functions/aggregates, SQLTagStore, sessions, and authorizers
  • document the fixed Node 26.5.0 oracle, current Deno selection, Bun's lack of a node:sqlite selection, measured mismatches, and explicit risky exclusions
  • isolate the missing-extension probe in a unique temporary directory with deterministic cleanup
  • ratchet the measured SQLite baseline from 1/1 to 24/40

Verification

  • NODE=$HOME/.nvm/versions/node/v26.5.0/bin/node; for f in $(find test-parity/node-suite/sqlite -name '*.ts' | sort); do "$NODE" "$f"; done — 40/40 fixtures exited cleanly under Node 26.5.0
  • PATH=$HOME/.nvm/versions/node/v26.5.0/bin:$PATH PERRY_RUNTIME_DIR=$PWD/target/perry-dev python3 scripts/node_suite_run.py target/perry-dev/perry . sqlite — 24/40, 16 stable diffs; repeated twice with the same result
  • npm_config_cache=/tmp/perry-sqlite-npm-cache npx --yes prettier@3.6.2 --check 'test-parity/node-suite/sqlite/**/*.{ts,md}' — passed
  • python3 -m json.tool test-parity/node_suite_baseline.json — passed
  • git diff --check — passed
  • scripts/check_file_size.sh — passed

Stable diagnostic mismatches

  • numbered positional parameters; non-Uint8Array typed-array views; empty blob and symbol binding; missing Symbol.for("sqlite-type")
  • timeout/limit validation and limits enumerability; default DQS error classification; missing serialize/deserialize surface
  • function-valued aggregate starts; scalar varargs with SQL NULL; aggregate window result callback count; numeric expandedSQL formatting
  • iterator completion/reset invalidation; NUL prepare error classification; missing SQLite errcode constraint metadata

Upstream coverage and exclusions

The selection reviews all 18 SQLite files in Node 26.5.0's parallel suite and Deno's current tests/unit_node/sqlite_test.ts. Bun currently has bun:sqlite tests but no node:sqlite compatibility selection.

Deferred categories are file-backed/read-only databases, backup, permissions/locking/timeouts, real native extensions, optional SQLite compile features, concurrency/stress/GC/crash/corruption recovery, and the full changeset conflict matrix. These require separate filesystem or runtime/native batches and are documented in the suite README.

Summary by CodeRabbit

  • Documentation

    • Expanded SQLite compatibility documentation, including supported behavior, test coverage, boundaries, and diagnostic results.
  • Tests

    • Added extensive parity coverage for database lifecycle, bindings, statements, metadata, transactions, authorizers, functions, sessions, tag stores, serialization, limits, and extension-loading controls.
    • Updated SQLite baseline results to reflect the expanded test suite and current compatibility coverage.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9097b92f-db01-493f-96fe-76cc779cd1ea

📥 Commits

Reviewing files that changed from the base of the PR and between 949ac76 and 5d24c24.

📒 Files selected for processing (42)
  • test-parity/node-suite/sqlite/README.md
  • test-parity/node-suite/sqlite/authorizer/basic.ts
  • test-parity/node-suite/sqlite/authorizer/ignore-and-validation.ts
  • test-parity/node-suite/sqlite/binding/duplicate-and-ambiguous.ts
  • test-parity/node-suite/sqlite/binding/named-and-bare.ts
  • test-parity/node-suite/sqlite/binding/positional-and-numbered.ts
  • test-parity/node-suite/sqlite/binding/typed-array-views.ts
  • test-parity/node-suite/sqlite/binding/unknown-names.ts
  • test-parity/node-suite/sqlite/binding/value-types.ts
  • test-parity/node-suite/sqlite/database/config-and-location.ts
  • test-parity/node-suite/sqlite/database/disposal.ts
  • test-parity/node-suite/sqlite/database/exec-and-constraints.ts
  • test-parity/node-suite/sqlite/database/lifecycle.ts
  • test-parity/node-suite/sqlite/database/limits.ts
  • test-parity/node-suite/sqlite/database/options-validation.ts
  • test-parity/node-suite/sqlite/database/serialize-roundtrip.ts
  • test-parity/node-suite/sqlite/database/type-symbol.ts
  • test-parity/node-suite/sqlite/extension-loading/controls.ts
  • test-parity/node-suite/sqlite/functions/aggregate-direct-only.ts
  • test-parity/node-suite/sqlite/functions/aggregate-options.ts
  • test-parity/node-suite/sqlite/functions/aggregate-window.ts
  • test-parity/node-suite/sqlite/functions/aggregate.ts
  • test-parity/node-suite/sqlite/functions/scalar.ts
  • test-parity/node-suite/sqlite/functions/value-roundtrip.ts
  • test-parity/node-suite/sqlite/metadata/columns.ts
  • test-parity/node-suite/sqlite/metadata/result-toggles.ts
  • test-parity/node-suite/sqlite/metadata/sql-text.ts
  • test-parity/node-suite/sqlite/sessions/changeset-roundtrip.ts
  • test-parity/node-suite/sqlite/sessions/table-filter.ts
  • test-parity/node-suite/sqlite/statements/change-metadata.ts
  • test-parity/node-suite/sqlite/statements/iterate.ts
  • test-parity/node-suite/sqlite/statements/iterator-invalidation.ts
  • test-parity/node-suite/sqlite/statements/prepare-validation.ts
  • test-parity/node-suite/sqlite/statements/run-get-all.ts
  • test-parity/node-suite/sqlite/statements/special-column-names.ts
  • test-parity/node-suite/sqlite/tag-store/basic-operations.ts
  • test-parity/node-suite/sqlite/tag-store/capacity-and-eviction.ts
  • test-parity/node-suite/sqlite/tag-store/interpolation-safety.ts
  • test-parity/node-suite/sqlite/tag-store/validation-and-close.ts
  • test-parity/node-suite/sqlite/transactions/commit-rollback.ts
  • test-parity/node-suite/sqlite/transactions/constraint-errors.ts
  • test-parity/node_suite_baseline.json
 ____________________________
< Try...catch me if you can. >
 ----------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/expand-node-sqlite-parity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test-parity/node-suite/sqlite/binding/value-types.ts (1)

45-55: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use unique labels for the invalid value tests.

Using typeof value as the label results in duplicate test names for arrays/objects (invalid object) and for the two bigint boundaries (invalid bigint). Consider providing explicit, unique labels to make the parity logs clearer and avoid potential snapshot collisions.

♻️ Proposed refactor
-for (const value of [
-  undefined,
-  true,
-  {},
-  [],
-  Symbol("x"),
-  2n ** 63n,
-  -(2n ** 63n) - 1n,
-]) {
-  probe(`invalid ${typeof value}`, () => insert.run(value as any));
-}
+for (const [label, value] of [
+  ["undefined", undefined],
+  ["boolean", true],
+  ["object", {}],
+  ["array", []],
+  ["symbol", Symbol("x")],
+  ["bigint max", 2n ** 63n],
+  ["bigint min", -(2n ** 63n) - 1n],
+] as const) {
+  probe(`invalid ${label}`, () => insert.run(value as any));
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test-parity/node-suite/sqlite/binding/value-types.ts` around lines 45 - 55,
Replace the typeof-based labels in the invalid value loop with explicit unique
labels for every value, especially the array/object cases and both bigint
boundary cases. Keep the existing invalid-value coverage and insert.run behavior
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test-parity/node-suite/sqlite/binding/value-types.ts`:
- Around line 45-55: Replace the typeof-based labels in the invalid value loop
with explicit unique labels for every value, especially the array/object cases
and both bigint boundary cases. Keep the existing invalid-value coverage and
insert.run behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9097b92f-db01-493f-96fe-76cc779cd1ea

📥 Commits

Reviewing files that changed from the base of the PR and between 949ac76 and 5d24c24.

📒 Files selected for processing (42)
  • test-parity/node-suite/sqlite/README.md
  • test-parity/node-suite/sqlite/authorizer/basic.ts
  • test-parity/node-suite/sqlite/authorizer/ignore-and-validation.ts
  • test-parity/node-suite/sqlite/binding/duplicate-and-ambiguous.ts
  • test-parity/node-suite/sqlite/binding/named-and-bare.ts
  • test-parity/node-suite/sqlite/binding/positional-and-numbered.ts
  • test-parity/node-suite/sqlite/binding/typed-array-views.ts
  • test-parity/node-suite/sqlite/binding/unknown-names.ts
  • test-parity/node-suite/sqlite/binding/value-types.ts
  • test-parity/node-suite/sqlite/database/config-and-location.ts
  • test-parity/node-suite/sqlite/database/disposal.ts
  • test-parity/node-suite/sqlite/database/exec-and-constraints.ts
  • test-parity/node-suite/sqlite/database/lifecycle.ts
  • test-parity/node-suite/sqlite/database/limits.ts
  • test-parity/node-suite/sqlite/database/options-validation.ts
  • test-parity/node-suite/sqlite/database/serialize-roundtrip.ts
  • test-parity/node-suite/sqlite/database/type-symbol.ts
  • test-parity/node-suite/sqlite/extension-loading/controls.ts
  • test-parity/node-suite/sqlite/functions/aggregate-direct-only.ts
  • test-parity/node-suite/sqlite/functions/aggregate-options.ts
  • test-parity/node-suite/sqlite/functions/aggregate-window.ts
  • test-parity/node-suite/sqlite/functions/aggregate.ts
  • test-parity/node-suite/sqlite/functions/scalar.ts
  • test-parity/node-suite/sqlite/functions/value-roundtrip.ts
  • test-parity/node-suite/sqlite/metadata/columns.ts
  • test-parity/node-suite/sqlite/metadata/result-toggles.ts
  • test-parity/node-suite/sqlite/metadata/sql-text.ts
  • test-parity/node-suite/sqlite/sessions/changeset-roundtrip.ts
  • test-parity/node-suite/sqlite/sessions/table-filter.ts
  • test-parity/node-suite/sqlite/statements/change-metadata.ts
  • test-parity/node-suite/sqlite/statements/iterate.ts
  • test-parity/node-suite/sqlite/statements/iterator-invalidation.ts
  • test-parity/node-suite/sqlite/statements/prepare-validation.ts
  • test-parity/node-suite/sqlite/statements/run-get-all.ts
  • test-parity/node-suite/sqlite/statements/special-column-names.ts
  • test-parity/node-suite/sqlite/tag-store/basic-operations.ts
  • test-parity/node-suite/sqlite/tag-store/capacity-and-eviction.ts
  • test-parity/node-suite/sqlite/tag-store/interpolation-safety.ts
  • test-parity/node-suite/sqlite/tag-store/validation-and-close.ts
  • test-parity/node-suite/sqlite/transactions/commit-rollback.ts
  • test-parity/node-suite/sqlite/transactions/constraint-errors.ts
  • test-parity/node_suite_baseline.json

@proggeramlug proggeramlug added the ready PR triaged: CodeRabbit feedback + conflicts addressed label Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready PR triaged: CodeRabbit feedback + conflicts addressed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants