Skip to content

Commit 7b8e83c

Browse files
committed
test(duckdb): fix rebase-ported mirror tests for schema v4
Make the probe schema-drift assertions relative to SchemaVersion so the v4 bump keeps 'newer mirror' meaning newer than current, clear the stored push fingerprint in the provenance re-push test so the session-replace path actually runs, and drop the snapshot-count helper orphaned by the removal of the pre-pareback tombstone test.
1 parent 601c742 commit 7b8e83c

2 files changed

Lines changed: 5 additions & 20 deletions

File tree

internal/duckdb/probe_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ func TestProbeMirrorReadsMetadataAndFlagsShapeIssues(t *testing.T) {
5555
assert.True(t, p.NeedsRebuild("", 69))
5656
assert.True(t, p.NeedsRebuild(canonicalPushScope([]string{"p"}, nil), 68))
5757
older := p
58-
older.SchemaVersion = 2
58+
older.SchemaVersion = SchemaVersion - 1
5959
assert.True(t, older.NeedsRebuild("", 68))
6060
newer := p
61-
newer.SchemaVersion = 4
61+
newer.SchemaVersion = SchemaVersion + 1
6262
assert.True(t, newer.NeedsRebuild("", 68))
6363
}
6464

internal/duckdb/sync_test.go

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,23 +2186,6 @@ func assertDuckDBCountWhere(
21862186
assert.Equal(t, want, got, table)
21872187
}
21882188

2189-
func assertDuckDBSnapshotCount(
2190-
t *testing.T,
2191-
conn *sql.DB,
2192-
archiveID, generation, sessionID, project string,
2193-
want int,
2194-
) {
2195-
t.Helper()
2196-
var got int
2197-
require.NoError(t, conn.QueryRow(`
2198-
SELECT COUNT(*) FROM source_session_project_identity_snapshots
2199-
WHERE source_archive_id = ? AND source_database_generation = ?
2200-
AND source_session_id = ? AND project = ?`,
2201-
archiveID, generation, sessionID, project,
2202-
).Scan(&got))
2203-
assert.Equal(t, want, got, "source_session_project_identity_snapshots")
2204-
}
2205-
22062189
func TestSyncResultDurationIsSet(t *testing.T) {
22072190
ctx := context.Background()
22082191
local := newLocalDB(t)
@@ -2248,7 +2231,9 @@ func TestDuckPushWritesSessionProvenance(t *testing.T) {
22482231
conn, err := Open(path)
22492232
require.NoError(t, err)
22502233
_, err = conn.ExecContext(ctx,
2251-
`UPDATE sessions SET source_archive_id = '' WHERE id = ?`, "sess-1")
2234+
`UPDATE sessions
2235+
SET source_archive_id = '', agentsview_push_fingerprint = NULL
2236+
WHERE id = ?`, "sess-1")
22522237
require.NoError(t, err)
22532238
require.NoError(t, conn.Close())
22542239

0 commit comments

Comments
 (0)