The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(inbound): consolidate inbound event domain and name coverage
Steven Enamakeld885c64b6065
diff --git a/crates/openhuman-core/src/core/events.rs b/crates/openhuman-core/src/core/events.rsindex 45ce23d938..43b2db8693 100644--- a/crates/openhuman-core/src/core/events.rs+++ b/crates/openhuman-core/src/core/events.rs@@ -1687,6 +1687,8 @@ impl DomainEvent {}}+mod variant_names;+#[cfg(test)]#[path = "events_tests.rs"]mod tests;diff --git a/crates/openhuman-core/src/core/events_tests.rs b/crates/openhuman-core/src/core/events_tests.rsindex c70ecfe483..a9de36216e 100644--- a/crates/openhuman-core/src/core/events_tests.rs+++ b/crates/openhuman-core/src/core/events_tests.rs@@ -420,33 +420,6 @@ fn all_variants_have_correct_domain() {},"notification",),- // Inbound event queues- (- DomainEvent::InboundEventDropped {- source: "composio:gmail".into(),- event_id: "e1".into(),- reason: "duplicate".into(),- },- "inbound",- ),- (- DomainEvent::InboundDeferred {- source: "composio:gmail".into(),- event_id: "e1".into(),- defer_until_ms: 1_000,- reason: "local model busy".into(),- },- "inbound",- ),- (- DomainEvent::InboundDeadLettered {- source: "webhook:t1".into(),- event_id: "c1".into(),- attempt: 5,- detail: "terminal".into(),- },- "inbound",- ),// System(DomainEvent::SystemStartup {@@ -1022,27 +995,3 @@ fn the_workspace_switch_announcement_is_not_itself_workspace_bound() {assert_eq!(event.variant_name(), "ActiveWorkspaceChanged");assert_eq!(DomainEvent::domain(&event), "system");}--#[test]-fn inbound_events_name_themselves() {- let dropped = DomainEvent::InboundEventDropped {- source: "s".into(),- event_id: "e".into(),- reason: "noise".into(),- };- assert_eq!(dropped.variant_name(), "InboundEventDropped");- let deferred = DomainEvent::InboundDeferred {- source: "s".into(),- event_id: "e".into(),- defer_until_ms: 1,- reason: "r".into(),- };- assert_eq!(deferred.variant_name(), "InboundDeferred");- let dead = DomainEvent::InboundDeadLettered {- source: "s".into(),- event_id: "e".into(),- attempt: 1,- detail: "d".into(),- };- assert_eq!(dead.variant_name(), "InboundDeadLettered");-}diff --git a/crates/openhuman-core/src/inbound/route_tests.rs b/crates/openhuman-core/src/inbound/route_tests.rsindex 6c4147263e..a9f8f9ef32 100644--- a/crates/openhuman-core/src/inbound/route_tests.rs+++ b/crates/openhuman-core/src/inbound/route_tests.rs@@ -55,3 +55,39 @@ async fn an_unreachable_module_sends_the_event_down_the_direct_path() {let offered = offer(&active_config(), &client, event("u3")).await;assert!(matches!(offered, Offered::Direct(ref why) if why.contains("ingest failed")));}++#[test]+fn inbound_events_belong_to_the_inbound_domain_and_name_themselves() {+ use crate::core::events::DomainEvent;+ for (event, name) in [+ (+ DomainEvent::InboundEventDropped {+ source: "composio:gmail".into(),+ event_id: "e1".into(),+ reason: "duplicate".into(),+ },+ "InboundEventDropped",+ ),+ (+ DomainEvent::InboundDeferred {+ source: "composio:gmail".into(),+ event_id: "e1".into(),+ defer_until_ms: 1_000,+ reason: "busy".into(),+ },+ "InboundDeferred",+ ),+ (+ DomainEvent::InboundDeadLettered {+ source: "webhook:t1".into(),+ event_id: "c1".into(),+ attempt: 5,+ detail: "terminal".into(),+ },+ "InboundDeadLettered",+ ),+ ] {+ assert_eq!(event.domain(), "inbound");+ assert_eq!(event.variant_name(), name);+ }+}