run_config_smoke_tests

Function run_config_smoke_tests 

Source
pub async fn run_config_smoke_tests<T, Factory>(
    struct_name: &'static str,
    non_config_fields: &[&str],
    base_config: Value,
    config_factory: Factory,
)
where T: PartialEq + Serialize, Factory: Fn(GenericConfiguration) -> T,
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.

Environment values are supplied per test case rather than read from the ambient process environment, so an unrelated variable set by the surrounding shell cannot influence a result.