test: expand node:sqlite parity coverage#6467
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (42)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test-parity/node-suite/sqlite/binding/value-types.ts (1)
45-55: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse unique labels for the invalid value tests.
Using
typeof valueas 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
📒 Files selected for processing (42)
test-parity/node-suite/sqlite/README.mdtest-parity/node-suite/sqlite/authorizer/basic.tstest-parity/node-suite/sqlite/authorizer/ignore-and-validation.tstest-parity/node-suite/sqlite/binding/duplicate-and-ambiguous.tstest-parity/node-suite/sqlite/binding/named-and-bare.tstest-parity/node-suite/sqlite/binding/positional-and-numbered.tstest-parity/node-suite/sqlite/binding/typed-array-views.tstest-parity/node-suite/sqlite/binding/unknown-names.tstest-parity/node-suite/sqlite/binding/value-types.tstest-parity/node-suite/sqlite/database/config-and-location.tstest-parity/node-suite/sqlite/database/disposal.tstest-parity/node-suite/sqlite/database/exec-and-constraints.tstest-parity/node-suite/sqlite/database/lifecycle.tstest-parity/node-suite/sqlite/database/limits.tstest-parity/node-suite/sqlite/database/options-validation.tstest-parity/node-suite/sqlite/database/serialize-roundtrip.tstest-parity/node-suite/sqlite/database/type-symbol.tstest-parity/node-suite/sqlite/extension-loading/controls.tstest-parity/node-suite/sqlite/functions/aggregate-direct-only.tstest-parity/node-suite/sqlite/functions/aggregate-options.tstest-parity/node-suite/sqlite/functions/aggregate-window.tstest-parity/node-suite/sqlite/functions/aggregate.tstest-parity/node-suite/sqlite/functions/scalar.tstest-parity/node-suite/sqlite/functions/value-roundtrip.tstest-parity/node-suite/sqlite/metadata/columns.tstest-parity/node-suite/sqlite/metadata/result-toggles.tstest-parity/node-suite/sqlite/metadata/sql-text.tstest-parity/node-suite/sqlite/sessions/changeset-roundtrip.tstest-parity/node-suite/sqlite/sessions/table-filter.tstest-parity/node-suite/sqlite/statements/change-metadata.tstest-parity/node-suite/sqlite/statements/iterate.tstest-parity/node-suite/sqlite/statements/iterator-invalidation.tstest-parity/node-suite/sqlite/statements/prepare-validation.tstest-parity/node-suite/sqlite/statements/run-get-all.tstest-parity/node-suite/sqlite/statements/special-column-names.tstest-parity/node-suite/sqlite/tag-store/basic-operations.tstest-parity/node-suite/sqlite/tag-store/capacity-and-eviction.tstest-parity/node-suite/sqlite/tag-store/interpolation-safety.tstest-parity/node-suite/sqlite/tag-store/validation-and-close.tstest-parity/node-suite/sqlite/transactions/commit-rollback.tstest-parity/node-suite/sqlite/transactions/constraint-errors.tstest-parity/node_suite_baseline.json
Summary
node:sqlitefixtures, expanding the module from 1 to 40 casesnode:sqliteselection, measured mismatches, and explicit risky exclusionsVerification
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.0PATH=$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 resultnpm_config_cache=/tmp/perry-sqlite-npm-cache npx --yes prettier@3.6.2 --check 'test-parity/node-suite/sqlite/**/*.{ts,md}'— passedpython3 -m json.tool test-parity/node_suite_baseline.json— passedgit diff --check— passedscripts/check_file_size.sh— passedStable diagnostic mismatches
Uint8Arraytyped-array views; empty blob and symbol binding; missingSymbol.for("sqlite-type")NULL; aggregate window result callback count; numericexpandedSQLformattingerrcodeconstraint metadataUpstream 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 hasbun:sqlitetests but nonode:sqlitecompatibility 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
Tests