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::{
22    POCKET_IC_SERVER_VERSION, pocket_ic_server_requirement, supports_pocket_ic_server,
23};
24#[cfg(unix)]
25pub mod server_assets;
26
27mod baseline;
28mod baseline_pool;
29mod bounded_pool;
30mod diagnostics;
31mod errors;
32mod lifecycle;
33mod snapshot;
34mod standalone;
35mod standalone_recipe;
36mod startup;
37mod time;
38mod transport;
39#[cfg(feature = "wire")]
40mod wire;
41
42pub use baseline::CachedPocketIcBaseline;
43pub use baseline_pool::{
44    BaselinePoolContractError, BaselinePoolDisposition, BaselinePoolError, BaselinePoolOutcome,
45    BaselinePoolPreparationError, BaselinePoolTimings, BaselinePreparationStage,
46    CachedPocketIcBaselinePool, CachedPocketIcBaselinePoolGuard, ExtraCanisterPolicy,
47    FailureDisposition, PocketIcBaselineRecipe, PreparedBaseline, RebuildReason, ResetDomainKind,
48    ResetPolicies, ResetReceipt, ResetRequirements, StateResetPolicy, TimeResetPolicy,
49};
50pub use diagnostics::{
51    CanisterDiagnosticLogRecord, CanisterDiagnosticLogs, CanisterDiagnosticsBatchEntry,
52    CanisterDiagnosticsBatchReport, CanisterDiagnosticsReport, CanisterDiagnosticsRequest,
53    CanisterLogRenderLimits, DEFAULT_CANISTER_LOG_BYTE_LIMIT, DEFAULT_CANISTER_LOG_RECORD_LIMIT,
54    LabeledCanisterDiagnosticsRequest, PocketIcDiagnosticsExt,
55};
56pub use errors::{CanisterInstallError, StandaloneCanisterInstallError};
57pub use lifecycle::{CanisterInstallExt, InstallSpec, RetryPolicy};
58pub use snapshot::{
59    CanisterSnapshotTarget, ControllerSnapshotError, ControllerSnapshots, PocketIcSnapshotExt,
60    SnapshotCleanupFailure, SnapshotRestoreFunding,
61};
62pub use standalone::StandaloneCanisterFixture;
63pub use standalone_recipe::StandaloneCanisterRecipe;
64pub use startup::{
65    PocketIcInstance, PocketIcManagedServer, PocketIcManagedServerOutput, PocketIcStartupConfig,
66    PocketIcStartupError, PocketIcStartupFailure,
67};
68pub use time::{TickUntilError, advance_and_tick, tick_until};
69pub use transport::{
70    PocketIcCallFailure, PocketIcOperationError, is_dead_pocket_ic_transport_error,
71    try_pocket_ic_call, try_pocket_ic_operation,
72};
73#[cfg(feature = "wire")]
74pub use wire::{WireCallContext, WireCallError, WireCallSpec, query_wire, update_wire};
75
76/// All `PocketIC` extension traits, and no data types.
77///
78/// Importing this module keeps policy/data types explicit while avoiding
79/// repeated trait lists across a large integration-test crate.
80pub mod prelude {
81    pub use super::{CanisterInstallExt, PocketIcDiagnosticsExt, PocketIcSnapshotExt};
82}