[test] Check that CockroachDB tables align with Diesel tables#9927
[test] Check that CockroachDB tables align with Diesel tables#9927
Conversation
e0a8612 to
7055677
Compare
| "bp_omicron_zone.underlay_address", | ||
| "inv_omicron_sled_config_dataset.sled_id", | ||
| "inv_omicron_sled_config_disk.sled_id", | ||
| "silo_group.active", | ||
| "tuf_trust_root.time_modified", |
There was a problem hiding this comment.
This PR is a work-in-progress, but FYI, this is how I uncovered the problem cases fixed in #9926
| pub columns: fn() -> Vec<(&'static str, &'static str)>, | ||
| } | ||
|
|
||
| #[distributed_slice] |
There was a problem hiding this comment.
This is sorta the implementation-specific artifact to come out of the table! macro in nexus/db-schema/src/schema.rs, but basically:
- I made a new
table!macro - looks and smells like the old table macro
- it also auto-registers the table with this big static list
This means that "just by declaring your table macro, we know your table exists", and you don't need to type the table name again in some big list somewhere else.
For folks updating schema.rs: it means there's no observable changes.
For our tests: We now know the list of all schema-declared tables, as well as the types of all columns within.
Aside: linkme is kinda dope
| // Check for Array<...> | ||
| let kind = if let Some(array_inner) = inner |
There was a problem hiding this comment.
Cockroach doesn't support nested arrays, fwiw, so this is as far as we'd go
|
As an FYI, my next step is going to be: "reduce the size of the exception-list EXPECTORATE files". But this PR really is the back-stop regression test which should prevent this problem from getting worse. |
Part of #9925