franken-snowflake-testkit 0.0.6

Deterministic no-account Snowflake SQL API testkit (codec lane + mock server) for franken_snowflake.
//! `franken-snowflake-testkit` — deterministic, no-account proof harness.
//!
//! Owns two test lanes plus shared infrastructure:
//!
//! - **Primary deterministic lane (no socket):** the `Http1Client::request<IO>`
//!   codec driven over a `VirtualTcpStream` pair under `LabRuntime`, with DPOR
//!   exploration of cancellation/retry interleavings and obligation-leak /
//!   quiescence oracles asserting zero leaked connections, statements, or
//!   partition fetchers after a cancel. Canned fixtures cover 200 result sets,
//!   202 running, 429 backoff, 422 failure, gzip partitions, and the
//!   multi-statement refusal.
//! - **Integration lane:** a mock SQL API server built on `fastapi_rust`
//!   (Asupersync-native, dev-dependency only) for stateful end-to-end CLI ↔ HTTP
//!   flows, with auth-header redaction inspection and an opt-in live smoke
//!   harness that refuses clearly when credentials are absent.
//!
//! Shared infrastructure: key-sorted JSON golden files with time/host/hash
//! fields canonicalized (IEEE-754 bits reported on float mismatch), an injected
//! clock for deterministic backoff/TTL, canary-secret leak guards, and the
//! forbidden-dependency scan. `fastapi_rust` is a testkit dependency, never a
//! production core dependency. See `docs/proof_lanes.md`.
//!
//! Status: the **shared, generic harness** ([`harness`]) is implemented by
//! `fsnow-native-snowflake-connector-w0i.15` and is the foundation every other
//! crate consumes as a dev-dependency. The Snowflake-specific fixtures and the
//! `fastapi_rust` mock server build on top of it in
//! `fsnow-deterministic-testkit-bak`; the VirtualTcp/DPOR race suite lands in
//! `fsnow-native-snowflake-connector-w0i.4`.

// The race suite spawns the production driver as a lab task, and proving that
// future `Send` walks the whole async chain (driver, transport, HTTP/1 codec)
// past the default depth of 128 (rustc `recursion_depth_exceeding_limit`).
#![recursion_limit = "256"]

pub mod e2e;
pub mod harness;
pub mod mock;
pub mod race;
pub mod replay;

/// Crate version string.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

/// The most commonly used harness types, re-exported for terse dev-dependency
/// imports: `use franken_snowflake_testkit::prelude::*;`.
pub mod prelude {
    pub use crate::e2e::{
        DEFAULT_E2E_TRACE_ID, E2eHarnessConfig, E2eHarnessError, E2eHarnessReport,
        run_mock_sqlapi_e2e,
    };
    pub use crate::harness::canary::{
        CanaryGuard, CanaryHit, CanaryReport, Channel, DEFAULT_CANARY,
    };
    pub use crate::harness::clock::{
        BackoffPolicy, Clock, Deadline, DeterministicRng, ManualClock, SystemClock,
        backoff_schedule,
    };
    pub use crate::harness::golden::{
        GoldenConfig, GoldenMismatch, assert_no_cr, compare, to_canonical_json,
    };
    pub use crate::harness::logger::{RunLogger, RunSummary, StepEvent, StepOutcome};
    pub use crate::mock::http::{Method, MockHttpRequest, MockHttpResponse, ResponseClass};
    pub use crate::mock::server::{MockSqlApi, RecordedRequest};
    pub use crate::mock::{ScriptedResponder, scenarios};
    pub use crate::race::{
        RaceCaseKind, RaceCaseReport, RaceError, RaceSuiteConfig, RaceSuiteReport,
        default_race_suite_config, race_suite_jsonl, run_default_race_suite, run_race_suite,
        write_race_suite_artifacts,
    };
    pub use crate::replay::{
        ProtocolPacket, ReplayError, ReplayHarness, ReplayStep, ReplaySummary,
        default_protocol_replay,
    };
}