ReviewOS

stacks/bun-query-builder

test: make JSON helper smoke test dialect-independent

#1165
Closed chris opened this 8 days ago ·
8 days ago

Problem

client.like-json-helpers.test.ts calls whereJsonContains('prefs', { theme: 'dark' }) without fixing the dialect. The helper intentionally rejects object containment on SQLite, so the test outcome depends on process-global dialect state left by earlier files.

This surfaced in the main CI run for 14e3599: https://github.com/stacksjs/bun-query-builder/actions/runs/35781587348

The failing run used Bun 1.4.2 and executed the test with SQLite configured. The same test passes when earlier files leave PostgreSQL configured.

Expected

The smoke test should use a containment operand supported by every dialect it may inherit, or explicitly own and restore its dialect configuration. The full test suite should pass regardless of file order and prior global configuration.

Acceptance

  • Make the helper smoke test dialect-independent.
  • Run the focused test on SQLite and PostgreSQL configuration paths.
  • Run the full suite with Bun 1.4.2.
  • Link the fixing commit and green CI run here.
8 days ago

Fixed on main in b6df9d9.

The smoke test now uses a nonempty array operand supported by the SQLite, PostgreSQL, and MySQL branches. This preserves the intended WHERE assertion while removing dependence on process-global dialect state from prior test files.

Validation on Bun 1.4.2:

  • Focused default PostgreSQL path: 4 pass, 0 fail
  • Focused explicit SQLite path: 4 pass, 0 fail
  • Full local suite: 2,297 pass, 19 skip, 0 fail
  • Type checking and changed-file pickier lint pass
  • Independent standards and spec reviews report no findings
  • Final CI is green, including the live PostgreSQL and MySQL test job

Sign in to comment on this issue.