Files
foxhunt/testing/test-common/src/lib.rs
jgrusewski 9c3d741a08 refactor: restructure repo — crates/, bin/, testing/ layout
Move 17 library crates into crates/, CLI binary into bin/fxt,
consolidate 10 test crates into testing/, split config crate
from deployment config files.

Root directory reduced from 38+ to ~17 directories.
All Cargo.toml paths and build.rs proto refs updated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 11:56:00 +01:00

40 lines
1.3 KiB
Rust

//! Common test utilities and helpers for Foxhunt testing suites
//!
//! This crate provides shared utilities, fixtures, and helper functions
//! used across all test suites in the Foxhunt system.
// Allow dead code for test infrastructure that may not be fully used yet
#![allow(dead_code)]
use std::sync::Once;
use tracing_subscriber;
static INIT: Once = Once::new();
/// Initialize logging for tests - safe to call multiple times
pub fn init_test_logging() {
INIT.call_once(|| {
tracing_subscriber::fmt()
.with_env_filter("debug")
.with_test_writer()
.try_init()
.ok(); // Ignore errors if already initialized
});
}
/// Test configuration constants
pub mod constants {
use rust_decimal::Decimal;
use std::time::Duration;
pub const DEFAULT_TIMEOUT: Duration = Duration::from_secs(30);
pub const FAST_TIMEOUT: Duration = Duration::from_secs(5);
pub const SLOW_TIMEOUT: Duration = Duration::from_secs(120);
pub const MIN_PRICE: Decimal = Decimal::from_parts(1, 0, 0, false, 8); // 0.00000001
pub const MAX_PRICE: Decimal = Decimal::from_parts(1000000, 0, 0, false, 0); // 1,000,000
pub const MIN_QUANTITY: Decimal = Decimal::from_parts(1, 0, 0, false, 8);
pub const MAX_QUANTITY: Decimal = Decimal::from_parts(1000000, 0, 0, false, 0);
}