Skip to main content

Module test_utils

Module test_utils 

Source

Re-exports§

pub use event_aggregator_utils::NodeLogInfo;
pub use event_aggregator_utils::TestAggregatorBuilder;

Modules§

event_aggregator_utils
Test utilities for event log aggregation.

Structs§

BuildToolConfig
Builds and packages a contract or delegate.
NodeInfo
Information about a node in a test
Task
Data model representing a task for testing
TestContext
Test context providing access to nodes and event aggregation.
TestLogger
A configurable test logger that provides flexible logging for tests.
TodoList
Data model representing a todo list for testing

Enums§

LogFormat
Format for test logger output
TodoOperation
Operations that can be performed on tasks

Functions§

allocate_test_node_block
Allocate a block of unique global node indices for a test.
compile_delegate
create_empty_delta_update
Creates an empty delta update for testing no-change scenarios
create_empty_todo_list
Creates an empty todo list for testing
create_large_todo_list
Creates a large todo list near the practical size limit (1MB) for testing
create_max_tasks_todo_list
Creates a state with exactly the maximum allowed number of tasks
create_minimal_state
Creates a minimal valid state for testing
create_oversized_todo_list
Creates an oversized todo list that exceeds practical limits for testing
create_todo_list_with_item
Creates a todo list with a single task for testing
ensure_contract_compiled
Pre-compile a test contract WASM binary without loading it. Call this BEFORE any test timeout to ensure cargo build time doesn’t count against the test’s deadline. Thread-safe and idempotent.
load_contract
load_delegate
make_get
make_get_with_blocking
make_node_diagnostics
Query node diagnostics including subscription tree information.
make_put
make_put_with_blocking
make_subscribe
make_update
release_local_port
Release a previously reserved port so future tests may reuse it.
reserve_local_port
Reserve a unique localhost TCP port for tests.
reserve_local_port_on_ip
Reserve a unique TCP port for tests on a specific IP address.
reset_global_node_index
Reset the global node index counter to initial state for this thread. Thread-local, so safe for parallel test execution.
set_peer_id
Set the peer identifier for the current thread’s tracing context.
take_reserved_tcp_listener
Take the reserved TCP listener for a port without dropping it.
test_ip_for_node
Generate a unique loopback IP address for test node at given index.
verify_contract_exists

Type Aliases§

TestResult
Test result type for test functions