You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wheels.tests.specs.migrator.addColumnOptionsSpec ("symmetric default handling for string-like types (F17)") asserts that generated SQL contains or omits a DEFAULT clause via exact-substring matching. The assertion fires on CockroachDB and Postgres on every engine — it's a portable test bug, not engine-specific.
But each DB adapter emits the same logical DEFAULT clause with slightly different surface syntax:
Adapter
String column with default=''
Boolean with default=true
MySQL
DEFAULT NULL
DEFAULT 1
Postgres
DEFAULT ''
DEFAULT true
CockroachDB
DEFAULT ''
(similar to PG)
SQL Server
(no DEFAULT emitted)
DEFAULT 1
SQLite
(no DEFAULT emitted for empty string)
(similar)
The spec was written against one engine's exact output and the substring match catches all of them.
Expected behavior
Either:
The spec asserts on behavior (call the migrator, inspect the resulting schema via $dbinfo / native introspection), not on the SQL string — best long-term shape.
The spec parameterizes the expected substring per DB adapter via an adapter-specific lookup table.
Suggested fix shape
Lowest-effort option: rewrite addColumnOptionsSpec assertions to use behavior-driven checks (does the column exist? does it have the expected default?). Or, if SQL-string assertions are intentional, add per-adapter expected-value tables.
Pure test edit — no framework changes. Will pass on every engine once fixed.
General testing principle worth capturing in CLAUDE.md or .ai/wheels/testing/: don't assert on generated SQL strings from cross-engine adapters. The string is the wrong abstraction layer — assert on schema state or query results instead. The repo CLAUDE.md already documents many cross-engine SQL surface differences (boolean serialization, identifier quoting, etc.); this test should respect them.
Describe the bug
wheels.tests.specs.migrator.addColumnOptionsSpec("symmetric default handling for string-like types (F17)") asserts that generated SQL contains or omits aDEFAULTclause via exact-substring matching. The assertion fires on CockroachDB and Postgres on every engine — it's a portable test bug, not engine-specific.Evidence
Compat-matrix run #25837380625 (2026-05-13).
17 occurrences total — 9 on BoxLang, 8 on Lucee 6, all on
cockroachdb+postgres. Adobe/SQL Server/MySQL/SQLite pass.Representative messages:
The needle [DEFAULT] was found in [DEFAULT '']The needle [DEFAULT] was found in [ DEFAULT ]The needle [DEFAULT] was not found in [ NULL](MySQL — different shape)The needle [DEFAULT 1] was not found in [ DEFAULT true](PG — boolean serialization)Root cause
Pure test problem. The spec asserts on raw generated SQL strings:
expect(sql).toInclude("DEFAULT "); // brittle expect(sql).toNotInclude("DEFAULT"); // brittleBut each DB adapter emits the same logical
DEFAULTclause with slightly different surface syntax:default=''default=trueDEFAULT NULLDEFAULT 1DEFAULT ''DEFAULT trueDEFAULT ''DEFAULT 1The spec was written against one engine's exact output and the substring match catches all of them.
Expected behavior
Either:
$dbinfo/ native introspection), not on the SQL string — best long-term shape.Suggested fix shape
Lowest-effort option: rewrite
addColumnOptionsSpecassertions to use behavior-driven checks (does the column exist? does it have the expected default?). Or, if SQL-string assertions are intentional, add per-adapter expected-value tables.Pure test edit — no framework changes. Will pass on every engine once fixed.
Additional context
Related: #2649