Skip to main content

run_config_smoke_tests

Function run_config_smoke_tests 

Source
pub async fn run_config_smoke_tests<T, Factory, P, PF>(
    struct_name: &'static str,
    non_config_fields: &[&str],
    base_config: Value,
    config_factory: Factory,
    key_aliases: &'static [(&'static str, &'static str)],
    provider_factory: PF,
)
where T: PartialEq + Serialize, Factory: Fn(GenericConfiguration) -> T, P: Provider + Send + Sync + 'static, PF: Fn() -> P,
Expand description

Runs smoke tests for all annotations registered to struct_name against a deserialized config struct T.

Verifies three properties:

Supported keys: loading the struct with the test value set via the annotation’s yaml_path and via each of its effective env vars must all produce identical structs, and each must differ from the default (empty-config) struct.

Unsupported keys: loading the struct with that key set must produce a struct identical to the default struct.

Full field coverage: loading the struct with all supported keys set simultaneously must produce a struct where every serialized leaf field differs from the default.

key_aliases and provider_factory configure the test config loader. Pass the same aliases and remapper factory used in production config loading.