Skip to main content

ic_testkit/pic/
mod.rs

1//! PocketIC host-test harness extensions.
2//!
3//! Import the client and DTOs directly from `ic_platform::pocket_ic`.
4//! This module owns Testkit's extension traits and policy types.
5//!
6//! Construct and own [`ic_platform::pocket_ic::PocketIc`] instances normally, then import individual
7//! extension traits or [`prelude`] for installation, diagnostics and snapshots.
8//! Import the call functions, startup configuration and polling helpers explicitly.
9//! Native simulator operations remain upstream inherent methods.
10//!
11//! [`PocketIcManagedServer`] can explicitly own one exact caller-selected
12//! server child for a serial suite. No type serializes independent instances or
13//! downloads a server implicitly. On Unix, `server_assets` owns explicit
14//! authenticated provisioning and admission; the published
15//! `ic-testkit-server setup` / `check` commands delegate to that implementation.
16
17#[cfg(feature = "reply-fixtures")]
18pub mod fixtures;
19
20mod server;
21pub use server::{POCKET_IC_SERVER_VERSION, supports_pocket_ic_server};
22#[cfg(unix)]
23pub mod server_assets;
24
25mod baseline;
26mod baseline_pool;
27mod bounded_pool;
28mod diagnostics;
29mod errors;
30mod lifecycle;
31mod snapshot;
32mod standalone;
33mod standalone_recipe;
34mod startup;
35mod time;
36mod transport;
37#[cfg(feature = "wire")]
38mod wire;
39
40pub use baseline::CachedPocketIcBaseline;
41pub use baseline_pool::{
42    BaselinePoolContractError, BaselinePoolDisposition, BaselinePoolError, BaselinePoolOutcome,
43    BaselinePoolPreparationError, BaselinePoolTimings, BaselinePreparationStage,
44    CachedPocketIcBaselinePool, CachedPocketIcBaselinePoolGuard, ExtraCanisterPolicy,
45    FailureDisposition, PocketIcBaselineRecipe, PreparedBaseline, RebuildReason, ResetDomainKind,
46    ResetPolicies, ResetReceipt, ResetRequirements, StateResetPolicy, TimeResetPolicy,
47};
48pub use diagnostics::{
49    CanisterDiagnosticLogRecord, CanisterDiagnosticLogs, CanisterDiagnosticsBatchEntry,
50    CanisterDiagnosticsBatchReport, CanisterDiagnosticsReport, CanisterDiagnosticsRequest,
51    CanisterLogRenderLimits, DEFAULT_CANISTER_LOG_BYTE_LIMIT, DEFAULT_CANISTER_LOG_RECORD_LIMIT,
52    LabeledCanisterDiagnosticsRequest, PocketIcDiagnosticsExt,
53};
54pub use errors::{CanisterInstallError, StandaloneCanisterInstallError};
55pub use lifecycle::{CanisterInstallExt, InstallSpec, RetryPolicy};
56pub use snapshot::{
57    CanisterSnapshotTarget, ControllerSnapshotError, ControllerSnapshots, PocketIcSnapshotExt,
58    SnapshotCleanupFailure, SnapshotRestoreFunding,
59};
60pub use standalone::StandaloneCanisterFixture;
61pub use standalone_recipe::StandaloneCanisterRecipe;
62pub use startup::{
63    PocketIcInstance, PocketIcManagedServer, PocketIcManagedServerOutput, PocketIcStartupConfig,
64    PocketIcStartupError, PocketIcStartupFailure,
65};
66pub use time::{TickUntilError, advance_and_tick, tick_until};
67pub use transport::{
68    PocketIcCallFailure, PocketIcOperationError, is_dead_pocket_ic_transport_error,
69    try_pocket_ic_operation,
70};
71#[cfg(feature = "wire")]
72pub use wire::{WireCallContext, WireCallError, WireCallSpec, query_wire, update_wire};
73
74/// All PocketIC extension traits, and no data types.
75///
76/// Importing this module keeps policy/data types explicit while avoiding
77/// repeated trait lists across a large integration-test crate.
78pub mod prelude {
79    pub use super::{CanisterInstallExt, PocketIcDiagnosticsExt, PocketIcSnapshotExt};
80}