Skip to main content

Module helpers

Module helpers 

Source
Expand description

Helper utilities for the test runner.

Contains pure functions and static helpers used by the test runner that don’t require self access: variable substitution, TLS defaults, JSON formatting, and metadata conversion.

Structs§

CliRuntimeDefaults
EffectiveRuntimeOptions
RuntimeOptionWithSource

Enums§

RuntimeOptionSource

Constants§

REQUEST_CHANNEL_BUFFER
Buffer size for the request message channel. Controls back-pressure for client streaming: larger values allow more buffered requests but consume more memory.

Functions§

build_proto_config
Build proto config with document-relative path resolution, matching run behavior.
build_tls_config
Build TLS config using TLS section and env defaults, matching run behavior.
collect_unresolved_placeholders
Recursively collect unresolved {{ identifier }} placeholders from all string values in a JSON value (used to guard outgoing request bodies).
effective_address
Resolve effective address using ADDRESS section, env var, then protocol-dependent default. protocol_override takes precedence over OPTIONS.protocol from the document.
find_unresolved_placeholders
Append the names of unresolved {{ identifier }} placeholders found in text to out. A placeholder is unresolved when its body is a well-formed variable identifier that is absent from variables (i.e. the substitutor would have left it verbatim). Names are de-duplicated, order preserved.
format_json_pretty
Format JSON value for display.
format_unresolved_placeholders
Format unresolved variable names back as {{a}}, {{b}} for error messages.
full_service_name
Build full service name from package and service.
interpolate_variables
Interpolate variables in a string template. Replaces {{var}} patterns with values from the variables map. Returns None if no substitutions were made.
metadata_map_to_hashmap
Convert tonic metadata map to HashMap.
parse_bool_flag
Parse truthy values from config-style strings.
parse_compression_option
Resolve compression setting from OPTIONS section with env fallback.
resolve_compression
Resolve the effective compression mode honoring the canonical precedence section attribute > OPTIONS > env default. An explicit-but-unknown value at either level is a configuration error (never a silent fall-back).
resolve_effective_runtime_options
resolve_tls_path
Resolve a TLS file path relative to document or CWD.
substitute_variables
Recursively substitute variables in a JSON value. If a string is exactly {{var}}, it’s replaced with the actual Value type. Otherwise, string interpolation is performed.
tls_env_defaults
Default TLS configuration from environment variables.