clnrm_core/
lib.rs

1//! Cleanroom Testing Platform - Hermetic Integration Testing
2//!
3//! A framework for reliable, hermetic integration testing with automatic
4//! container lifecycle management and comprehensive observability.
5//!
6//! This library provides a complete testing platform that tests itself
7//! through the "eat your own dog food" principle - the framework validates
8//! its own functionality using its own capabilities.
9
10pub mod assertions;
11pub mod backend;
12pub mod cache;
13pub mod cleanroom;
14pub mod cli;
15pub mod config;
16pub mod determinism;
17pub mod error;
18pub mod formatting;
19pub mod macros;
20pub mod marketplace;
21pub mod otel;
22pub mod policy;
23pub mod reporting;
24pub mod scenario;
25pub mod services;
26pub mod telemetry;
27pub mod template;
28pub mod utils;
29pub mod validation;
30pub mod watch;
31
32// Testing utilities (includes property-based test generators)
33pub mod testing;
34
35pub use error::{CleanroomError, Result};
36pub use policy::{Policy, SecurityLevel, SecurityPolicy};
37pub use scenario::scenario;
38
39#[cfg(feature = "otel-traces")]
40pub use telemetry::{Export, OtelConfig, OtelGuard};
41
42pub use assertions::{cache, database, email_service, UserAssertions};
43pub use cache::{Cache, CacheManager, CacheStats, FileCache, MemoryCache};
44pub use cleanroom::{
45    CleanroomEnvironment, ExecutionResult, HealthStatus, ServiceHandle, ServicePlugin,
46    ServiceRegistry,
47};
48pub use config::{
49    load_cleanroom_config, load_cleanroom_config_from_file, load_config_from_file,
50    parse_toml_config, CleanroomConfig, DeterminismConfig, ScenarioConfig, StepConfig, TestConfig,
51};
52pub use determinism::DeterminismEngine;
53pub use formatting::{
54    format_test_results, format_toml_content, format_toml_file, needs_formatting, Formatter,
55    FormatterType, HumanFormatter, JsonFormatter, JunitFormatter, TapFormatter, TestResult,
56    TestStatus, TestSuite,
57};
58pub use macros::{with_cache, with_database, with_message_queue, with_web_server};
59pub use reporting::{generate_reports, DigestReporter, JsonReporter, JunitReporter, ReportConfig};
60pub use services::generic::GenericContainerPlugin;
61pub use services::surrealdb::SurrealDbPlugin;
62pub use template::{TemplateContext, TemplateRenderer};
63pub use validation::otel::{OtelValidationConfig, OtelValidator, SpanAssertion, TraceAssertion};
64pub use validation::{PrdExpectations, ShapeValidator, ValidationReport};
65pub use watch::{debouncer::FileDebouncer, WatchConfig};
66
67// The cleanroom_test macro is already exported via #[macro_export] in macros.rs
68
69/// Result of a cleanroom run
70#[derive(Debug)]
71pub struct RunResult {
72    pub success: bool,
73    pub duration_ms: u64,
74    pub output: String,
75    pub error: Option<String>,
76}