Skip to content

Commit 9a9c8f1

Browse files
radimclaude
andcommitted
test: cover pg_introspect → snapshot conversion
Adds enum-mapping tests and a golden fixture catalog with a frozen content_hash to guard against silent drift in field ordering or upstream pg_introspect changes that would invalidate stored snapshots. Also runs cargo fmt across the workspace (server.rs). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4251f4c commit 9a9c8f1

5 files changed

Lines changed: 431 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/dry_run_cli/src/mcp/server.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,11 @@ impl DryRunServer {
15541554
annotated.schema.tables.len(),
15551555
annotated.schema.views.len(),
15561556
annotated.schema.functions.len(),
1557-
if annotated.planner.is_some() { "yes" } else { "no" },
1557+
if annotated.planner.is_some() {
1558+
"yes"
1559+
} else {
1560+
"no"
1561+
},
15581562
annotated.activity_by_node.len(),
15591563
);
15601564
*self.schema.write().await = Some(annotated);

crates/dry_run_core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ tracing = { workspace = true }
2121
zstd = { workspace = true }
2222

2323
[dev-dependencies]
24+
indexmap = "2"
2425
tokio = { workspace = true }
2526
tempfile = "3"

crates/dry_run_core/src/schema/from_pg_introspect.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,3 +317,7 @@ fn convert_extension(e: PgExtension) -> Extension {
317317
schema: e.schema,
318318
}
319319
}
320+
321+
#[cfg(test)]
322+
#[path = "from_pg_introspect_tests.rs"]
323+
mod tests;

0 commit comments

Comments
 (0)