Skip to content

test(windows): restore consolidation coverage#452

Merged
ScriptedAlchemy merged 2 commits into
masterfrom
fix/user-message-search-storage-scope
Jul 11, 2026
Merged

test(windows): restore consolidation coverage#452
ScriptedAlchemy merged 2 commits into
masterfrom
fix/user-message-search-storage-scope

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Follow-up to #450. That PR merged while GitHub still cached head 6a33ffe4; two already-pushed descendants were not included in the merge.

This restores the Windows consolidation suite that an overlapping session temporarily gated while diagnosing Windows byte-range locking. The suite must execute, not disappear.

Correctness

  • Re-enables src/migrate/consolidate/tests.rs on Windows.
  • Keeps the narrowly scoped test-only Windows offline-guard replacement from fix(windows): secure lifecycle handoff #450. Production remains fail-closed because Windows open-holder discovery is unsupported; isolated unit fixtures can exercise backup, merge, verification, restart, and recovery semantics without BEGIN IMMEDIATE preventing the same process from reading its own database files.
  • Expands the patch changeset to describe the durable copy, lifecycle, unsupported-service, and Windows recovery work actually shipping.

Why this follow-up is required

Windows SQLite uses byte-range locks. The real production safety gate rejects consolidation before mutation when holder discovery cannot prove the profile offline. Unit fixtures are isolated and separately test that fail-closed production policy. Holding a Windows BEGIN IMMEDIATE while then copying the fixture database tests an impossible same-process lock arrangement rather than migration behavior, so only that fixture guard is substituted.

The prior broad #[cfg(all(test, not(windows)))] removed all 36 consolidation tests and could let future Windows regressions ship silently. This PR restores the platform-neutral suite and lets CI prove the scoped fixture isolation works.

Validation

  • cargo check --tests --target x86_64-pc-windows-gnu: passed
  • cargo clippy --all-targets --all-features -- -D warnings: passed
  • Linux consolidation suite: passed
  • Windows CI will execute the complete sharded suite
  • formatting and diff checks: passed

Do not merge release PR #451 until this follow-up is green and merged.

@changeset-bot

changeset-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 757fdb7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 757fdb79f1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

#[cfg(all(test, not(windows)))]
#[cfg(test)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Gate the Windows-incompatible test assertion

With this cfg widened, the full consolidation suite now runs on Windows, but untracked_branch_databases_are_recovered_into_the_destination still compares a recovered db_file string to the Unix-only literal "branches/orphan-target.db". On Windows that recovered value is built from a filesystem relative path via relative.to_str(), so it uses backslashes (branches\\orphan-target.db), making the assertion false and keeping Windows CI red whenever this suite runs; normalize the assertion or keep that specific test gated.

Useful? React with 👍 / 👎.

@ScriptedAlchemy ScriptedAlchemy merged commit fc89e8b into master Jul 11, 2026
10 of 16 checks passed
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