Skip to content

Commit 3075b0a

Browse files
fix(query): Some environment variable configurations do not work (#18384)
* x * fix --------- Co-authored-by: sundyli <[email protected]>
1 parent 9abe64b commit 3075b0a

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

โ€ŽCargo.lock

Lines changed: 7 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

โ€ŽCargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ serde_test = "1.0"
488488
serde_urlencoded = "0.7.1"
489489
serde_with = { version = "3.8.1" }
490490
serde_yaml = { version = "0.9.34" }
491-
serfig = "0.1.0"
491+
serfig = { git = "https://github.com/datafuse-extras/serfig", rev = "610ac6d" }
492492
sha1 = "0.10.5"
493493
sha2 = "0.10.8"
494494
simdutf8 = "0.1.4"

โ€Žsrc/query/config/src/config.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3529,7 +3529,7 @@ pub struct SpillConfig {
35293529
/// Allow space in bytes to spill to local disk.
35303530
pub spill_local_disk_max_bytes: u64,
35313531

3532-
// TODO: We need to fix StorageConfig so that it supports environment variables and command line injections.
3532+
// TODO: We need to fix StorageConfig so that it supports command line injections.
35333533
#[clap(skip)]
35343534
pub storage: Option<StorageConfig>,
35353535
}
@@ -3840,4 +3840,19 @@ mod test {
38403840
"default setting is different from default config, please check again"
38413841
)
38423842
}
3843+
3844+
#[test]
3845+
fn test_env() {
3846+
unsafe {
3847+
std::env::set_var("LOG_TRACING_OTLP_ENDPOINT", "http://127.0.2.1:1111");
3848+
std::env::set_var("LOG_TRACING_CAPTURE_LOG_LEVEL", "DebuG");
3849+
}
3850+
3851+
let cfg = Config::load_with_config_file("").unwrap();
3852+
assert_eq!(
3853+
cfg.log.tracing.tracing_otlp.endpoint,
3854+
"http://127.0.2.1:1111"
3855+
);
3856+
assert_eq!(cfg.log.tracing.tracing_capture_log_level, "DebuG");
3857+
}
38433858
}

0 commit comments

Comments
ย (0)