macro_rules! test_set_config {
($(
$group_name:ident {
$(
$field_name:ident = $val:expr;
)+
}
)+) => { ... };
}Expand description
A macro for tests that sets config group environment variables before
XetRuntime is initialized. The environment variables follow the pattern
HF_XET_{GROUP_NAME}_{FIELD_NAME}.
This macro uses ctor to run on module load, ensuring environment variables
are set before any config values are read.
ยงExample
use xet_runtime::config::XetConfig;
use xet_runtime::test_set_config;
test_set_config! {
data {
max_concurrent_uploads = 16;
max_concurrent_downloads = 20;
}
client {
upload_reporting_block_size = 1024000;
}
}
// Now XetConfig::new() will pick up these values
let config = XetConfig::new();
assert_eq!(config.data.max_concurrent_uploads, 16);