This commit is contained in:
Mateusz Gruszczyński committed 2026-10-04 22:53:33 +02:00
1 parent 174389e5b1
commit e6604e41fc
73 files changed
+1240 -201

No files matched your search

+22
View File
@@ -36,6 +36,28 @@ mod tests {
assert_eq!(data.config.transform.max_inflight, 64);
reopened.close().await;
}
#[tokio::test]
async fn configuration_history_keeps_revision_documents_and_actor() {
let dir = tempfile::tempdir().unwrap();
let file = dir.path().join("history.sqlite3");
let store = Store::open(&file, &Config::default()).await.unwrap();
let mut first = Config::default();
first.server_header.value = "first".into();
assert!(store.replace_as(0, &first, "alice").await.unwrap());
let mut second = first.clone();
second.server_header.value = "second".into();
assert!(store.replace_as(1, &second, "bob").await.unwrap());
let history = store.configuration_history(10).await.unwrap();
assert_eq!(history[0].revision, 2);
assert_eq!(history[0].actor, "bob");
assert_eq!(history[1].revision, 1);
let detail = store.configuration_revision(2).await.unwrap().unwrap();
assert_eq!(detail.config.server_header.value, "second");
assert_eq!(detail.previous_revision, Some(1));
assert_eq!(detail.previous_config.unwrap().server_header.value, "first");
store.close().await;
}
#[tokio::test]
async fn certificate_renewal_observations_survive_reopen_in_schema_v3() {
let dir = tempfile::tempdir().unwrap();