Skip to content

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

test(cron): gate channel-dependent tests behind the channels feature

Steven Enamakel1a293d107787
diff --git a/crates/openhuman-core/src/cron/ops.rs b/crates/openhuman-core/src/cron/ops.rs
index 758fcad9f8..62ecf653a9 100644
--- a/crates/openhuman-core/src/cron/ops.rs
+++ b/crates/openhuman-core/src/cron/ops.rs
@@ -227,6 +227,6 @@ pub async fn cron_runs(
#[path = "ops_tests.rs"]
mod tests;
-#[cfg(test)]
+#[cfg(all(test, feature = "channels"))]
#[path = "ops_delivery_tests.rs"]
mod delivery_tests;
diff --git a/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs b/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
index c130ac0035..dbcf9b38af 100644
--- a/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
+++ b/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
@@ -507,6 +507,6 @@ async fn deliver_to_web_thread(
#[path = "origin_delivery_tests.rs"]
mod tests;
-#[cfg(test)]
+#[cfg(all(test, feature = "channels"))]
#[path = "origin_delivery_channel_tests.rs"]
mod channel_tests;
diff --git a/crates/openhuman-core/src/cron/scheduler_tests.rs b/crates/openhuman-core/src/cron/scheduler_tests.rs
index 22bd23df35..68d6bc5750 100644
--- a/crates/openhuman-core/src/cron/scheduler_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_tests.rs
@@ -112,6 +112,7 @@ fn next_user_error(
}
}
+#[cfg(feature = "channels")]
#[path = "scheduler_announce_delivery_tests.rs"]
mod announce_delivery_tests;
#[path = "scheduler_classifier_and_delivery_tests.rs"]
diff --git a/crates/openhuman-core/src/threads/channel_projection_tests.rs b/crates/openhuman-core/src/threads/channel_projection_tests.rs
index 32a4394fa7..3ad2c433bc 100644
--- a/crates/openhuman-core/src/threads/channel_projection_tests.rs
+++ b/crates/openhuman-core/src/threads/channel_projection_tests.rs
@@ -256,6 +256,7 @@ fn channel_activity_emits_atomic_keyed_merge_patches() {
async fn persisted_activity_merges_concurrent_events_for_the_exact_scoped_row() {
// `forget` below models a restart; one installed backend keeps the rows
// across it, as a durable store does.
+ #[cfg(all(feature = "channels", feature = "modules"))]
let _storage = crate::channels::module_fixture::install_memory_storage();
use crate::core::runtime::{ContextOverlay, CoreContext, DispatchCtx, DomainSet};
use crate::threads::store::{self, ConversationMessage, CreateConversationThread};
diff --git a/crates/openhuman-core/src/web_chat/progress_tests.rs b/crates/openhuman-core/src/web_chat/progress_tests.rs
index 61e25d85eb..6899d610f7 100644
--- a/crates/openhuman-core/src/web_chat/progress_tests.rs
+++ b/crates/openhuman-core/src/web_chat/progress_tests.rs
@@ -204,6 +204,7 @@ async fn spawn_test_bridge_with_interval(
tokio::sync::mpsc::Sender<AgentProgress>,
tokio::task::JoinHandle<()>,
) {
+ #[cfg(all(feature = "channels", feature = "modules"))]
let _module = crate::channels::module_fixture::client().await;
let (tx, rx) = tokio::sync::mpsc::channel::<AgentProgress>(16);
let dir = tempfile::tempdir().expect("tempdir");
diff --git a/crates/openhuman-core/src/web_chat/surface.rs b/crates/openhuman-core/src/web_chat/surface.rs
index f1eef6d75d..49e316c075 100644
--- a/crates/openhuman-core/src/web_chat/surface.rs
+++ b/crates/openhuman-core/src/web_chat/surface.rs
@@ -45,12 +45,12 @@ impl Surface {
/// A surface for the turn `ids`, publishing under `ctx`. Every canonical
/// projection goes through the compiled TinyChannels module.
pub(crate) async fn new(ctx: &DispatchCtx, ids: TurnIds, config: Config) -> Self {
- #[cfg(test)]
+ #[cfg(all(test, feature = "channels", feature = "modules"))]
let module = {
let _ = config;
crate::channels::module_fixture::client().await
};
- #[cfg(not(test))]
+ #[cfg(not(all(test, feature = "channels", feature = "modules")))]
let module = crate::modules::client(config);
let tenant = super::ops::tenant_of(ctx);
diff --git a/crates/openhuman-core/src/web_chat/turn_host_tests.rs b/crates/openhuman-core/src/web_chat/turn_host_tests.rs
index 4f40cd8605..715d216da9 100644
--- a/crates/openhuman-core/src/web_chat/turn_host_tests.rs
+++ b/crates/openhuman-core/src/web_chat/turn_host_tests.rs
@@ -182,6 +182,7 @@ async fn a_late_subagent_failure_is_published_after_the_runner_is_gone() {
#[tokio::test]
async fn the_heartbeat_beats_only_for_a_live_turn() {
use super::super::surface::TurnIds;
+ #[cfg(all(feature = "channels", feature = "modules"))]
let _module = crate::channels::module_fixture::client().await;
let mut bus = crate::web_chat::subscribe_web_channel_events();
let ids = TurnIds {