Skip to content

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

chore(channels): move test module declaration to end of file

Steven Enamakel0cf8b6c6f6fd
diff --git a/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs b/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
index ac85f5e10e..b8136b818b 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
@@ -482,10 +482,6 @@ impl Channel for ModuleChannel {
}
}
-#[cfg(test)]
-#[path = "module_providers_tests.rs"]
-mod tests;
-
impl ModuleChannel {
pub(super) async fn send_progressive_typed(
&self,
@@ -596,3 +592,7 @@ impl ModuleChannel {
}
}
}
+
+#[cfg(test)]
+#[path = "module_providers_tests.rs"]
+mod tests;
diff --git a/crates/openhuman-core/src/channels/runtime/startup/module_providers_tests.rs b/crates/openhuman-core/src/channels/runtime/startup/module_providers_tests.rs
index 12e3dd5cbb..85b80c8c9e 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/module_providers_tests.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/module_providers_tests.rs
@@ -10,10 +10,8 @@ use wiremock::{Mock, MockServer, ResponseTemplate};
#[tokio::test]
async fn compiled_module_progressive_send_reenters_typed_callback_without_deadlock() {
- let _env = EnvVarGuard::locked_set_async("OPENHUMAN_TELEGRAM_BOT_API_BASE", "http://unused")
- .await;
let server = MockServer::start().await;
- let _env = _env.with("OPENHUMAN_TELEGRAM_BOT_API_BASE", server.uri());
+ let _env = EnvVarGuard::locked_set_async("OPENHUMAN_TELEGRAM_BOT_API_BASE", server.uri()).await;
let _storage = crate::channels::module_fixture::install_memory_storage();
crate::channels::module_fixture::client().await;
@@ -127,10 +125,9 @@ async fn compiled_module_progressive_send_reenters_typed_callback_without_deadlo
if outcome.error.is_none()
&& outcome.receipt.primary_platform_message_id.as_deref() == Some("991")
));
- Mock::given(method("POST"))
- .and(path("/bottoken/sendMessage"))
- .expect(0)
- .mount(&server)
- .await;
- runtime.close().await.expect("module runtime should shut down");
+ server.verify().await;
+ runtime
+ .close()
+ .await
+ .expect("module runtime should shut down");
}