fix(tests): restore test-module imports broken by recent refactors (#4759)

This commit is contained in:
Mega Mind
2026-07-10 00:14:06 +05:30
committed by GitHub
parent e5c6507cc5
commit 54511e6145
10 changed files with 30 additions and 1 deletions
@@ -50,6 +50,25 @@ pub(crate) use ops::{event_session_id_for, key_for};
pub(crate) use progress_bridge::spawn_progress_bridge;
// Schema field helpers re-exported for tests
#[cfg(any(test, debug_assertions))]
#[allow(unused_imports)]
pub(crate) use schemas::{
json_output, optional_bool, optional_f64, optional_string, optional_u64, required_string,
};
#[cfg(any(test, debug_assertions))]
#[allow(unused_imports)]
pub(crate) use session::{
compose_system_prompt_suffix, locale_reply_directive, normalize_model_override,
provider_role_for_model_override,
};
#[cfg(any(test, debug_assertions))]
#[allow(unused_imports)]
pub(crate) use types::WebChatParams;
#[cfg(any(test, debug_assertions))]
#[allow(unused_imports)]
pub(crate) use web_errors::{
inference_budget_exceeded_user_message, is_inference_budget_exceeded_error,
};
// Test helpers (debug/test builds only)
#[cfg(any(test, debug_assertions))]
@@ -1,3 +1,5 @@
use super::dirs::{ACTION_DIR_ENV_VAR, MEMORY_SYNC_INTERVAL_SECS_ENV_VAR};
use super::env::EnvLookup;
use super::*;
use crate::openhuman::config::schema::{StreamMode, TelegramConfig};
+2
View File
@@ -27,6 +27,8 @@ use helpers::{
DEFAULT_ONBOARDING_FLAG_NAME,
};
#[cfg(test)]
use schema_defs::schemas;
#[cfg(test)]
use serde_json::{Map, Value};
#[cfg(test)]
@@ -1,4 +1,4 @@
use super::interrupted_pull_settle_window_secs;
use super::util::interrupted_pull_settle_window_secs;
#[test]
fn interrupted_pull_waits_when_bytes_were_observed() {
@@ -1,4 +1,5 @@
use super::*;
use crate::openhuman::inference::provider::traits::StreamError;
use std::sync::Arc;
struct MockProvider {
+1
View File
@@ -1,3 +1,4 @@
use super::specs::list_tools_result_for_config;
use super::*;
#[test]
+1
View File
@@ -266,6 +266,7 @@ pub mod test_override {
#[cfg(test)]
mod tests {
use super::*;
use crate::openhuman::config::schema::DEFAULT_CLOUD_LLM_MODEL;
#[test]
fn build_provider_returns_inference_wrapper_when_default() {
+1
View File
@@ -1,3 +1,4 @@
use super::definitions::NAMESPACE;
use super::*;
#[test]
+1
View File
@@ -134,6 +134,7 @@ fn write_atomic(path: &Path, bytes: &[u8]) -> Result<()> {
#[cfg(test)]
mod tests {
use super::*;
use crate::openhuman::memory_store::trees::types::{TreeKind, TreeStatus};
use chrono::TimeZone;
use tempfile::TempDir;
+1
View File
@@ -288,6 +288,7 @@ pub fn validate_docker_policy(policy: &SandboxPolicy) -> Result<(), Vec<String>>
#[cfg(test)]
mod tests {
use super::*;
use crate::openhuman::sandbox::types::DockerOverrides;
use std::path::PathBuf;
fn test_policy() -> SandboxPolicy {