Skip to content

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

test(openhuman-embed): add common module to integration tests

Steven Enamakelac150fa8e1b9
diff --git a/crates/openhuman-embed/tests/attached_tools_attached_tools_survive_clones_and_session_resume.rs b/crates/openhuman-embed/tests/attached_tools_attached_tools_survive_clones_and_session_resume.rs
index a39f3f8b7c..514a1c2c32 100644
--- a/crates/openhuman-embed/tests/attached_tools_attached_tools_survive_clones_and_session_resume.rs
+++ b/crates/openhuman-embed/tests/attached_tools_attached_tools_survive_clones_and_session_resume.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/attached_tools.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/attached_tools_attaching_before_first_turn_preserves_and_executes_native_tools.rs b/crates/openhuman-embed/tests/attached_tools_attaching_before_first_turn_preserves_and_executes_native_tools.rs
index f3e7e791d8..4677930794 100644
--- a/crates/openhuman-embed/tests/attached_tools_attaching_before_first_turn_preserves_and_executes_native_tools.rs
+++ b/crates/openhuman-embed/tests/attached_tools_attaching_before_first_turn_preserves_and_executes_native_tools.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/attached_tools.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/attached_tools_permanent_metadata_requires_a_real_source.rs b/crates/openhuman-embed/tests/attached_tools_permanent_metadata_requires_a_real_source.rs
index d2a0e311fa..358103f391 100644
--- a/crates/openhuman-embed/tests/attached_tools_permanent_metadata_requires_a_real_source.rs
+++ b/crates/openhuman-embed/tests/attached_tools_permanent_metadata_requires_a_real_source.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/attached_tools.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/cron_agents_a_scheduled_job_runs_a_runtime_agent_with_its_host_tool_as_cron.rs b/crates/openhuman-embed/tests/cron_agents_a_scheduled_job_runs_a_runtime_agent_with_its_host_tool_as_cron.rs
new file mode 100644
index 0000000000..cdf3195171
--- /dev/null
+++ b/crates/openhuman-embed/tests/cron_agents_a_scheduled_job_runs_a_runtime_agent_with_its_host_tool_as_cron.rs
@@ -0,0 +1,8 @@
+mod common;
+#[path = "support/cron_agents.rs"]
+mod scenarios;
+
+#[test]
+fn a_scheduled_job_runs_a_runtime_agent_with_its_host_tool_as_cron() {
+ scenarios::a_scheduled_job_runs_a_runtime_agent_with_its_host_tool_as_cron();
+}
diff --git a/crates/openhuman-embed/tests/cron_agents_background_services_drive_the_scheduler_and_stop_with_the_runtime.rs b/crates/openhuman-embed/tests/cron_agents_background_services_drive_the_scheduler_and_stop_with_the_runtime.rs
new file mode 100644
index 0000000000..706b32e377
--- /dev/null
+++ b/crates/openhuman-embed/tests/cron_agents_background_services_drive_the_scheduler_and_stop_with_the_runtime.rs
@@ -0,0 +1,8 @@
+mod common;
+#[path = "support/cron_agents.rs"]
+mod scenarios;
+
+#[test]
+fn background_services_drive_the_scheduler_and_stop_with_the_runtime() {
+ scenarios::background_services_drive_the_scheduler_and_stop_with_the_runtime();
+}
diff --git a/crates/openhuman-embed/tests/cron_agents_deferred_services_wait_for_the_host_so_a_due_job_finds_its_handler.rs b/crates/openhuman-embed/tests/cron_agents_deferred_services_wait_for_the_host_so_a_due_job_finds_its_handler.rs
new file mode 100644
index 0000000000..3bf4697eca
--- /dev/null
+++ b/crates/openhuman-embed/tests/cron_agents_deferred_services_wait_for_the_host_so_a_due_job_finds_its_handler.rs
@@ -0,0 +1,8 @@
+mod common;
+#[path = "support/cron_agents.rs"]
+mod scenarios;
+
+#[test]
+fn deferred_services_wait_for_the_host_so_a_due_job_finds_its_handler() {
+ scenarios::deferred_services_wait_for_the_host_so_a_due_job_finds_its_handler();
+}
diff --git a/crates/openhuman-embed/tests/host_only_tools_host_only_advertises_exactly_the_host_tools_under_a_bare_prompt.rs b/crates/openhuman-embed/tests/host_only_tools_host_only_advertises_exactly_the_host_tools_under_a_bare_prompt.rs
index 9ebc0f38f1..24384ab609 100644
--- a/crates/openhuman-embed/tests/host_only_tools_host_only_advertises_exactly_the_host_tools_under_a_bare_prompt.rs
+++ b/crates/openhuman-embed/tests/host_only_tools_host_only_advertises_exactly_the_host_tools_under_a_bare_prompt.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/host_only_tools.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/host_only_tools_host_only_forces_read_only_access_and_sandbox.rs b/crates/openhuman-embed/tests/host_only_tools_host_only_forces_read_only_access_and_sandbox.rs
index 887cbcd37a..3d964f5e32 100644
--- a/crates/openhuman-embed/tests/host_only_tools_host_only_forces_read_only_access_and_sandbox.rs
+++ b/crates/openhuman-embed/tests/host_only_tools_host_only_forces_read_only_access_and_sandbox.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/host_only_tools.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/host_only_tools_host_only_refuses_builtin_tools_the_model_names.rs b/crates/openhuman-embed/tests/host_only_tools_host_only_refuses_builtin_tools_the_model_names.rs
index f4ec4a87bc..b873ddf065 100644
--- a/crates/openhuman-embed/tests/host_only_tools_host_only_refuses_builtin_tools_the_model_names.rs
+++ b/crates/openhuman-embed/tests/host_only_tools_host_only_refuses_builtin_tools_the_model_names.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/host_only_tools.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/structured_turns_a_complete_json_value_with_a_length_finish_is_not_a_valid_answer.rs b/crates/openhuman-embed/tests/structured_turns_a_complete_json_value_with_a_length_finish_is_not_a_valid_answer.rs
index f84396d751..a6495368cb 100644
--- a/crates/openhuman-embed/tests/structured_turns_a_complete_json_value_with_a_length_finish_is_not_a_valid_answer.rs
+++ b/crates/openhuman-embed/tests/structured_turns_a_complete_json_value_with_a_length_finish_is_not_a_valid_answer.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/structured_turns.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/structured_turns_a_tool_loop_ends_in_a_structured_answer.rs b/crates/openhuman-embed/tests/structured_turns_a_tool_loop_ends_in_a_structured_answer.rs
index 59afe0bb56..a65e095039 100644
--- a/crates/openhuman-embed/tests/structured_turns_a_tool_loop_ends_in_a_structured_answer.rs
+++ b/crates/openhuman-embed/tests/structured_turns_a_tool_loop_ends_in_a_structured_answer.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/structured_turns.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/structured_turns_empty_truncated_terminal_answers_use_only_the_explicit_repair_allowance.rs b/crates/openhuman-embed/tests/structured_turns_empty_truncated_terminal_answers_use_only_the_explicit_repair_allowance.rs
index ad8228886a..5e761584c2 100644
--- a/crates/openhuman-embed/tests/structured_turns_empty_truncated_terminal_answers_use_only_the_explicit_repair_allowance.rs
+++ b/crates/openhuman-embed/tests/structured_turns_empty_truncated_terminal_answers_use_only_the_explicit_repair_allowance.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/structured_turns.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/structured_turns_shared_budget_stops_the_tool_loop_before_its_next_provider_call.rs b/crates/openhuman-embed/tests/structured_turns_shared_budget_stops_the_tool_loop_before_its_next_provider_call.rs
index 9fa08556db..05c3adc2b2 100644
--- a/crates/openhuman-embed/tests/structured_turns_shared_budget_stops_the_tool_loop_before_its_next_provider_call.rs
+++ b/crates/openhuman-embed/tests/structured_turns_shared_budget_stops_the_tool_loop_before_its_next_provider_call.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/structured_turns.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/structured_turns_successful_turn_preserves_reported_charges_and_invalid_buyer_cost_is_unknown.rs b/crates/openhuman-embed/tests/structured_turns_successful_turn_preserves_reported_charges_and_invalid_buyer_cost_is_unknown.rs
index 934fada547..b9f960b097 100644
--- a/crates/openhuman-embed/tests/structured_turns_successful_turn_preserves_reported_charges_and_invalid_buyer_cost_is_unknown.rs
+++ b/crates/openhuman-embed/tests/structured_turns_successful_turn_preserves_reported_charges_and_invalid_buyer_cost_is_unknown.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/structured_turns.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/structured_turns_terminal_schema_validation_retries_without_accepting_a_wrong_type.rs b/crates/openhuman-embed/tests/structured_turns_terminal_schema_validation_retries_without_accepting_a_wrong_type.rs
index 9fbe35b392..d219813565 100644
--- a/crates/openhuman-embed/tests/structured_turns_terminal_schema_validation_retries_without_accepting_a_wrong_type.rs
+++ b/crates/openhuman-embed/tests/structured_turns_terminal_schema_validation_retries_without_accepting_a_wrong_type.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/structured_turns.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/structured_turns_untrusted_input_passes_the_prompt_guard_only_on_a_host_only_agent.rs b/crates/openhuman-embed/tests/structured_turns_untrusted_input_passes_the_prompt_guard_only_on_a_host_only_agent.rs
index c1de842082..0cd4179841 100644
--- a/crates/openhuman-embed/tests/structured_turns_untrusted_input_passes_the_prompt_guard_only_on_a_host_only_agent.rs
+++ b/crates/openhuman-embed/tests/structured_turns_untrusted_input_passes_the_prompt_guard_only_on_a_host_only_agent.rs
@@ -1,3 +1,4 @@
+mod common;
#[path = "support/structured_turns.rs"]
mod scenarios;
diff --git a/crates/openhuman-embed/tests/support/cron_agents.rs b/crates/openhuman-embed/tests/support/cron_agents.rs
index f3767ea180..dbbb731682 100644
--- a/crates/openhuman-embed/tests/support/cron_agents.rs
+++ b/crates/openhuman-embed/tests/support/cron_agents.rs
@@ -6,7 +6,7 @@
//! decides the run's recorded result. And a runtime that asks for background
//! services runs the scheduler, then stops it when it is dropped.
-mod common;
+use crate::common;
use std::sync::{Arc, Mutex};
use std::time::Duration;
@@ -94,8 +94,7 @@ async fn wait_for_services_changed(events: &mut RuntimeEvents, running: bool) {
.unwrap_or_else(|_| panic!("timed out waiting for services running={running}"));
}
-#[test]
-fn a_scheduled_job_runs_a_runtime_agent_with_its_host_tool_as_cron() {
+pub fn a_scheduled_job_runs_a_runtime_agent_with_its_host_tool_as_cron() {
let _lock = RUNTIME_LOCK
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner);
@@ -223,8 +222,7 @@ fn a_scheduled_job_runs_a_runtime_agent_with_its_host_tool_as_cron() {
});
}
-#[test]
-fn background_services_drive_the_scheduler_and_stop_with_the_runtime() {
+pub fn background_services_drive_the_scheduler_and_stop_with_the_runtime() {
let _lock = RUNTIME_LOCK
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner);
@@ -330,8 +328,7 @@ fn background_services_drive_the_scheduler_and_stop_with_the_runtime() {
/// so a system job already due at boot finds its handler in place: here the
/// job is stored and due before the handler exists, and the first run the
/// scheduler records is the handler's.
-#[test]
-fn deferred_services_wait_for_the_host_so_a_due_job_finds_its_handler() {
+pub fn deferred_services_wait_for_the_host_so_a_due_job_finds_its_handler() {
let _lock = RUNTIME_LOCK
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner);