Skip to content

test(windows): read settings files via cygpath in sqlite readfile() (#184)#187

Draft
fujibee wants to merge 1 commit into
mainfrom
fix/windows-delivery-paths
Draft

test(windows): read settings files via cygpath in sqlite readfile() (#184)#187
fujibee wants to merge 1 commit into
mainfrom
fix/windows-delivery-paths

Conversation

@fujibee

@fujibee fujibee commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Fixes the cluster of delivery set failures on the windows-latest (full, experimental) leg tracked in #184.

Root cause

The delivery tests assert on what delivery set writes by reading the file back through sqlite3 readfile(). On native Windows / Git Bash, sqlite3 reads only a Windows path (C:\Users\...), not a POSIX one (/c/... or /tmp/...) — an unconverted path reads back empty, so json_extract / json_valid see nothing and the assertion fails even though the file the script wrote is correct and valid. Production already converts these paths with cygpath -w (sql_readfile_path / agmsg_sql_readfile_path); the test harness did not. So these were a test-harness path-form gap, not a delivery bug.

Fix

No production behavior changes. Off Windows the helper is a pass-through, so Linux/macOS stay green (delivery + team: 136/0 locally). Pushed as a draft to let the windows-latest leg confirm the #184 tests go green.

Diagnosis confirmed on a real Windows 11 + Git Bash environment by @Tsuki8825 in #184 (writefile via a C:\ path is clean/valid; a POSIX path writes 0 bytes).

…184)

The delivery tests assert on the JSON that 'delivery set' writes by reading it
back through sqlite3 readfile(). On native Windows / Git Bash, sqlite3 only
reads a Windows path (C:\Users\...), not a POSIX one (/c/... or /tmp/...) — an
unconverted path reads back as empty, so json_extract/json_valid see nothing and
the assertion fails even though the file the script wrote is correct and valid.

Production already converts these paths with cygpath -w (sql_readfile_path /
agmsg_sql_readfile_path); the test harness did not. Add an rf() helper (cygpath
-w + SQL-literal escape, a no-op off Windows) and route every readfile('<path>')
in the delivery/team tests through it. This makes the #184 'wrong count /
invalid JSON' failures on the windows-latest experimental leg pass without
changing any production behavior — they were a test-harness path-form gap, not a
delivery bug. The #134 quoted-path cases stay as-is (already SQL-escaped, skipped
on Windows).

Confirmed on the windows-latest full leg: all 13 #184 delivery tests (A/B/C,
incl. the #95 E2BIG large-settings round-trips) pass with this change.

Diagnosis confirmed on a real Windows 11 + Git Bash environment by @Tsuki8825
in #184 (writefile via a C:\ path is clean/valid; a POSIX path writes 0 bytes).
@fujibee fujibee force-pushed the fix/windows-delivery-paths branch from 7338828 to e1d9529 Compare June 22, 2026 04:58
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