Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(config): verify decrypted storage url in recovery test

Steven Enamakel36d7bb667ed9
diff --git a/crates/openhuman-core/src/config/schema/load/source/revision_loader_tests.rs b/crates/openhuman-core/src/config/schema/load/source/revision_loader_tests.rs
index 05bdefae02..b6a68e8456 100644
--- a/crates/openhuman-core/src/config/schema/load/source/revision_loader_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load/source/revision_loader_tests.rs
@@ -214,5 +214,11 @@ async fn recovery_restores_the_bootstrap_file_when_document_cas_conflicts() {
let restored = tokio::fs::read_to_string(&recovered.config_path)
.await
.unwrap();
- assert!(restored.contains("sqlite:/bootstrap-from-recovered-file"));
+ let restored: toml::Value = toml::from_str(&restored).unwrap();
+ let storage_url = restored["storage"]["url"].as_str().unwrap();
+ let openhuman_dir = recovered.config_path.parent().unwrap();
+ let restored_url = crate::security::secret_storage::SecretStore::new(openhuman_dir, true)
+ .decrypt(storage_url)
+ .unwrap();
+ assert_eq!(restored_url, "sqlite:/bootstrap-from-recovered-file");
}