Skip to content

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

test(config): assert tenant-scoped loads share document version

Steven Enamakel9c87dbdb3b5b
diff --git a/crates/openhuman-core/src/config/schema/load/source/concurrency_tests.rs b/crates/openhuman-core/src/config/schema/load/source/concurrency_tests.rs
index cb76853940..9c0f10caa9 100644
--- a/crates/openhuman-core/src/config/schema/load/source/concurrency_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load/source/concurrency_tests.rs
@@ -141,19 +141,27 @@ async fn config_snapshot_cannot_be_saved_into_a_different_tenant_scope() {
keys(12),
);
config_at(tmp.path(), "tenant-a").save().await.unwrap();
- Config::load_from_config_path(&path, &workspace)
+ let config = Config::load_from_config_path(&path, &workspace)
.await
- .unwrap()
+ .unwrap();
+ let version = *config.document_version.lock().unwrap();
+ (config, version)
};
- {
+ let tenant_b_version = {
let _source = ForcedDocumentSource::new(
scoped(&storage, "tenant-source-b"),
Scope::new("tenant-source-b").unwrap(),
keys(12),
);
config_at(tmp.path(), "tenant-b").save().await.unwrap();
- }
+ let config = Config::load_from_config_path(&path, &workspace)
+ .await
+ .unwrap();
+ *config.document_version.lock().unwrap()
+ };
+ assert_eq!(from_tenant_a.1, tenant_b_version);
+ let (mut from_tenant_a, _) = from_tenant_a;
from_tenant_a.default_model = Some("must-not-cross-tenant-boundary".into());
let error = {