Skip to content

Commit a3c71fc

Browse files
test(session-sync): run the CLI probe-refusal tests on a migrated DB
Cherry-picked from the macmini line, these two tests used temp_db. On this line, push/pull run the schema pre-flight before the remote probe, so an unmigrated temp DB refused with "schema v0 older than required" and the probe refusal under test was never reached. migrated_db yields the same (conn, path) with migrations applied. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent f419b6f commit a3c71fc

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎packages/agent-session-tools/tests/test_sync_remote_probe_and_seed.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,10 @@ def _never_seed(*_args, **_kwargs):
150150

151151

152152
class TestCliRefusesToActOnUnknownRemoteState:
153-
def test_push_aborts_before_seeding(self, temp_db, monkeypatch):
154-
_, db_path = temp_db
153+
def test_push_aborts_before_seeding(self, migrated_db, monkeypatch):
154+
# migrated_db, not temp_db: push runs the schema pre-flight before the
155+
# remote probe, and an unmigrated DB would refuse there instead.
156+
_, db_path = migrated_db
155157
monkeypatch.setattr(sync, "_remote_db_exists", _raise_probe_error)
156158
monkeypatch.setattr(sync, "_seed_remote_db", _never_seed)
157159
monkeypatch.setattr(sync, "_get_sync_state", _never_seed)
@@ -164,8 +166,8 @@ def test_push_aborts_before_seeding(self, temp_db, monkeypatch):
164166
assert "sqlite3 CLI not found" in result.output
165167
assert "left untouched" in result.output
166168

167-
def test_pull_aborts_before_reading_remote(self, temp_db, monkeypatch):
168-
_, db_path = temp_db
169+
def test_pull_aborts_before_reading_remote(self, migrated_db, monkeypatch):
170+
_, db_path = migrated_db
169171
monkeypatch.setattr(sync, "_remote_db_exists", _raise_probe_error)
170172
monkeypatch.setattr(sync, "_remote_sql", _never_seed)
171173

0 commit comments

Comments
 (0)