mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-15 20:20:38 +00:00
This is the first step towards representing all of Pageserver configuration as clean `serde::Serialize`able Rust structs in `pageserver_api`. The `neon_local` code will then use those structs instead of the crude `toml_edit` / string concatenation that it does today. refs https://github.com/neondatabase/neon/issues/7555 --------- Co-authored-by: Alex Chi Z <iskyzh@gmail.com>
23 lines
566 B
Rust
23 lines
566 B
Rust
use super::*;
|
|
|
|
#[test]
|
|
fn test_node_metadata_v1_backward_compatibilty() {
|
|
let v1 = serde_json::to_vec(&serde_json::json!({
|
|
"host": "localhost",
|
|
"port": 23,
|
|
"http_host": "localhost",
|
|
"http_port": 42,
|
|
}));
|
|
|
|
assert_eq!(
|
|
serde_json::from_slice::<NodeMetadata>(&v1.unwrap()).unwrap(),
|
|
NodeMetadata {
|
|
postgres_host: "localhost".to_string(),
|
|
postgres_port: 23,
|
|
http_host: "localhost".to_string(),
|
|
http_port: 42,
|
|
other: HashMap::new(),
|
|
}
|
|
)
|
|
}
|