chore(deps): refresh workspace deps and linux fs_type gating (#3030)

* chore(deps): refresh workspace deps and linux fs_type gating

- refresh workspace dependency pins and lockfile updates

- remove now-unused crate dependency entries in multiple Cargo.toml files

- enable profiling export defaults in config and scripts/run.sh

- gate os::fs_type module/function/tests to Linux to avoid non-Linux dead_code warnings

* fix(utils): simplify fs_type linux gating

- keep fs_type module-level linux cfg in os::mod

- remove redundant linux cfg on get_fs_type and test module

* chore(deps): bump s3s git revision

- update workspace s3s dependency to rev 507e1312b211c3ddc214b03875d6fabd15d22ed5

- refresh Cargo.lock source entry for s3s

* chore(dev): allow mysql_async git source and env overrides

- allow mysql_async git source in deny.toml allow-git list

- make scripts/run.sh core env vars overrideable via existing shell env

* fix(utils): import get_fs_type in fs_type tests

- add explicit super::get_fs_type import in fs_type test module

- fix Linux E0425 unresolved function errors in unit tests

* chore(dev): tune run script observability defaults

- make profiling export env overrideable in scripts/run.sh

- set RUSTFS_OBS_SAMPLE_RATIO default from 2.0 to 1.0

- update allow-git review window comments in deny.toml

* test(obs): stabilize profiling env alias tests
This commit is contained in:
houseme
2026-05-20 23:03:07 +08:00
committed by GitHub
parent b2dfdf85de
commit dcbffb084f
15 changed files with 166 additions and 124 deletions
+31 -12
View File
@@ -54,6 +54,8 @@ use rustfs_utils::{
};
use serde::{Deserialize, Serialize};
use std::env;
#[cfg(test)]
use std::sync::{Mutex, OnceLock};
const LEGACY_ENV_OBS_PROFILING_ENABLED: &str = "RUSTFS_OBS_PROFILING_ENABLED";
@@ -429,32 +431,49 @@ pub fn is_production_environment() -> bool {
mod tests {
use super::*;
static PROFILING_ENV_TEST_LOCK: OnceLock<Mutex<()>> = OnceLock::new();
fn with_profiling_env_lock<F>(f: F)
where
F: FnOnce(),
{
let _guard = PROFILING_ENV_TEST_LOCK.get_or_init(|| Mutex::new(())).lock().unwrap();
f();
}
fn extract_profiling_export_enabled() -> Option<bool> {
OtelConfig::extract_otel_config_from_env(None).profiling_export_enabled
}
#[test]
fn profiling_export_defaults_to_disabled_when_unset() {
temp_env::with_var_unset(ENV_OBS_PROFILING_EXPORT_ENABLED, || {
temp_env::with_var_unset(LEGACY_ENV_OBS_PROFILING_ENABLED, || {
let config = OtelConfig::extract_otel_config_from_env(None);
assert_eq!(config.profiling_export_enabled, Some(false));
with_profiling_env_lock(|| {
temp_env::with_var_unset(ENV_OBS_PROFILING_EXPORT_ENABLED, || {
temp_env::with_var_unset(LEGACY_ENV_OBS_PROFILING_ENABLED, || {
assert_eq!(extract_profiling_export_enabled(), Some(DEFAULT_OBS_PROFILING_EXPORT_ENABLED));
});
});
});
}
#[test]
fn profiling_export_accepts_legacy_env_alias() {
temp_env::with_var_unset(ENV_OBS_PROFILING_EXPORT_ENABLED, || {
temp_env::with_var(LEGACY_ENV_OBS_PROFILING_ENABLED, Some("true"), || {
let config = OtelConfig::extract_otel_config_from_env(None);
assert_eq!(config.profiling_export_enabled, Some(true));
with_profiling_env_lock(|| {
temp_env::with_var_unset(ENV_OBS_PROFILING_EXPORT_ENABLED, || {
temp_env::with_var(LEGACY_ENV_OBS_PROFILING_ENABLED, Some("true"), || {
assert_eq!(extract_profiling_export_enabled(), Some(true));
});
});
});
}
#[test]
fn canonical_profiling_toggle_has_priority_over_legacy_alias() {
temp_env::with_var(LEGACY_ENV_OBS_PROFILING_ENABLED, Some("true"), || {
temp_env::with_var(ENV_OBS_PROFILING_EXPORT_ENABLED, Some("false"), || {
let config = OtelConfig::extract_otel_config_from_env(None);
assert_eq!(config.profiling_export_enabled, Some(false));
with_profiling_env_lock(|| {
temp_env::with_var(LEGACY_ENV_OBS_PROFILING_ENABLED, Some("true"), || {
temp_env::with_var(ENV_OBS_PROFILING_EXPORT_ENABLED, Some("false"), || {
assert_eq!(extract_profiling_export_enabled(), Some(false));
});
});
});
}